Loading core/java/android/view/View.java +2 −7 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import static android.view.flags.Flags.FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY; import static android.view.flags.Flags.FLAG_VIEW_VELOCITY_API; import static android.view.flags.Flags.enableUseMeasureCacheDuringForceLayout; import static android.view.flags.Flags.sensitiveContentAppProtection; import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix; import static android.view.flags.Flags.toolkitFrameRateBySizeReadOnly; import static android.view.flags.Flags.toolkitFrameRateDefaultNormalReadOnly; import static android.view.flags.Flags.toolkitFrameRateSmallUsesPercentReadOnly; Loading Loading @@ -32230,7 +32229,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, void increaseSensitiveViewsCount() { if (mSensitiveViewsCount == 0) { mViewRootImpl.notifySensitiveContentAppProtection(true); mViewRootImpl.addSensitiveContentAppProtection(); } mSensitiveViewsCount++; } Loading @@ -32238,11 +32237,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, void decreaseSensitiveViewsCount() { mSensitiveViewsCount--; if (mSensitiveViewsCount == 0) { if (sensitiveContentPrematureProtectionRemovedFix()) { mViewRootImpl.removeSensitiveContentProtectionOnTransactionCommit(); } else { mViewRootImpl.notifySensitiveContentAppProtection(false); } mViewRootImpl.removeSensitiveContentAppProtection(); } if (mSensitiveViewsCount < 0) { Log.wtf(VIEW_LOG_TAG, "mSensitiveViewsCount is negative" + mSensitiveViewsCount); core/java/android/view/ViewRootImpl.java +21 −7 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.os.Trace.TRACE_TAG_VIEW; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; import static android.view.DragEvent.ACTION_DRAG_LOCATION; import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix; import static android.view.InputDevice.SOURCE_CLASS_NONE; import static android.view.InsetsSource.ID_IME; import static android.view.Surface.FRAME_RATE_CATEGORY_DEFAULT; Loading Loading @@ -4338,29 +4339,42 @@ public final class ViewRootImpl implements ViewParent, * <li>It should only notify service to unblock projection when all sensitive view are * removed from the window. * </ol> * * @param enableProtection if true, the protection is enabled for this window. * if false, the protection is removed for this window. */ void notifySensitiveContentAppProtection(boolean showSensitiveContent) { private void applySensitiveContentAppProtection(boolean enableProtection) { try { if (mSensitiveContentProtectionService == null) { return; } if (DEBUG_SENSITIVE_CONTENT) { Log.d(TAG, "Notify sensitive content, package=" + mContext.getPackageName() + ", token=" + getWindowToken() + ", flag=" + showSensitiveContent); + ", token=" + getWindowToken() + ", flag=" + enableProtection); } // The window would be blocked during screen share if it shows sensitive content. mSensitiveContentProtectionService.setSensitiveContentProtection( getWindowToken(), mContext.getPackageName(), showSensitiveContent); getWindowToken(), mContext.getPackageName(), enableProtection); } catch (RemoteException ex) { Log.e(TAG, "Unable to protect sensitive content during screen share", ex); } } /** * Sensitive protection is removed on transaction commit to avoid prematurely removing * the protection. * Add sensitive content protection, when there are one or more visible sensitive views. */ void removeSensitiveContentProtectionOnTransactionCommit() { void addSensitiveContentAppProtection() { applySensitiveContentAppProtection(true); } /** * Remove sensitive content protection, when there is no visible sensitive view. */ void removeSensitiveContentAppProtection() { if (!sensitiveContentPrematureProtectionRemovedFix()) { applySensitiveContentAppProtection(false); return; } if (DEBUG_SENSITIVE_CONTENT) { Log.d(TAG, "Add transaction to remove sensitive content protection, package=" + mContext.getPackageName() + ", token=" + getWindowToken()); Loading @@ -4368,7 +4382,7 @@ public final class ViewRootImpl implements ViewParent, Transaction t = new Transaction(); t.addTransactionCommittedListener(mExecutor, () -> { if (mAttachInfo.mSensitiveViewsCount == 0) { notifySensitiveContentAppProtection(false); applySensitiveContentAppProtection(false); } }); applyTransactionOnDraw(t); Loading core/java/android/view/flags/view_flags.aconfig +1 −1 File changed.Contains only whitespace changes. Show changes Loading
core/java/android/view/View.java +2 −7 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import static android.view.flags.Flags.FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY; import static android.view.flags.Flags.FLAG_VIEW_VELOCITY_API; import static android.view.flags.Flags.enableUseMeasureCacheDuringForceLayout; import static android.view.flags.Flags.sensitiveContentAppProtection; import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix; import static android.view.flags.Flags.toolkitFrameRateBySizeReadOnly; import static android.view.flags.Flags.toolkitFrameRateDefaultNormalReadOnly; import static android.view.flags.Flags.toolkitFrameRateSmallUsesPercentReadOnly; Loading Loading @@ -32230,7 +32229,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, void increaseSensitiveViewsCount() { if (mSensitiveViewsCount == 0) { mViewRootImpl.notifySensitiveContentAppProtection(true); mViewRootImpl.addSensitiveContentAppProtection(); } mSensitiveViewsCount++; } Loading @@ -32238,11 +32237,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, void decreaseSensitiveViewsCount() { mSensitiveViewsCount--; if (mSensitiveViewsCount == 0) { if (sensitiveContentPrematureProtectionRemovedFix()) { mViewRootImpl.removeSensitiveContentProtectionOnTransactionCommit(); } else { mViewRootImpl.notifySensitiveContentAppProtection(false); } mViewRootImpl.removeSensitiveContentAppProtection(); } if (mSensitiveViewsCount < 0) { Log.wtf(VIEW_LOG_TAG, "mSensitiveViewsCount is negative" + mSensitiveViewsCount);
core/java/android/view/ViewRootImpl.java +21 −7 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static android.os.Trace.TRACE_TAG_VIEW; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; import static android.view.DragEvent.ACTION_DRAG_LOCATION; import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix; import static android.view.InputDevice.SOURCE_CLASS_NONE; import static android.view.InsetsSource.ID_IME; import static android.view.Surface.FRAME_RATE_CATEGORY_DEFAULT; Loading Loading @@ -4338,29 +4339,42 @@ public final class ViewRootImpl implements ViewParent, * <li>It should only notify service to unblock projection when all sensitive view are * removed from the window. * </ol> * * @param enableProtection if true, the protection is enabled for this window. * if false, the protection is removed for this window. */ void notifySensitiveContentAppProtection(boolean showSensitiveContent) { private void applySensitiveContentAppProtection(boolean enableProtection) { try { if (mSensitiveContentProtectionService == null) { return; } if (DEBUG_SENSITIVE_CONTENT) { Log.d(TAG, "Notify sensitive content, package=" + mContext.getPackageName() + ", token=" + getWindowToken() + ", flag=" + showSensitiveContent); + ", token=" + getWindowToken() + ", flag=" + enableProtection); } // The window would be blocked during screen share if it shows sensitive content. mSensitiveContentProtectionService.setSensitiveContentProtection( getWindowToken(), mContext.getPackageName(), showSensitiveContent); getWindowToken(), mContext.getPackageName(), enableProtection); } catch (RemoteException ex) { Log.e(TAG, "Unable to protect sensitive content during screen share", ex); } } /** * Sensitive protection is removed on transaction commit to avoid prematurely removing * the protection. * Add sensitive content protection, when there are one or more visible sensitive views. */ void removeSensitiveContentProtectionOnTransactionCommit() { void addSensitiveContentAppProtection() { applySensitiveContentAppProtection(true); } /** * Remove sensitive content protection, when there is no visible sensitive view. */ void removeSensitiveContentAppProtection() { if (!sensitiveContentPrematureProtectionRemovedFix()) { applySensitiveContentAppProtection(false); return; } if (DEBUG_SENSITIVE_CONTENT) { Log.d(TAG, "Add transaction to remove sensitive content protection, package=" + mContext.getPackageName() + ", token=" + getWindowToken()); Loading @@ -4368,7 +4382,7 @@ public final class ViewRootImpl implements ViewParent, Transaction t = new Transaction(); t.addTransactionCommittedListener(mExecutor, () -> { if (mAttachInfo.mSensitiveViewsCount == 0) { notifySensitiveContentAppProtection(false); applySensitiveContentAppProtection(false); } }); applyTransactionOnDraw(t); Loading
core/java/android/view/flags/view_flags.aconfig +1 −1 File changed.Contains only whitespace changes. Show changes