Merge "Implement notifySystemPropertiesChanged"

This commit is contained in:
Cosmin Băieș
2023-01-25 09:40:27 +00:00
committed by Android (Google) Code Review
2 changed files with 26 additions and 0 deletions

View File

@@ -132,6 +132,7 @@ package android.app {
method @RequiresPermission(allOf={android.Manifest.permission.PACKAGE_USAGE_STATS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}, conditional=true) public int getUidProcessState(int);
method public void holdLock(android.os.IBinder, int);
method public static boolean isHighEndGfx();
method public void notifySystemPropertiesChanged();
method @RequiresPermission(android.Manifest.permission.SET_ACTIVITY_WATCHER) public void removeHomeVisibilityListener(@NonNull android.app.HomeVisibilityListener);
method @RequiresPermission(android.Manifest.permission.RESET_APP_ERRORS) public void resetAppErrors();
method public static void resumeAppSwitches() throws android.os.RemoteException;

View File

@@ -5380,6 +5380,31 @@ public class ActivityManager {
return PowerExemptionManager.REASON_DENIED;
}
/**
* Notifies {@link #getRunningAppProcesses app processes} that the system properties
* have changed.
*
* @see SystemProperties#addChangeCallback
*
* @hide
*/
@TestApi
public void notifySystemPropertiesChanged() {
// Note: this cannot use {@link ServiceManager#listServices()} to notify all the services,
// as that is not available from tests.
final var binder = ActivityManager.getService().asBinder();
if (binder != null) {
var data = Parcel.obtain();
try {
binder.transact(IBinder.SYSPROPS_TRANSACTION, data, null /* reply */,
0 /* flags */);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
data.recycle();
}
}
/**
* A subset of immutable pending intent information suitable for caching on the client side.
*