@Implements(value=android.provider.Settings.class) public class ShadowSettings extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ShadowSettings.ShadowGlobal |
static class |
ShadowSettings.ShadowSecure |
static class |
ShadowSettings.ShadowSystem |
Constructor and Description |
---|
ShadowSettings() |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
canDrawOverlays(android.content.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)
Sets the value of the Settings.System#AIRPLANE_MODE_ON
setting.
isAirplaneMode
- new status for airplane modepublic static void setWifiOn(boolean isOn)
Non-Android accessor that allows the value of the WIFI_ON setting to be set.
isOn
- new status for wifi modepublic static void set24HourTimeFormat(boolean use24HourTimeFormat)
Sets the value of the Settings.System#TIME_12_24
setting.
use24HourTimeFormat
- new status for the time setting@Implementation(minSdk=23) protected static boolean canDrawOverlays(android.content.Context context)
false
by default, or the value specified via setCanDrawOverlays(boolean)
public static void setCanDrawOverlays(boolean canDrawOverlays)
Sets the value returned by canDrawOverlays(Context)
.
public static void setAdbEnabled(boolean adbEnabled)
Sets the value of the 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)
Sets the value of the 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()