Loading api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -2732,6 +2732,10 @@ package android.view { field public static final int CALLBACK_ANIMATION = 1; // 0x1 } public final class Display { method public boolean hasAccess(int); } public class FocusFinder { method public static void sort(android.view.View[], int, int, android.view.ViewGroup, boolean); } Loading core/java/android/hardware/display/DisplayManagerGlobal.java +15 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,21 @@ public final class DisplayManagerGlobal { } } /** * Check if specified UID's content is present on display and should be granted access to it. * * @param uid UID to be checked. * @param displayId id of the display where presence of the content is checked. * @return {@code true} if UID is present on display, {@code false} otherwise. */ public boolean isUidPresentOnDisplay(int uid, int displayId) { try { return mDm.isUidPresentOnDisplay(uid, displayId); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } /** * Gets information about a logical display. * Loading core/java/android/hardware/display/DisplayManagerInternal.java +0 −8 Original line number Diff line number Diff line Loading @@ -186,14 +186,6 @@ public abstract class DisplayManagerInternal { */ public abstract void setDisplayAccessUIDs(SparseArray<IntArray> displayAccessUIDs); /** * Check if specified UID's content is present on display and should be granted access to it. * * @param uid UID to be checked. * @param displayId id of the display where presence of the content is checked. * */ public abstract boolean isUidPresentOnDisplay(int uid, int displayId); /** * Persist brightness slider events and ambient brightness stats. */ Loading core/java/android/hardware/display/IDisplayManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ interface IDisplayManager { DisplayInfo getDisplayInfo(int displayId); int[] getDisplayIds(); boolean isUidPresentOnDisplay(int uid, int displayId); void registerCallback(in IDisplayManagerCallback callback); // Requires CONFIGURE_WIFI_DISPLAY permission. Loading core/java/android/view/Display.java +7 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE; import android.annotation.IntDef; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.TestApi; import android.annotation.UnsupportedAppUsage; import android.app.KeyguardManager; import android.content.res.CompatibilityInfo; Loading Loading @@ -1096,16 +1097,19 @@ public final class Display { * Returns true if the specified UID has access to this display. * @hide */ @TestApi public boolean hasAccess(int uid) { return Display.hasAccess(uid, mFlags, mOwnerUid); return hasAccess(uid, mFlags, mOwnerUid, mDisplayId); } /** @hide */ public static boolean hasAccess(int uid, int flags, int ownerUid) { public static boolean hasAccess(int uid, int flags, int ownerUid, int displayId) { return (flags & Display.FLAG_PRIVATE) == 0 || uid == ownerUid || uid == Process.SYSTEM_UID || uid == 0; || uid == 0 // Check if the UID is present on given display. || DisplayManagerGlobal.getInstance().isUidPresentOnDisplay(uid, displayId); } /** Loading Loading
api/test-current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -2732,6 +2732,10 @@ package android.view { field public static final int CALLBACK_ANIMATION = 1; // 0x1 } public final class Display { method public boolean hasAccess(int); } public class FocusFinder { method public static void sort(android.view.View[], int, int, android.view.ViewGroup, boolean); } Loading
core/java/android/hardware/display/DisplayManagerGlobal.java +15 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,21 @@ public final class DisplayManagerGlobal { } } /** * Check if specified UID's content is present on display and should be granted access to it. * * @param uid UID to be checked. * @param displayId id of the display where presence of the content is checked. * @return {@code true} if UID is present on display, {@code false} otherwise. */ public boolean isUidPresentOnDisplay(int uid, int displayId) { try { return mDm.isUidPresentOnDisplay(uid, displayId); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } /** * Gets information about a logical display. * Loading
core/java/android/hardware/display/DisplayManagerInternal.java +0 −8 Original line number Diff line number Diff line Loading @@ -186,14 +186,6 @@ public abstract class DisplayManagerInternal { */ public abstract void setDisplayAccessUIDs(SparseArray<IntArray> displayAccessUIDs); /** * Check if specified UID's content is present on display and should be granted access to it. * * @param uid UID to be checked. * @param displayId id of the display where presence of the content is checked. * */ public abstract boolean isUidPresentOnDisplay(int uid, int displayId); /** * Persist brightness slider events and ambient brightness stats. */ Loading
core/java/android/hardware/display/IDisplayManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ interface IDisplayManager { DisplayInfo getDisplayInfo(int displayId); int[] getDisplayIds(); boolean isUidPresentOnDisplay(int uid, int displayId); void registerCallback(in IDisplayManagerCallback callback); // Requires CONFIGURE_WIFI_DISPLAY permission. Loading
core/java/android/view/Display.java +7 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.Manifest.permission.CONFIGURE_DISPLAY_COLOR_MODE; import android.annotation.IntDef; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.TestApi; import android.annotation.UnsupportedAppUsage; import android.app.KeyguardManager; import android.content.res.CompatibilityInfo; Loading Loading @@ -1096,16 +1097,19 @@ public final class Display { * Returns true if the specified UID has access to this display. * @hide */ @TestApi public boolean hasAccess(int uid) { return Display.hasAccess(uid, mFlags, mOwnerUid); return hasAccess(uid, mFlags, mOwnerUid, mDisplayId); } /** @hide */ public static boolean hasAccess(int uid, int flags, int ownerUid) { public static boolean hasAccess(int uid, int flags, int ownerUid, int displayId) { return (flags & Display.FLAG_PRIVATE) == 0 || uid == ownerUid || uid == Process.SYSTEM_UID || uid == 0; || uid == 0 // Check if the UID is present on given display. || DisplayManagerGlobal.getInstance().isUidPresentOnDisplay(uid, displayId); } /** Loading