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

Commit 12a66bf9 authored by mrulhania's avatar mrulhania Committed by Manjeet Rulhania
Browse files

Add null check for SensitiveContentProtectionService

mSensitiveContentProtectionService shouldn't be null when
sensitiveContentAppProtection() is true, adding wtf log to
track this.

Bug: 327305331
Test: atest SystemUIGoogleRobo2RNGTests
Change-Id: Ie655b63e7ddc387119edd40fc37a1ba3d11255b2
parent cb5c34af
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1210,6 +1210,9 @@ public final class ViewRootImpl implements ViewParent,
            mSensitiveContentProtectionService =
                    ISensitiveContentProtectionManager.Stub.asInterface(
                        ServiceManager.getService(Context.SENSITIVE_CONTENT_PROTECTION_SERVICE));
            if (mSensitiveContentProtectionService == null) {
                Log.e(TAG, "SensitiveContentProtectionService shouldn't be null");
            }
        } else {
            mSensitiveContentProtectionService = null;
        }
@@ -4179,6 +4182,9 @@ public final class ViewRootImpl implements ViewParent,
     */
    void notifySensitiveContentAppProtection(boolean showSensitiveContent) {
        try {
            if (mSensitiveContentProtectionService == null) {
                return;
            }
            // The window would be blocked during screen share if it shows sensitive content.
            mSensitiveContentProtectionService.setSensitiveContentProtection(
                    getWindowToken(), mContext.getPackageName(), showSensitiveContent);