Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65fe242a authored by Cosmin Băieș's avatar Cosmin Băieș Committed by Android (Google) Code Review
Browse files

Merge "Implement notifySystemPropertiesChanged"

parents 5b6b8c47 d14ca0b5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
+25 −0
Original line number Diff line number Diff line
@@ -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.
     *