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

Commit d20030e6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Implementing Lock contention API"

parents ecd3259f 8f16a6c9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -83,6 +83,7 @@ package android.app {
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getPackageImportance(String);
    method public long getTotalRam();
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public int getUidImportance(int);
    method @RequiresPermission("android.permission.INJECT_EVENTS") public void holdLock(int);
    method public static boolean isHighEndGfx();
    method @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) public void killProcessesWhenImperceptible(@NonNull int[], @NonNull String);
    method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void removeOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener);
@@ -1023,6 +1024,7 @@ package android.content.pm {
    method @Nullable public String getSystemTextClassifierPackageName();
    method @Nullable public String getWellbeingPackageName();
    method @RequiresPermission("android.permission.GRANT_RUNTIME_PERMISSIONS") public abstract void grantRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission("android.permission.INJECT_EVENTS") public void holdLock(int);
    method @RequiresPermission("android.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS") public abstract void removeOnPermissionsChangeListener(@NonNull android.content.pm.PackageManager.OnPermissionsChangedListener);
    method @RequiresPermission("android.permission.REVOKE_RUNTIME_PERMISSIONS") public abstract void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission("android.permission.REVOKE_RUNTIME_PERMISSIONS") public void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle, @NonNull String);
@@ -5289,6 +5291,7 @@ package android.view {
  }

  public interface WindowManager extends android.view.ViewManager {
    method @RequiresPermission("android.permission.INJECT_EVENTS") public default void holdLock(int);
    method public default void setShouldShowIme(int, boolean);
    method public default void setShouldShowSystemDecors(int, boolean);
    method public default void setShouldShowWithInsecureKeyguard(int, boolean);
+15 −0
Original line number Diff line number Diff line
@@ -4796,4 +4796,19 @@ public class ActivityManager {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Holds the AM lock for the specified amount of milliseconds.
     * This is intended for use by the tests that need to imitate lock contention.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.INJECT_EVENTS)
    public void holdLock(int durationMs) {
        try {
            getService().holdLock(durationMs);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
+6 −0
Original line number Diff line number Diff line
@@ -696,4 +696,10 @@ interface IActivityManager {
     * @param enable set it to true to enable the app freezer, false to disable it.
     */
    boolean enableAppFreezer(in boolean enable);

    /**
     * Holds the AM lock for the specified amount of milliseconds.
     * This is intended for use by the tests that need to imitate lock contention.
     */
    void holdLock(in int durationMs);
}
+2 −0
Original line number Diff line number Diff line
@@ -795,4 +795,6 @@ interface IPackageManager {
    boolean isAutoRevokeWhitelisted(String packageName);

    void grantImplicitAccess(int queryingUid, String visibleAuthority);

    void holdLock(in int durationMs);
}
+15 −0
Original line number Diff line number Diff line
@@ -8305,4 +8305,19 @@ public abstract class PackageManager {
    public static void uncorkPackageInfoCache() {
        PropertyInvalidatedCache.uncorkInvalidations(PermissionManager.CACHE_KEY_PACKAGE_INFO);
    }

    /**
     * Holds the PM lock for the specified amount of milliseconds.
     * Intended for use by the tests that need to imitate lock contention.
     * @hide
     */
    @TestApi
    @RequiresPermission(android.Manifest.permission.INJECT_EVENTS)
    public void holdLock(int durationMs) {
        try {
            ActivityThread.getPackageManager().holdLock(durationMs);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
Loading