Class ShadowSystemProperties


  • @Implements(value=android.os.SystemProperties.class,
                isInAndroidSdk=false)
    public class ShadowSystemProperties
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static java.lang.String native_get​(java.lang.String key)  
      protected static java.lang.String native_get​(java.lang.String key, java.lang.String def)  
      protected static boolean native_get_boolean​(java.lang.String key, boolean def)  
      protected static int native_get_int​(java.lang.String key, int def)  
      protected static long native_get_long​(java.lang.String key, long def)  
      protected static void native_set​(java.lang.String key, java.lang.String val)  
      static void override​(java.lang.String key, java.lang.String val)
      Overrides the system property for testing.
      static void reset()  
      • Methods inherited from class java.lang.Object

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

      • ShadowSystemProperties

        public ShadowSystemProperties()
    • Method Detail

      • native_get

        @Implementation
        protected static java.lang.String native_get​(java.lang.String key)
      • native_get

        @Implementation
        protected static java.lang.String native_get​(java.lang.String key,
                                                     java.lang.String def)
      • native_get_int

        @Implementation
        protected static int native_get_int​(java.lang.String key,
                                            int def)
      • native_get_long

        @Implementation
        protected static long native_get_long​(java.lang.String key,
                                              long def)
      • native_get_boolean

        @Implementation
        protected static boolean native_get_boolean​(java.lang.String key,
                                                    boolean def)
      • native_set

        @Implementation
        protected static void native_set​(java.lang.String key,
                                         java.lang.String val)
      • override

        public static void override​(java.lang.String key,
                                    java.lang.String val)
        Overrides the system property for testing. Similar to the Android implementation, the value may be coerced to other types like boolean or long depending on the get method that is used.

        Note: Use ShadowBuild instead for changing fields in Build.

      • reset

        @Resetter
        public static void reset()