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

Commit 24584f0b authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Clear calling identify b4 Beam callback.

Fixes AppOps crash, because it notices the calling
package is different from the calling UID.

Bug: 25492633
Change-Id: I55e2d975fd0a7ee94c4623efb3b19b1b54b72da2
parent d980b8c7
Loading
Loading
Loading
Loading
+34 −30
Original line number Diff line number Diff line
@@ -371,7 +371,8 @@ public final class NfcActivityManager extends IAppCallback.Stub
            flags = state.flags;
            activity = state.activity;
        }

        final long ident = Binder.clearCallingIdentity();
        try {
            // Make callbacks without lock
            if (ndefCallback != null) {
                message = ndefCallback.createNdefMessage(event);
@@ -406,6 +407,9 @@ public final class NfcActivityManager extends IAppCallback.Stub
                            Intent.FLAG_GRANT_READ_URI_PERMISSION);
                }
            }
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
        return new BeamShareData(message, uris, new UserHandle(UserHandle.myUserId()), flags);
    }