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

Commit 75d4cf44 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make sure a pinned slice with given uri exists before calling unpin."

parents 709856ff 115ed1bc
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -180,9 +180,14 @@ public class SliceManagerService extends ISliceManager.Stub {
        verifyCaller(pkg);
        enforceAccess(pkg, uri);
        uri = maybeAddUserId(uri, Binder.getCallingUserHandle().getIdentifier());
        if (getPinnedSlice(uri).unpin(pkg, token)) {
        try {
            PinnedSliceState slice = getPinnedSlice(uri);
            if (slice != null && slice.unpin(pkg, token)) {
                removePinnedSlice(uri);
            }
        } catch (IllegalStateException exception) {
            Slog.w(TAG, exception.getMessage());
        }
    }

    @Override