Class ShadowSettings


  • @Implements(android.provider.Settings.class)
    public class ShadowSettings
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadowSettings()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowSettings

        public ShadowSettings()
    • Method Detail

      • setAirplaneMode

        public static void setAirplaneMode​(boolean isAirplaneMode)
        Sets the value of the Settings.System.AIRPLANE_MODE_ON setting.
        Parameters:
        isAirplaneMode - new status for airplane mode
      • setWifiOn

        public static void setWifiOn​(boolean isOn)
        Non-Android accessor that allows the value of the WIFI_ON setting to be set.
        Parameters:
        isOn - new status for wifi mode
      • set24HourTimeFormat

        public static void set24HourTimeFormat​(boolean use24HourTimeFormat)
        Sets the value of the Settings.System.TIME_12_24 setting.
        Parameters:
        use24HourTimeFormat - new status for the time setting
      • canDrawOverlays

        @Implementation(minSdk=23)
        protected static boolean canDrawOverlays​(android.content.Context context)
        Returns:
        false by default, or the value specified via setCanDrawOverlays(boolean)
      • setCanDrawOverlays

        public static void setCanDrawOverlays​(boolean canDrawOverlays)
        Sets the value returned by canDrawOverlays(Context).
      • setAdbEnabled

        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.
        Parameters:
        adbEnabled - new value for whether adb is enabled
      • setInstallNonMarketApps

        public 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.
        Parameters:
        installNonMarketApps - new value for whether non-market apps are allowed to be installed
      • reset

        @Resetter
        public static void reset()