diff options
| author | Sundong Ahn <sundongahn@google.com> | 2018-01-03 19:16:01 +0900 |
|---|---|---|
| committer | Sundong Ahn <sundongahn@google.com> | 2018-01-23 10:02:58 +0900 |
| commit | 5e05a9ae1c04f141f66ca4f420e314f625eec8c3 (patch) | |
| tree | a31c85cd75e58a76b0847de0857266fe0bebf7ad /core/java/android/os/SystemProperties.java | |
| parent | 98da482eca4a4b6551e23b39470d118efeadf421 (diff) | |
Add SystemApi in SystemProperties for vendor apks
The Apis in SystemProperties are needed for building ims.apk with
LOCAL_SDK_VERSION := system_current. So @SystemApi is added to
SystemProperties class and methods which are used by vendor apks (i.e.
ims.apk)
Bug: 67726847
Test: 1. build & boot on taimen
2. LOCAL_SDK_VERSION:=system_current in ims.apk && build ims.apk &&
check error count and android_system_stubs_current_intermediates.
Change-Id: I178f8d9b0b1f6bb1455ceec919805c4cc549cb32
Diffstat (limited to 'core/java/android/os/SystemProperties.java')
| -rw-r--r-- | core/java/android/os/SystemProperties.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/core/java/android/os/SystemProperties.java b/core/java/android/os/SystemProperties.java index 4f6d322ba871..a9b86752ee54 100644 --- a/core/java/android/os/SystemProperties.java +++ b/core/java/android/os/SystemProperties.java @@ -18,6 +18,7 @@ package android.os; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.SystemApi; import android.util.Log; import android.util.MutableInt; @@ -33,6 +34,7 @@ import java.util.HashMap; * * {@hide} */ +@SystemApi public class SystemProperties { private static final String TAG = "SystemProperties"; private static final boolean TRACK_KEY_ACCESS = false; @@ -40,9 +42,11 @@ public class SystemProperties { /** * Android O removed the property name length limit, but com.amazon.kindle 7.8.1.5 * uses reflection to read this whenever text is selected (http://b/36095274). + * @hide */ public static final int PROP_NAME_MAX = Integer.MAX_VALUE; + /** @hide */ public static final int PROP_VALUE_MAX = 91; @GuardedBy("sChangeCallbacks") @@ -86,8 +90,10 @@ public class SystemProperties { * * @param key the key to lookup * @return an empty string if the {@code key} isn't found + * @hide */ @NonNull + @SystemApi public static String get(@NonNull String key) { if (TRACK_KEY_ACCESS) onKeyAccess(key); return native_get(key); @@ -100,8 +106,10 @@ public class SystemProperties { * @param def the default value in case the property is not set or empty * @return if the {@code key} isn't found, return {@code def} if it isn't null, or an empty * string otherwise + * @hide */ @NonNull + @SystemApi public static String get(@NonNull String key, @Nullable String def) { if (TRACK_KEY_ACCESS) onKeyAccess(key); return native_get(key, def); @@ -114,7 +122,9 @@ public class SystemProperties { * @param def a default value to return * @return the key parsed as an integer, or def if the key isn't found or * cannot be parsed + * @hide */ + @SystemApi public static int getInt(@NonNull String key, int def) { if (TRACK_KEY_ACCESS) onKeyAccess(key); return native_get_int(key, def); @@ -127,7 +137,9 @@ public class SystemProperties { * @param def a default value to return * @return the key parsed as a long, or def if the key isn't found or * cannot be parsed + * @hide */ + @SystemApi public static long getLong(@NonNull String key, long def) { if (TRACK_KEY_ACCESS) onKeyAccess(key); return native_get_long(key, def); @@ -145,7 +157,9 @@ public class SystemProperties { * @param def a default value to return * @return the key parsed as a boolean, or def if the key isn't found or is * not able to be parsed as a boolean. + * @hide */ + @SystemApi public static boolean getBoolean(@NonNull String key, boolean def) { if (TRACK_KEY_ACCESS) onKeyAccess(key); return native_get_boolean(key, def); @@ -155,6 +169,7 @@ public class SystemProperties { * Set the value for the given {@code key} to {@code val}. * * @throws IllegalArgumentException if the {@code val} exceeds 91 characters + * @hide */ public static void set(@NonNull String key, @Nullable String val) { if (val != null && !val.startsWith("ro.") && val.length() > PROP_VALUE_MAX) { @@ -170,6 +185,7 @@ public class SystemProperties { * * @param callback The {@link Runnable} that should be executed when a system property * changes. + * @hide */ public static void addChangeCallback(@NonNull Runnable callback) { synchronized (sChangeCallbacks) { @@ -194,10 +210,14 @@ public class SystemProperties { } } - /* + /** * Notifies listeners that a system property has changed + * @hide */ public static void reportSyspropChanged() { native_report_sysprop_change(); } + + private SystemProperties() { + } } |
