@Implements(android.provider.Settings.class) public class ShadowSettings extends Object
Modifier and Type | Class | Description |
---|---|---|
static class |
ShadowSettings.ShadowGlobal |
|
static class |
ShadowSettings.ShadowSecure |
|
static class |
ShadowSettings.ShadowSystem |
Constructor | Description |
---|---|
ShadowSettings() |
Modifier and Type | Method | Description |
---|---|---|
protected static boolean |
canDrawOverlays(Context context) |
|
static void |
reset() |
|
static void |
set24HourTimeFormat(boolean use24HourTimeFormat) |
Sets the value of the
Settings.System.TIME_12_24 setting. |
static void |
setAdbEnabled(boolean adbEnabled) |
Sets the value of the
Settings.Global.ADB_ENABLED setting or Settings.Secure.ADB_ENABLED depending on API level. |
static void |
setAirplaneMode(boolean isAirplaneMode) |
Sets the value of the
Settings.System.AIRPLANE_MODE_ON setting. |
static void |
setCanDrawOverlays(boolean canDrawOverlays) |
Sets the value returned by
canDrawOverlays(Context) . |
static void |
setInstallNonMarketApps(boolean installNonMarketApps) |
Sets the value of the
Settings.Global.INSTALL_NON_MARKET_APPS setting or Settings.Secure.INSTALL_NON_MARKET_APPS depending on API level. |
static void |
setWifiOn(boolean isOn) |
Non-Android accessor that allows the value of the WIFI_ON setting to be set.
|
public static void setAirplaneMode(boolean isAirplaneMode)
Settings.System.AIRPLANE_MODE_ON
setting.isAirplaneMode
- new status for airplane modepublic static void setWifiOn(boolean isOn)
isOn
- new status for wifi modepublic static void set24HourTimeFormat(boolean use24HourTimeFormat)
Settings.System.TIME_12_24
setting.use24HourTimeFormat
- new status for the time setting@Implementation(minSdk=23) protected static boolean canDrawOverlays(Context context)
setCanDrawOverlays(boolean)
public static void setCanDrawOverlays(boolean canDrawOverlays)
canDrawOverlays(Context)
.public static void setAdbEnabled(boolean adbEnabled)
Settings.Global.ADB_ENABLED
setting or Settings.Secure.ADB_ENABLED
depending on API level.adbEnabled
- new value for whether adb is enabledpublic static void setInstallNonMarketApps(boolean installNonMarketApps)
Settings.Global.INSTALL_NON_MARKET_APPS
setting or Settings.Secure.INSTALL_NON_MARKET_APPS
depending on API level.installNonMarketApps
- new value for whether non-market apps are allowed to be installed@Resetter public static void reset()