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

Commit 5ffb16c9 authored by Philip P. Moltmann's avatar Philip P. Moltmann Committed by Android (Google) Code Review
Browse files

Merge "Do not call into system server with sLock held"

parents 4617a582 9bcc4065
Loading
Loading
Loading
Loading
+33 −30
Original line number Diff line number Diff line
@@ -5845,8 +5845,13 @@ public class AppOpsManager {
                    ActivityThread.currentOpPackageName())) {
                // This app is noting an app-op for itself. Deliver immediately.
                sNotedAppOpsCollector.onSelfNoted(new SyncNotedAppOp(code));
            } else if (binderUid != null && binderUid == uid) {
                // We are inside of a two-way binder call. Delivered to caller via

                return;
            }
        }

        if (binderUid != null && binderUid == uid) {
            // If this is inside of a two-way binder call: Delivered to caller via
            // {@link #prefixParcelWithAppOpsIfNeeded}
            long[] appOpsNotedInThisBinderTransaction;

@@ -5862,7 +5867,7 @@ public class AppOpsManager {
                appOpsNotedInThisBinderTransaction[1] |= 1L << (code - 64);
            }
        } else {
                // We cannot deliver the note synchronous. Hence send it to the system server to
            // Cannot deliver the note synchronous: Hence send it to the system server to
            // notify the noted process.
            if (message == null) {
                // Default message is a stack trace
@@ -5871,8 +5876,7 @@ public class AppOpsManager {

            long token = Binder.clearCallingIdentity();
            try {
                    mService.noteAsyncOp(mContext.getOpPackageName(), uid, packageName, code,
                            message);
                mService.noteAsyncOp(mContext.getOpPackageName(), uid, packageName, code, message);
            } catch (RemoteException e) {
                e.rethrowFromSystemServer();
            } finally {
@@ -5880,7 +5884,6 @@ public class AppOpsManager {
            }
        }
    }
    }

    /**
     * Append app-ops noted in the current two-way binder transaction to parcel.