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

Commit 96449f61 authored by Peter Visontay's avatar Peter Visontay
Browse files

Log when an app shows a UI overlay.

Bug: 63907873
Test: manually checked that the op is logged when an app shows an overlay.
Change-Id: I932a394a6d829a6a48d17e9d8c00e3e66623bd43
parent 7d6688f3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ public class AppOpsManager {
    public static final int OP_WRITE_ICC_SMS = 22;
    /** @hide */
    public static final int OP_WRITE_SETTINGS = 23;
    /** @hide */
    /** @hide Required to draw on top of other apps. */
    public static final int OP_SYSTEM_ALERT_WINDOW = 24;
    /** @hide */
    public static final int OP_ACCESS_NOTIFICATIONS = 25;
+1 −1
Original line number Diff line number Diff line
@@ -2499,7 +2499,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {

        // check if user has enabled this operation. SecurityException will be thrown if this app
        // has not been allowed by the user
        final int mode = mAppOpsManager.checkOpNoThrow(outAppOp[0], callingUid, attrs.packageName);
        final int mode = mAppOpsManager.noteOpNoThrow(outAppOp[0], callingUid, attrs.packageName);
        switch (mode) {
            case AppOpsManager.MODE_ALLOWED:
            case AppOpsManager.MODE_IGNORED:
+1 −1
Original line number Diff line number Diff line
@@ -431,7 +431,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> {
            if (w.mAppOp == OP_NONE) {
                return;
            }
            final int mode = mService.mAppOps.checkOpNoThrow(w.mAppOp, w.getOwningUid(),
            final int mode = mService.mAppOps.noteOpNoThrow(w.mAppOp, w.getOwningUid(),
                    w.getOwningPackage());
            w.setAppOpVisibilityLw(mode == MODE_ALLOWED || mode == MODE_DEFAULT);
        }, false /* traverseTopToBottom */);