Making getDataSystemDeDirectory as SystemApi
RescueParty uses this API for getting the list of all the user ids from
files present in this directory.
Since RescueParty is moving to CrashRecovery module, we need
to make it an SystemApi.
More Details: go/v-crashrecovery-module-design-doc
Bug: b/289203818
Test: m
Change-Id: I77786a532763876ee0eb1f14ac8489f42ee8eda6
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt
index 24b9233..13d64d3 100644
--- a/core/api/module-lib-current.txt
+++ b/core/api/module-lib-current.txt
@@ -373,6 +373,10 @@
field public static final int DEVICE_INITIAL_SDK_INT;
}
+ public class Environment {
+ method @FlaggedApi("android.crashrecovery.flags.enable_crashrecovery") @NonNull public static java.io.File getDataSystemDeDirectory();
+ }
+
public class IpcDataCache<Query, Result> {
ctor public IpcDataCache(int, @NonNull String, @NonNull String, @NonNull String, @NonNull android.os.IpcDataCache.QueryHandler<Query,Result>);
method public void disableForCurrentProcess();
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index 536ef31..a459aaa 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -17,6 +17,7 @@
package android.os;
import android.Manifest;
+import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
@@ -412,7 +413,9 @@
* Returns the base directory for per-user system directory, device encrypted.
* {@hide}
*/
- public static File getDataSystemDeDirectory() {
+ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ @FlaggedApi(android.crashrecovery.flags.Flags.FLAG_ENABLE_CRASHRECOVERY)
+ public static @NonNull File getDataSystemDeDirectory() {
return buildPath(getDataDirectory(), "system_de");
}
diff --git a/packages/CrashRecovery/aconfig/flags.aconfig b/packages/CrashRecovery/aconfig/flags.aconfig
index 5636266..572a669 100644
--- a/packages/CrashRecovery/aconfig/flags.aconfig
+++ b/packages/CrashRecovery/aconfig/flags.aconfig
@@ -6,4 +6,11 @@
description: "Feature flag for recoverability detection"
bug: "310236690"
is_fixed_read_only: true
-}
\ No newline at end of file
+}
+
+flag {
+ name: "enable_crashrecovery"
+ namespace: "crashrecovery"
+ description: "Enables various dependencies of crashrecovery module"
+ bug: "289203818"
+}