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

Commit 1030ca69 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Avoid caller NPE if callback null in AppOpsService"

parents d7963806 8de5971a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -788,6 +788,9 @@ public class AppOpsService extends IAppOpsService.Stub {

    @Override
    public void startWatchingMode(int op, String packageName, IAppOpsCallback callback) {
        if (callback == null) {
            return;
        }
        synchronized (this) {
            op = (op != AppOpsManager.OP_NONE) ? AppOpsManager.opToSwitch(op) : op;
            Callback cb = mModeWatchers.get(callback.asBinder());
@@ -816,6 +819,9 @@ public class AppOpsService extends IAppOpsService.Stub {

    @Override
    public void stopWatchingMode(IAppOpsCallback callback) {
        if (callback == null) {
            return;
        }
        synchronized (this) {
            Callback cb = mModeWatchers.remove(callback.asBinder());
            if (cb != null) {