public class Control
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
COMPONENT_ENABLED_STATE_DEFAULT |
static int |
COMPONENT_ENABLED_STATE_DISABLED |
static int |
COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED |
static int |
COMPONENT_ENABLED_STATE_DISABLED_USER |
static int |
COMPONENT_ENABLED_STATE_ENABLED |
static int |
DELETE_ALL_USERS |
static int |
DELETE_FAILED_ABORTED |
static int |
DELETE_FAILED_DEVICE_POLICY_MANAGER |
static int |
DELETE_FAILED_INTERNAL_ERROR |
static int |
DELETE_FAILED_OWNER_BLOCKED |
static int |
DELETE_FAILED_USER_RESTRICTED |
static int |
DELETE_KEEP_DATA |
static int |
DELETE_SUCCEEDED |
static int |
DELETE_SYSTEM_APP |
static int |
DOCK_AUDIO_MEDIA_DISABLED |
static int |
DOCK_AUDIO_MEDIA_ENABLED |
static int |
DONT_KILL_APP |
static int |
EMERGENCY_TONE_ALERT |
static int |
EMERGENCY_TONE_SILENT |
static int |
EMERGENCY_TONE_VIBRATE |
static int |
SOUND_CHARGING
Whether to play a sound for charging events.
|
static int |
SOUND_DIALPAD
Whether the audible DTMF tones are played by the dialer when dialing.
|
static int |
SOUND_DOCK_AUDIO_MEDIA
Use Dock audio output for media:
Control.DOCK_AUDIO_MEDIA_DISABLED : disable
Control.DOCK_AUDIO_MEDIA_ENABLED : enable |
static int |
SOUND_DOCKING
Whether to play a sound for dock events.
|
static int |
SOUND_EMERGENCY
CDMA only Settings
Emergency tone:
Control.EMERGENCY_TONE_SILENT : Off
Control.EMERGENCY_TONE_ALERT : Alert
Control.EMERGENCY_TONE_VIBRATE : Vibrate |
static int |
SOUND_SCREEN_LOCKING
Whether to play sounds when the keyguard is shown and dismissed.
|
static int |
SOUND_TOUCH
Whether the sounds effects (key clicks, lid open ...) are enabled.
|
static int |
SOUND_VIBRATE_ON_TOUCH
Whether the haptic feedback (long presses, ...) are enabled.
|
| Constructor and Description |
|---|
Control() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addWifiSsidsToWhiteList(java.util.List<java.lang.String> ssid) |
void |
adjustStreamVolume(int streamType,
int direction,
int flags)
[ MDM Support ]
Adjusts the volume of a particular stream by one step in a direction.
|
boolean |
areAllRotationsAllowed()
[ MDM Support ]
Returns true if this device is allowed all rotations.
|
boolean |
clearWifiSsidsFromWhiteList() |
void |
deletePackage(java.lang.String packageName,
android.content.pm.IPackageDeleteObserver observer,
int flags)
[ MDM Support ]
Attempts to delete a package.
|
int[] |
get24GHzChannelList()
[ MDM Support ]
Get 2.4GHz channel mask
|
int[] |
get5GHzChannelList()
[ MDM Support ]
Get 5GHz channel mask
|
boolean |
getAdbEnabled()
This function reads ADB(USB Debugging) flag.
|
int |
getBackgroundScanTrigger()
[ MDM Support ]
get background scan trigger
|
boolean |
getCCXSupporting()
[ MDM Support ]
get CCX supporting
|
java.lang.String |
getCountryCode()
[ MDM Support ]
get the country code.
|
boolean |
getDhcpNtpServer()
Whether DHCP NTP Server is set enabled or not.
|
boolean |
getEnable11d()
[ MDM Support ]
Get 802.11d setting
|
int |
getEnableAirplaneModeMenu()
[ MDM Support ]
Whether Airplane mode menu of power menu is set enabled or not.
|
int |
getEnabledOtherSounds(int soundType)
[ MDM Support ]
Gets the status to turn on and off or something the sound for each type.
|
int |
getEnableFOTAClientMenu()
[ MDM Support ]
Whether FOTA Client menu of System Update in Settings is set enabled or not.
|
java.lang.String |
getExpansion3p3vPower()
Deprecated.
Don't supported since Android 5.0.2.
|
java.lang.String |
getExpansion5vPower()
Deprecated.
Don't supported since Android 5.0.2.
|
java.lang.String |
getExpansionGpio()
Deprecated.
Don't supported since Android 5.0.2.
|
int |
getFrequencyBand()
[ MDM Support ]
get WiFi Polivy
|
java.lang.String |
getGpsPower()
Deprecated.
Don't supported since Android 5.0.2.
|
java.lang.String |
getHostname()
This function returns the configured hostname.
|
static Control |
getInstance() |
boolean |
getInternetAccessCheck()
[ MDM Support ]
get Internet Access Checking
|
boolean |
getKeepAliveMode()
[ MDM Support ]
get Keep Alive Mode
|
boolean |
getKeyboardBacklightEnabled()
This function reads the keyboard backlight flag.
|
int |
getLastAudibleStreamVolume(int streamType)
[ MDM Support ]
Get last audible volume before stream was muted.
|
java.lang.String |
getMockLocationApp()
[ MDM Support ]
Gets the package name of the mock location accepted application.
|
boolean |
getNavigationBarHide()
This function gets whether the navigation bar is hidden.
|
int |
getNfcEnabled()
[ MDM Support ]
Disable NFC hardware.
|
java.lang.String |
getNtpServer()
This function reads the currently configured NTP server.
|
boolean |
getOnlyHardKeyboardEnabled()
This function gets OnlyHardKeyBoard flag.
|
int |
getReconnectionInterval()
get Reconnection Interval setting for WLAN
|
int |
getRingerModeInternal()
[ MDM Support ]
Only useful for volume controllers.
|
int |
getRoamingTrigger()
[ MDM Support ]
get roaming trigger
|
int |
getRotationLockOrientation()
[ MDM Support ]
Returns the orientation that will be used when locking the orientation from system UI
with
Control.setRotationLock(boolean). |
int |
getScreenBrightness()
[ MDM Support ]
Gets the current value of the screen backlight brightness.
|
int |
getScreenBrightnessMax()
[ MDM Support ]
Gets the maximum adjusting resolution of the screen backlight brightness.
|
int |
getScreenOffTimeout()
[ MDM Support ]
Gets the timeout period to turn the screen off.
|
boolean |
getSendDeauthBeforeConnect()
[ MDM Support ]
get whether sending Deauth before connect
|
int |
getStreamMaxVolume(int streamType)
[ MDM Support ]
Returns the maximum volume index for a particular stream.
|
int |
getStreamVolume(int streamType)
[ MDM Support ]
Returns the current volume index for a particular stream.
|
java.lang.String |
getStyluspenMode()
Deprecated.
Don't supported since Android 5.0.2.
|
int |
getTouchSensitivityValue()
This function reads the touch sensitivity flag.
|
int |
getUsbPriority()
This function read the USB priority.
|
int |
getVibrateIntensity()
This function reads level of vibrate intensity.
|
boolean |
getVibrateOnTouchEnabled()
This function reads the vibrate on touch flag of Settings.
|
int |
getWifiApState()
[ MDM Support ]
Gets the Wi-Fi enabled state.
|
int |
getWifiSleepPolicy()
[ MDM Support ]
The policy for deciding when Wi-Fi should go to sleep (which will in
turn switch to using the mobile data as an Internet connection).
|
java.util.List<java.lang.String> |
getWifiSsidsFromWhiteLists() |
int |
getWifiState()
[ MDM Support ]
Gets the Wi-Fi enabled state.
|
boolean |
getWLANPowerSaveMode()
[ MDM Support ]
get PowerSaveMode of WLAN
|
boolean |
hasUserRestriction(java.lang.String restrictionKey)
[ MDM Support ]
Returns whether this system has been disallowed from performing certain actions
or setting certain settings.
|
boolean |
isAirplaneModeOn()
[ MDM Support ]
Returns true if airplane mode is currently on
|
boolean |
isApplicationHidden(java.lang.String packageName)
[ MDM Support ]
Called by profile or device owners to determine if a package is hidden.
|
boolean |
isAutoJoin()
get Auto Join setting of WLAN
|
boolean |
isEnabledOtherSoundsAll()
[ MDM Support ]
Gets the status whether the sound for all type is enabled.
|
boolean |
isEnabledScreenCapture()
[ MDM Support ]
Determine whether or not the device's screen capture have been enabled for all users,
either by the current admin, if specified, or all admins.
|
boolean |
isEnabledStayAwake()
[ MDM Support ]
Whether we keep the device on while the device is plugged in.
|
boolean |
isMediaMountRestriction()
[ MDM Support ]
Gets whether the media mount is restricted for data access.
|
boolean |
isMediaTransferRestriction()
[ MDM Support ]
Gets whether the media transfer protocol is restricted for data access.
|
boolean |
isNfcEnabledOption()
[ MDM Support ]
Whether the NFC enabled option is activated.
|
boolean |
isNonMarketAppsAllowed()
[ MDM Support ]
Whether applications can be installed for this user via the system's
Intent.ACTION_INSTALL_PACKAGE mechanism. |
boolean |
isNonMarketAppsAllowedOption()
[ MDM Support ]
Whether the installing non market app option is activated.
|
boolean |
isRestricted()
[ MDM Support ]
Indicates whether this system is restricted.
|
boolean |
isRestrictedMtp()
[ MDM Support ]
Indicates whether the MTP function is restricted.
|
boolean |
isRotationLocked()
[ MDM Support ]
Returns true if rotation lock is enabled.
|
boolean |
isRotationLockToggleVisible()
[ MDM Support ]
Returns true if the rotation-lock toggle should be shown in system UI.
|
boolean |
isStreamAffectedByRingerMode(int streamType)
[ MDM Support ]
Only useful for volume controllers.
|
boolean |
isStreamMute(int streamType)
[ MDM Support ]
Returns the current mute state for a particular stream.
|
boolean |
isUninstallBlocked(java.lang.String packageName)
[ MDM Support ]
Check whether the current user has been blocked by device policy from uninstalling a package.
|
boolean |
isUsbDebuggingRestriction()
[ MDM Support ]
Gets whether a USB debugging is restricted for security.
|
boolean |
isVolumeFixed()
[ MDM Support ]
Indicates if the device implements a fixed volume policy.
|
boolean |
isWifiApEnabled()
[ MDM Support ]
Return whether Wi-Fi AP is enabled or disabled.
|
void |
lockNow(boolean go2sleep)
This function locks the device immediately.
|
int |
osImageUpgrade(android.content.Context context,
int pathType,
java.lang.String filename)
[ MDM Support ]
get os image upgrade result code
|
void |
reboot(boolean confirm,
java.lang.String reason,
boolean wait)
[ MDM Support ]
Reboots the device.
|
boolean |
removeWifiSsidsFromWhiteList(java.util.List<java.lang.String> ssid) |
void |
saveWifiConfig(android.net.wifi.WifiConfiguration config)
[ MDM Support ]
Save the given network in the supplicant config.
|
void |
set24GHzChannelList(int[] channelList)
[ MDM Support ]
Set 2.4GHz channel mask
|
void |
set5GHzChannelList(int[] channelList)
[ MDM Support ]
Set 5GHz channel mask
|
void |
setAdbEnabled(boolean enabled)
This function write ADB(USB Debugging) flag.
|
void |
setAirplaneModeOn(boolean enabling)
[ MDM Support ]
Change the airplane mode system setting
|
void |
setApplicationEnabledSetting(java.lang.String packageName,
int newState)
[ MDM Support ]
Set the enabled setting for an application
This setting will override any enabled state which may have been set by the application in
its manifest.
|
boolean |
setApplicationHidden(java.lang.String packageName,
boolean hidden)
[ MDM Support ]
Called by profile or device owners to hide or unhide packages.
|
void |
setAutoJoin(boolean enable)
enable Auto Join feature of WLAN
|
void |
setBackgroundScanTrigger(int level)
[ MDM Support ]
set background scan trigger
Valid values of level : -50, -55, -60, -65, -70, -75, -80, -85, -90
|
void |
setCCXSupporting(boolean enable)
[ MDM Support ]
Enable/Disable CCX Supporting
|
void |
setCountryCode(java.lang.String country,
boolean persist)
[ MDM Support ]
Set the country code.
|
void |
setDataEnabled(boolean enabled)
This function can control mobile data enable or disable status.
|
void |
setDhcpNtpServer(boolean enabled)
DHCP NTP Server is set enabled / disabled.
|
void |
setEnable11d(boolean enable)
[ MDM Support ]
Enable/disable 802.11d setting.
|
void |
setEnableAirplaneModeMenu(int enabled)
[ MDM Support ]
Airplane mode menu of power menu set enabled / disabled.
|
void |
setEnabledOtherSounds(int soundType,
int value)
[ MDM Support ]
Sets the value to turn on and off or something the sound for each type.
|
void |
setEnabledOtherSoundsAll(boolean enabled)
[ MDM Support ]
Sets the status whether the sound for all type is enabled.
|
void |
setEnabledScreenCapture(boolean enabled)
[ MDM Support ]
Called by an application that is administering the device to enable all capturing screen
on the device, for all users.
|
void |
setEnabledStayAwake(boolean enabled)
[ MDM Support ]
Sets the state whether to keep to stay awake with plug.
|
void |
setEnableFOTAClientMenu(int enabled)
[ MDM Support ]
FOTA Client menu of System Update in Settings set enabled / disabled.
|
void |
setExpansion3p3vPower(boolean enabled)
Deprecated.
Don't supported since Android 5.0.2.
|
void |
setExpansion5vPower(boolean enabled)
Deprecated.
Don't supported since Android 5.0.2.
|
void |
setExpansionGpio(boolean enabled)
Deprecated.
Don't supported since Android 5.0.2.
|
void |
setFrequencyBand(int band,
boolean persist)
[ MDM Support ]
set WiFi Policy
Valid values of policy : 0 - Auto 1 - 802.11a 2 - 802.11b 3 - 802.11g 4 - 802.11ac
|
void |
setGpsAlwaysOff(boolean enabled)
This function writes the gps alwaysoff flag.
|
void |
setGpsAlwaysOn(boolean enabled)
This function writes the gps alwayson flag.
|
void |
setGpsPower(boolean enabled)
Deprecated.
Don't supported since Android 5.0.2.
|
boolean |
setHostname(java.lang.String hostname)
This function writes hostname into Settings.
|
void |
setInternetAccessCheck(boolean enable)
[ MDM Support ]
set Internet Access Checking
Valid values of level : true, false
|
void |
setKeepAliveMode(boolean enable)
[ MDM Support ]
set Keep Alive Mode
Valid values of level : true, false
|
void |
setKeyboardBacklightEnabled(boolean enabled)
This function writes the keyboard backlight flag.
|
boolean |
setMediaMountRestriction(boolean enable)
[ MDM Support ]
Sets whether or not to restrict the media mount for data access.
|
boolean |
setMediaTransferRestriction(boolean enable)
[ MDM Support ]
Sets whether or not to restrict the media transfer protocol for data access.
|
boolean |
setMockLocationApp(java.lang.String packageName)
[ MDM Support ]
Sets the mock location application package name one by one.
|
void |
setNavigationBarHide(boolean enabled)
This function can hide the navigation bar forcibly.
|
int |
setNfcEnabled(boolean enabled)
[ MDM Support ]
Enable NFC hardware.
|
void |
setNfcEnabledOption(boolean enabled)
[ MDM Support ]
Sets the value to activate the NFC enabled option.
|
boolean |
setNonMarketAppsAllowed(boolean enabled)
[ MDM Support ]
Sets the value to allow for installing non market app.
|
void |
setNonMarketAppsAllowedOption(boolean enabled)
[ MDM Support ]
Sets the value to activate the installing non market app option.
|
void |
setNtpServer(java.lang.String address)
This function writes the NTP server address into Settings.
|
void |
setOnlyHardKeyboardEnabled(boolean enabled)
This function sets OnlyHardKeyBoard flag.
|
boolean |
setReconnectionInterval(int reconnectionInterval)
Set Reconnection Interval setting for WLAN
Valid values of Interval : 5, 10, 15, 20, 25, 30, 60, 120, 160
|
boolean |
setRestrictedMtp(boolean enabled)
[ MDM Support ]
Sets the value of the MTP function restriction.
|
void |
setRoamingTrigger(int level)
[ MDM Support ]
set roaming trigger
Valid values of level : -50, -55, -60, -65, -70, -75, -80, -85, -90
|
void |
setRotationLock(boolean locked)
[ MDM Support ]
Enables or disables rotation lock from the system UI toggle.
|
void |
setScreenBrightness(boolean tracking,
int value)
[ MDM Support ]
Sets the value of the screen backlight brightness.
|
boolean |
setScreenOffTimeout(int timeout)
[ MDM Support ]
Sets the expiry time to turn the screen off by automatic.
|
void |
setSendDeauthBeforeConnect(boolean enable)
[ MDM Support ]
Send Deauth before connect
|
void |
setStreamVolume(int streamType,
int index,
int flags)
[ MDM Support ]
Sets the volume index for a particular stream.
|
void |
setStyluspenMode(boolean enabled)
Deprecated.
Don't supported since Android 5.0.2.
|
void |
setTouchSensitivityValue(int sensitivity)
This function writes the touch sensitivity flag.
|
void |
setUninstallBlocked(java.lang.String packageName,
boolean uninstallBlocked)
[ MDM Support ]
Called by profile or device owners to change whether a user can uninstall a package.
|
boolean |
setUsbDebuggingRestriction(boolean enable)
[ MDM Support ]
Sets whether or not to restrict a USB debugging for security.
|
boolean |
setUsbPriority(int usbType)
This function write the USB priority.
|
void |
setUserRestriction(java.lang.String key,
boolean value)
[ MDM Support ]
Sets the value of a specific restriction.
|
void |
setVibrateIntensity(int level)
This function write level of vibrate intensity.
|
void |
setVibrateOnTouchEnabled(boolean enabled)
This function stores the vibrate on touch flag of Settings.
|
boolean |
setWifiApEnabled(android.net.wifi.WifiConfiguration wifiConfig,
boolean enabled)
[ MDM Support ]
Start AccessPoint mode with the specified
configuration.
|
boolean |
setWifiEnabled(boolean enabled)
[ MDM Support ]
Enable or disable Wi-Fi.
|
void |
setWifiSleepPolicy(int sleepPolicy)
[ MDM Support ]
Sets wifi sleep policy to never on while in sleep
|
void |
setWLANPowerSaveMode(boolean enable)
[ MDM Support ]
Enable/Disable PowerSaveMode of WLAN
|
public static final int DELETE_KEEP_DATA
public static final int DELETE_ALL_USERS
public static final int DELETE_SYSTEM_APP
public static final int DONT_KILL_APP
public static final int DELETE_SUCCEEDED
public static final int DELETE_FAILED_INTERNAL_ERROR
public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER
public static final int DELETE_FAILED_USER_RESTRICTED
public static final int DELETE_FAILED_OWNER_BLOCKED
public static final int DELETE_FAILED_ABORTED
public static final int COMPONENT_ENABLED_STATE_DEFAULT
public static final int COMPONENT_ENABLED_STATE_ENABLED
public static final int COMPONENT_ENABLED_STATE_DISABLED
public static final int COMPONENT_ENABLED_STATE_DISABLED_USER
public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
public static final int SOUND_DIALPAD
public static final int SOUND_SCREEN_LOCKING
public static final int SOUND_CHARGING
public static final int SOUND_DOCKING
public static final int SOUND_TOUCH
public static final int SOUND_VIBRATE_ON_TOUCH
public static final int SOUND_DOCK_AUDIO_MEDIA
Control.DOCK_AUDIO_MEDIA_DISABLED : disable
Control.DOCK_AUDIO_MEDIA_ENABLED : enablepublic static final int SOUND_EMERGENCY
Control.EMERGENCY_TONE_SILENT : Off
Control.EMERGENCY_TONE_ALERT : Alert
Control.EMERGENCY_TONE_VIBRATE : Vibratepublic static final int EMERGENCY_TONE_SILENT
public static final int EMERGENCY_TONE_ALERT
public static final int EMERGENCY_TONE_VIBRATE
public static final int DOCK_AUDIO_MEDIA_DISABLED
public static final int DOCK_AUDIO_MEDIA_ENABLED
public static Control getInstance()
@Deprecated
public java.lang.String getExpansion5vPower()
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public void setExpansion5vPower(boolean enabled)
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public java.lang.String getExpansion3p3vPower()
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public void setExpansion3p3vPower(boolean enabled)
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public java.lang.String getExpansionGpio()
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public void setExpansionGpio(boolean enabled)
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public java.lang.String getGpsPower()
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public void setGpsPower(boolean enabled)
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public java.lang.String getStyluspenMode()
throws android.os.RemoteException
android.os.RemoteException@Deprecated
public void setStyluspenMode(boolean enabled)
throws android.os.RemoteException
android.os.RemoteExceptionpublic boolean getNavigationBarHide()
throws android.os.RemoteException
Control.setNavigationBarHide(boolean)android.os.RemoteExceptionpublic void setNavigationBarHide(boolean enabled)
throws android.os.RemoteException
Control.getNavigationBarHide()enabled - Sets the navigation bar to hide forcibly with boolean
true : Invisible the navigation bar. false : Visible the navigation bar.
android.os.RemoteExceptionpublic boolean getOnlyHardKeyboardEnabled()
throws android.os.RemoteException
android.os.RemoteExceptionpublic void setOnlyHardKeyboardEnabled(boolean enabled)
throws android.os.RemoteException
enabled - OnlyHardKeyBoard flag with boolean
true : Invisible SoftKeyboard false : Visible SoftKeyboard
android.os.RemoteExceptionpublic boolean getAdbEnabled()
throws android.os.RemoteException
android.os.RemoteExceptionControl.setAdbEnabled(boolean)public void setAdbEnabled(boolean enabled)
throws android.os.RemoteException
enabled - ADB(USB Debugging) flag with boolean
"true" : Enable ADB(USB Debugging) "false" : Disable ADB(USB Debugging)
android.os.RemoteExceptionControl.getAdbEnabled()public int getVibrateIntensity()
Control.setVibrateIntensity(int)public void setVibrateIntensity(int level)
level - level of vibrate intensity with integer (MIN : 0, MAX : 7)Control.getVibrateIntensity()public boolean getKeyboardBacklightEnabled()
Control.setKeyboardBacklightEnabled(boolean)public void setKeyboardBacklightEnabled(boolean enabled)
enabled - Keyboard backlight flag with boolean
"true" : Enable the keyboard backlight "false" : Disable the keyboard backlight
Control.getKeyboardBacklightEnabled()public int getTouchSensitivityValue()
Control.setTouchSensitivityValue(int)public void setTouchSensitivityValue(int sensitivity)
enabled - touch sensitivity flag with integer
"0" : the touch sensitivity low "1" : the touch sensitivity medium "2" : the touch sensitivity high
Control.getTouchSensitivityValue()public boolean getVibrateOnTouchEnabled()
Control.setVibrateOnTouchEnabled(boolean)public void setVibrateOnTouchEnabled(boolean enabled)
enabled - Vibrate on touch flag with boolean
"true" : the vibrate on touch status of Settings is enabled "false" : the vibrate on touch status of Settings is disabled
Control.getVibrateOnTouchEnabled()public void setGpsAlwaysOn(boolean enabled)
enabled - Gps alwayson flag with boolean
"true" : Enable the Gps always on "false" : Disable the Gps always on
Control.setGpsAlwaysOn(boolean),
Control.setGpsAlwaysOff(boolean)public void setGpsAlwaysOff(boolean enabled)
enabled - Gps alwaysoff flag with boolean
"true" : Enable the Gps always off "false" : Disable the Gps always off
Control.setGpsAlwaysOn(boolean),
Control.setGpsAlwaysOff(boolean)public void setDataEnabled(boolean enabled)
enabled - mobile data enable flag with boolean
"true" : Enable the mobile data "false" : Disable the mobile data
Control.setDataEnabled(boolean)public java.lang.String getNtpServer()
String The currently configured NTP server's domain name or IP addressControl.setNtpServer(java.lang.String)public void setNtpServer(java.lang.String address)
address - String Domain name or IP address about NTP serverControl.getNtpServer()public void lockNow(boolean go2sleep)
go2sleep - boolean Whether or not the device should be sleep.public java.lang.String getHostname()
String The currently configured hostnameControl.setHostname(java.lang.String)public boolean setHostname(java.lang.String hostname)
hostname - String hostnameControl.getHostname()public void setEnable11d(boolean enable)
NOTE: The rebooting is required to affect this setting.
enable - true if enable 802.11d settingControl.getEnable11d()public boolean getEnable11d()
Control.setEnable11d(boolean)public void set24GHzChannelList(int[] channelList)
Available channel list is as follows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
int list[] = new int[3]; list[0] = 3; list[1] = 5; list[2] = 9; Control control = new Control(); control.set24GHzChannelList(list);
channelList - a list of channel which user need to enable
Possible values : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13
Control.get24GHzChannelList()public int[] get24GHzChannelList()
int list[]; Control control = new Control(); list = control.get24GHzChannelList();
Control.set24GHzChannelList(int[])public void set5GHzChannelList(int[] channelList)
Available channel list is as follows: 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165
int list[] = new int[3]; list[0] = 44; list[1] = 104; list[2] = 149; Control control = new Control(); control.set5GHzChannelList(list);
channelList - a list of channel which user need to enable
Possible values : 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165
Control.get5GHzChannelList()public int[] get5GHzChannelList()
int list[]; Control control = new Control(); list = control.get24GHzChannelList();
Control.set5GHzChannelList(int[])public void setCountryCode(java.lang.String country,
boolean persist)
countryCode - country code in ISO 3166 format.persist - true if this needs to be rememberedControl.getCountryCode()public java.lang.String getCountryCode()
Control.setCountryCode(String, boolean)public void setWLANPowerSaveMode(boolean enable)
NOTE: The rebooting is required to affect this setting.
enable - trueControl.getWLANPowerSaveMode()public boolean getWLANPowerSaveMode()
#setWLANPowerSaveMode()public void setCCXSupporting(boolean enable)
NOTE: The rebooting is required to affect this setting.
enable - trueControl.getCCXSupporting()public boolean getCCXSupporting()
#setCCXSupporting()public void setSendDeauthBeforeConnect(boolean enable)
NOTE: The rebooting is required to affect this setting.
enable - trueControl.getSendDeauthBeforeConnect()public boolean getSendDeauthBeforeConnect()
#setSendDeauthBeforeConnect()public void setBackgroundScanTrigger(int level)
NOTE: The rebooting is required to affect this setting.
level - Background scan triggerControl.getBackgroundScanTrigger()public int getBackgroundScanTrigger()
#setBackgroundScanTrigger()public void setRoamingTrigger(int level)
NOTE: The rebooting is required to affect this setting.
level - roaming trigger levelControl.getRoamingTrigger()public int getRoamingTrigger()
#setRoamingTrigger()public void setInternetAccessCheck(boolean enable)
enable - Enable/Disable Internet access checkingControl.getInternetAccessCheck()public boolean getInternetAccessCheck()
#setInternetAccessCheck()public void setKeepAliveMode(boolean enable)
enable - Enable/Disable Keep Alive ModeControl.getKeepAliveMode()public boolean getKeepAliveMode()
#setKeepAliveMode()public int getFrequencyBand()
#setWiFiRadioPolicy()public boolean addWifiSsidsToWhiteList(java.util.List<java.lang.String> ssid)
public boolean clearWifiSsidsFromWhiteList()
public java.util.List<java.lang.String> getWifiSsidsFromWhiteLists()
public boolean removeWifiSsidsFromWhiteList(java.util.List<java.lang.String> ssid)
public void setFrequencyBand(int band,
boolean persist)
NOTE: The rebooting is required to affect this setting.
policy - Policy of WiFi Radio#getWiFiRadioPolicy()public void setEnabledScreenCapture(boolean enabled)
enabled - Whether or not the screen capture should be enabled.Control.isEnabledScreenCapture()public boolean isEnabledScreenCapture()
Control.setEnabledScreenCapture(boolean)public boolean isRestricted()
true if this system is restricted, false otherwise.public void setUserRestriction(java.lang.String key,
boolean value)
key - the key of the restrictionvalue - the value for the restrictionpublic boolean hasUserRestriction(java.lang.String restrictionKey)
restrictionKey - The string key representing the restriction.true if this system has the given restriction, false otherwise.public boolean setNonMarketAppsAllowed(boolean enabled)
enabled - true permit app installation via the system package installer intent, false do not allow use of the package installer.true if this option sets successfully, false otherwise.Control.isNonMarketAppsAllowed()public boolean isNonMarketAppsAllowed()
Intent.ACTION_INSTALL_PACKAGE mechanism.true if this system has allowed app installation via the system package installer intent, false otherwise.Control.setNonMarketAppsAllowed(boolean)public void setNonMarketAppsAllowedOption(boolean enabled)
enabled - true If activates the installing non market app option, false otherwise.Control.isNonMarketAppsAllowedOption()public boolean isNonMarketAppsAllowedOption()
true If activates the installing non market app option, false otherwise.Control.setNonMarketAppsAllowedOption(boolean)public int setNfcEnabled(boolean enabled)
This call is asynchronous. Listen for
#ACTION_ADAPTER_STATE_CHANGED broadcasts to find out when the
operation is complete.
If this returns true, then either NFC is already on, or
a #ACTION_ADAPTER_STATE_CHANGED broadcast will be sent
to indicate a state transition. If this returns false, then
there is some problem that prevents an attempt to turn
NFC on (for example we are in airplane mode and NFC is not
toggleable in airplane mode on this platform).
Control.getNfcEnabled()public int getNfcEnabled()
No NFC features will work after this call, and the hardware will not perform or respond to any NFC communication.
This call is asynchronous. Listen for
#ACTION_ADAPTER_STATE_CHANGED broadcasts to find out when the
operation is complete.
If this returns true, then either NFC is already off, or
a #ACTION_ADAPTER_STATE_CHANGED broadcast will be sent
to indicate a state transition. If this returns false, then
there is some problem that prevents an attempt to turn
NFC off.
Control.setNfcEnabled(boolean)public void setNfcEnabledOption(boolean enabled)
enabled - true If activates the NFC enabled option, false otherwise.Control.isNfcEnabledOption()public boolean isNfcEnabledOption()
true If activates the NFC enabled option, false otherwise.Control.setNfcEnabledOption(boolean)public int getScreenBrightnessMax()
int The maximum resolution value up to 255.Control.getScreenBrightness()public int getScreenBrightness()
int The current brightness value between 0 and 255.Control.setScreenBrightness(boolean, int)public void setScreenBrightness(boolean tracking,
int value)
tracking - true If it's performing a continuous action.value - The screen backlight brightness between 0 and 255.public boolean areAllRotationsAllowed()
public boolean isRotationLockToggleVisible()
public int getRotationLockOrientation()
Control.setRotationLock(boolean).
If the device only supports locking to its natural orientation, this will be either
Configuration.ORIENTATION_PORTRAIT or Configuration.ORIENTATION_LANDSCAPE,
otherwise Configuration.ORIENTATION_UNDEFINED if any orientation is lockable.public boolean isRotationLocked()
public void setRotationLock(boolean locked)
public int getScreenOffTimeout()
public boolean setScreenOffTimeout(int timeout)
timeout - The amount of time in milliseconds.public boolean isEnabledStayAwake()
true if it keeps state to stay awake with plug, false otherwise.public void setEnabledStayAwake(boolean enabled)
enabled - true to enable, false to disable.public java.lang.String getMockLocationApp()
String if it has the mock location application.public boolean setMockLocationApp(java.lang.String packageName)
public boolean isUninstallBlocked(java.lang.String packageName)
packageName - package to check.public void setUninstallBlocked(java.lang.String packageName,
boolean uninstallBlocked)
packageName - package to change.uninstallBlocked - true if the user shouldn't be able to uninstall the package.public boolean isApplicationHidden(java.lang.String packageName)
packageName - The name of the package to retrieve the hidden status of.true if the package is hidden, false otherwise.public boolean setApplicationHidden(java.lang.String packageName,
boolean hidden)
packageName - The name of the package to hide or unhide.hidden - true if the package should be hidden, false if it should be unhidden.public void setApplicationEnabledSetting(java.lang.String packageName,
int newState)
#setComponentEnabledSetting for any of the application's components.packageName - The package name of the application to enablenewState - The new enabled state for the component. The legal values for this state
are:
Control.COMPONENT_ENABLED_STATE_ENABLED,
Control.COMPONENT_ENABLED_STATE_DISABLED
and
Control.COMPONENT_ENABLED_STATE_DEFAULT
The last one removes the setting, thereby restoring the applications's state to
whatever was set in its manifest (or enabled, by default).public void deletePackage(java.lang.String packageName,
android.content.pm.IPackageDeleteObserver observer,
int flags)
packageName - The name of the package to deleteobserver - An observer callback to get notified when the package deletion is
complete. android.content.pm.IPackageDeleteObserver#packageDeleted(boolean) will be
called when that happens. observer may be null to indicate that no callback is desired.flags - - possible values: Control.DELETE_KEEP_DATA,
Control.DELETE_ALL_USERS.public boolean isStreamAffectedByRingerMode(int streamType)
public int getRingerModeInternal()
public int getStreamMaxVolume(int streamType)
streamType - The stream type whose maximum volume index is returned.Control.getStreamVolume(int)public int getStreamVolume(int streamType)
streamType - The stream type whose volume index is returned.Control.getStreamMaxVolume(int),
Control.setStreamVolume(int, int, int)public int getLastAudibleStreamVolume(int streamType)
public boolean isStreamMute(int streamType)
streamType - The stream to get mute state for.Control.adjustStreamVolume(int, int, int)public void adjustStreamVolume(int streamType,
int direction,
int flags)
This method should only be used by applications that replace the platform-wide management of audio settings or the main telephony application.
streamType - The stream type to adjust. One of #STREAM_VOICE_CALL,
#STREAM_SYSTEM, #STREAM_RING, #STREAM_MUSIC or
#STREAM_ALARMdirection - The direction to adjust the volume. One of
#ADJUST_LOWER, #ADJUST_RAISE, or
#ADJUST_SAME.flags - One or more flags.Control.setStreamVolume(int, int, int)public void setStreamVolume(int streamType,
int index,
int flags)
This method has no effect if the device implements a fixed volume policy
as indicated by Control.isVolumeFixed().
streamType - The stream whose volume index should be set.index - The volume index to set. See
Control.getStreamMaxVolume(int) for the largest valid value.flags - One or more flags.Control.getStreamMaxVolume(int),
Control.getStreamVolume(int),
Control.isVolumeFixed()public boolean isVolumeFixed()
Some devices may not have volume control and may operate at a fixed volume, and may not enable muting or changing the volume of audio streams. This method will return true on such devices.
public int getEnabledOtherSounds(int soundType)
soundType - The sound type. One of Control.SOUND_DIALPAD,
Control.SOUND_SCREEN_LOCKING, Control.SOUND_CHARGING, Control.SOUND_DOCKING
Control.SOUND_TOUCH, Control.SOUND_VIBRATE_ON_TOUCH, Control.SOUND_DOCK_AUDIO_MEDIA or
Control.SOUND_EMERGENCYControl.setEnabledOtherSounds(int, int)public void setEnabledOtherSounds(int soundType,
int value)
soundType - The sound type. One of Control.SOUND_DIALPAD,
Control.SOUND_SCREEN_LOCKING, Control.SOUND_CHARGING, Control.SOUND_DOCKING
Control.SOUND_TOUCH, Control.SOUND_VIBRATE_ON_TOUCH, Control.SOUND_DOCK_AUDIO_MEDIA or
Control.SOUND_EMERGENCYvalue - Whether each type of sound is active or something.Control.getEnabledOtherSounds(int)public boolean isAirplaneModeOn()
public void setAirplaneModeOn(boolean enabling)
public int getWifiSleepPolicy()
Set to one of #WIFI_SLEEP_POLICY_DEFAULT,
#WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED, or
#WIFI_SLEEP_POLICY_NEVER.
public void setWifiSleepPolicy(int sleepPolicy)
public int getWifiState()
#WIFI_STATE_DISABLED,
#WIFI_STATE_DISABLING, #WIFI_STATE_ENABLED,
#WIFI_STATE_ENABLING, #WIFI_STATE_UNKNOWN#isWifiEnabled()public boolean setWifiEnabled(boolean enabled)
enabled - true to enable, false to disable.true if the operation succeeds (or if the existing state
is the same as the requested state).public int getWifiApState()
#WIFI_AP_STATE_DISABLED,
#WIFI_AP_STATE_DISABLING, #WIFI_AP_STATE_ENABLED,
#WIFI_AP_STATE_ENABLING, #WIFI_AP_STATE_FAILEDControl.isWifiApEnabled()public boolean isWifiApEnabled()
true if Wi-Fi AP is enabledControl.getWifiApState()public boolean setWifiApEnabled(android.net.wifi.WifiConfiguration wifiConfig,
boolean enabled)
wifiConfig - SSID, security and channel details as
part of WifiConfigurationtrue if the operation succeeds, false otherwisepublic int osImageUpgrade(android.content.Context context,
int pathType,
java.lang.String filename)
pathType - PFU file pathfilename - PFU file nameNOTE: The rebooting is required to affect this setting.
public boolean isEnabledOtherSoundsAll()
Control.SOUND_DIALPAD, Control.SOUND_SCREEN_LOCKING,
Control.SOUND_CHARGING, Control.SOUND_DOCKING,
Control.SOUND_TOUCH, Control.SOUND_VIBRATE_ON_TOUCH,
Control.SOUND_DOCK_AUDIO_MEDIA and Control.SOUND_EMERGENCY#getEnabledOtherSounds(int, int)public void setEnabledOtherSoundsAll(boolean enabled)
Control.SOUND_DIALPAD, Control.SOUND_SCREEN_LOCKING,
Control.SOUND_CHARGING, Control.SOUND_DOCKING,
Control.SOUND_TOUCH, Control.SOUND_VIBRATE_ON_TOUCH,
Control.SOUND_DOCK_AUDIO_MEDIA and Control.SOUND_EMERGENCY
Control.SOUND_EMERGENCY can't set Control.EMERGENCY_TONE_VIBRATE.value - Whether each type of sound is active.Control.getEnabledOtherSounds(int)public void setAutoJoin(boolean enable)
enable - trueControl.isAutoJoin()public boolean isAutoJoin()
#setAutoJoin()public void reboot(boolean confirm,
java.lang.String reason,
boolean wait)
confirm - If true, shows a reboot confirmation dialog.reason - The reason for the reboot, or null if none.wait - If true, this call waits for the reboot to complete and does not return.public int getReconnectionInterval()
Control.getReconnectionInterval()public boolean setReconnectionInterval(int reconnectionInterval)
reconnectionInterval - Reconnection periodic single interval for WLAN.#setReconnectionInterval()public void saveWifiConfig(android.net.wifi.WifiConfiguration config)
config - the set of variables that describe the configuration,
contained in a WifiConfiguration object.listener - for callbacks on success or failure. Can be null.java.lang.IllegalStateException - if the WifiManager instance needs to be
initialized againpublic void setEnableFOTAClientMenu(int enabled)
enabled - if enabled is 1, show the menu.public int getEnableFOTAClientMenu()
public void setEnableAirplaneModeMenu(int enabled)
enabled - if enabled is 1, show the menu.public int getEnableAirplaneModeMenu()
public boolean setUsbPriority(int usbType)
usbType - String USB type
"0" : C-Type "1" : Cradle
Control.setUsbPriority(int)public int getUsbPriority()
"-1" : None "0" : C-Type "1" : Cradle
Control.getUsbPriority()public boolean isRestrictedMtp()
true if the MTP function is restricted, false otherwise.public boolean setRestrictedMtp(boolean enabled)
enabled - the MTP function with booleanpublic void setDhcpNtpServer(boolean enabled)
enabled - if enabled is true, using DHCP NTP Server.Control.getDhcpNtpServer()public boolean getDhcpNtpServer()
Control.setDhcpNtpServer(boolean)public boolean setMediaTransferRestriction(boolean enable)
enable - true to restrict the media transfer protocol.true if the setting is successful, false otherwise.public boolean isMediaTransferRestriction()
true if restricting the media transfer protocol, false otherwise.public boolean setUsbDebuggingRestriction(boolean enable)
enable - true to restrict a USB debugging.true if the setting is successful, false otherwise.public boolean isUsbDebuggingRestriction()
true if restricting a USB debuggging, false otherwise.public boolean setMediaMountRestriction(boolean enable)
enable - true to restrict the media mount.true if the setting is successful, false otherwise.public boolean isMediaMountRestriction()
true if restriction the media mount, false otherwise.