Loading core/java/android/app/ContextImpl.java +8 −0 Original line number Diff line number Diff line Loading @@ -2900,6 +2900,14 @@ class ContextImpl extends Context { } } /** * @hide */ @Override public int getAssociatedDisplayId() { return isAssociatedWithDisplay() ? getDisplayId() : Display.INVALID_DISPLAY; } @Override public Display getDisplayNoVerify() { if (mDisplay == null) { Loading core/java/android/app/KeyguardManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -591,7 +591,7 @@ public class KeyguardManager { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) public boolean isDeviceLocked(int userId) { try { return mTrustManager.isDeviceLocked(userId); return mTrustManager.isDeviceLocked(userId, mContext.getAssociatedDisplayId()); } catch (RemoteException e) { return false; } Loading @@ -617,7 +617,7 @@ public class KeyguardManager { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public boolean isDeviceSecure(int userId) { try { return mTrustManager.isDeviceSecure(userId); return mTrustManager.isDeviceSecure(userId, mContext.getAssociatedDisplayId()); } catch (RemoteException e) { return false; } Loading core/java/android/app/trust/ITrustManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -33,8 +33,8 @@ interface ITrustManager { void unregisterTrustListener(in ITrustListener trustListener); void reportKeyguardShowingChanged(); void setDeviceLockedForUser(int userId, boolean locked); boolean isDeviceLocked(int userId); boolean isDeviceSecure(int userId); boolean isDeviceLocked(int userId, int displayId); boolean isDeviceSecure(int userId, int displayId); boolean isTrustUsuallyManaged(int userId); void unlockedByBiometricForUser(int userId, in BiometricSourceType source); void clearAllBiometricRecognized(in BiometricSourceType target, int unlockedUser); Loading core/java/android/content/Context.java +12 −0 Original line number Diff line number Diff line Loading @@ -7074,6 +7074,18 @@ public abstract class Context { @TestApi public abstract int getDisplayId(); /** * @return Returns the id of the Display object associated with this Context or * {@link Display#INVALID_DISPLAY} if no Display has been associated. * @see #getDisplay() * @see #getDisplayId() * * @hide */ public int getAssociatedDisplayId() { throw new RuntimeException("Not implemented. Must override in a subclass."); } /** * @hide */ Loading services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java +4 −0 Original line number Diff line number Diff line Loading @@ -606,6 +606,10 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub } } boolean isDisplayOwnedByVirtualDevice(int displayId) { return mVirtualDisplayIds.contains(displayId); } interface OnDeviceCloseListener { void onClose(int associationId); } Loading Loading
core/java/android/app/ContextImpl.java +8 −0 Original line number Diff line number Diff line Loading @@ -2900,6 +2900,14 @@ class ContextImpl extends Context { } } /** * @hide */ @Override public int getAssociatedDisplayId() { return isAssociatedWithDisplay() ? getDisplayId() : Display.INVALID_DISPLAY; } @Override public Display getDisplayNoVerify() { if (mDisplay == null) { Loading
core/java/android/app/KeyguardManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -591,7 +591,7 @@ public class KeyguardManager { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) public boolean isDeviceLocked(int userId) { try { return mTrustManager.isDeviceLocked(userId); return mTrustManager.isDeviceLocked(userId, mContext.getAssociatedDisplayId()); } catch (RemoteException e) { return false; } Loading @@ -617,7 +617,7 @@ public class KeyguardManager { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public boolean isDeviceSecure(int userId) { try { return mTrustManager.isDeviceSecure(userId); return mTrustManager.isDeviceSecure(userId, mContext.getAssociatedDisplayId()); } catch (RemoteException e) { return false; } Loading
core/java/android/app/trust/ITrustManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -33,8 +33,8 @@ interface ITrustManager { void unregisterTrustListener(in ITrustListener trustListener); void reportKeyguardShowingChanged(); void setDeviceLockedForUser(int userId, boolean locked); boolean isDeviceLocked(int userId); boolean isDeviceSecure(int userId); boolean isDeviceLocked(int userId, int displayId); boolean isDeviceSecure(int userId, int displayId); boolean isTrustUsuallyManaged(int userId); void unlockedByBiometricForUser(int userId, in BiometricSourceType source); void clearAllBiometricRecognized(in BiometricSourceType target, int unlockedUser); Loading
core/java/android/content/Context.java +12 −0 Original line number Diff line number Diff line Loading @@ -7074,6 +7074,18 @@ public abstract class Context { @TestApi public abstract int getDisplayId(); /** * @return Returns the id of the Display object associated with this Context or * {@link Display#INVALID_DISPLAY} if no Display has been associated. * @see #getDisplay() * @see #getDisplayId() * * @hide */ public int getAssociatedDisplayId() { throw new RuntimeException("Not implemented. Must override in a subclass."); } /** * @hide */ Loading
services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java +4 −0 Original line number Diff line number Diff line Loading @@ -606,6 +606,10 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub } } boolean isDisplayOwnedByVirtualDevice(int displayId) { return mVirtualDisplayIds.contains(displayId); } interface OnDeviceCloseListener { void onClose(int associationId); } Loading