summaryrefslogtreecommitdiff
path: root/core/java/android/os/PowerManager.java
diff options
context:
space:
mode:
authorNikita Ioffe <ioffe@google.com>2020-03-30 23:43:47 +0100
committerNikita Ioffe <ioffe@google.com>2020-04-01 18:26:19 +0100
commit5c99905f4430cb7c85a94b098fc421beee43602b (patch)
tree1322fddb8bb3f0cc39cc7f07a81348215f1e8dfa /core/java/android/os/PowerManager.java
parent5be3a74263069e2734970a3d8b0c0b6fbc3a3e68 (diff)
Make init.userspace_reboot.is_supported a rw property
General recommendation is to avoid read-only properties, and instead control "read-onlines" by only allowing init/vendor_init to set the property. Since ro.init.userspace_reboot.is_supported was added in this release, and nobody outside of the platform is querying it directly, it should be fine to simply rename it. Test: adb shell getprop init.userspace_reboot.is_supported Test: atest CtsUserspaceRebootHostSideTestCases Bug: 152803929 Change-Id: I31b9ac7f2c92ce82664a0266aea62faa2bdd365f Merged-In: I31b9ac7f2c92ce82664a0266aea62faa2bdd365f (cherry picked from commit 24e2259e5d9c9b46174a7d5428ce3e7cd9329b68)
Diffstat (limited to 'core/java/android/os/PowerManager.java')
-rw-r--r--core/java/android/os/PowerManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index cdc00195c169..b8e1aa88c3a3 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -32,6 +32,7 @@ import android.app.PropertyInvalidatedCache;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.service.dreams.Sandman;
+import android.sysprop.InitProperties;
import android.util.ArrayMap;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
@@ -1487,7 +1488,7 @@ public final class PowerManager {
*/
// TODO(b/138605180): add link to documentation once it's ready.
public boolean isRebootingUserspaceSupported() {
- return SystemProperties.getBoolean("ro.init.userspace_reboot.is_supported", false);
+ return InitProperties.is_userspace_reboot_supported().orElse(false);
}
/**