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

Commit 5fc2375d authored by Chen Xu's avatar Chen Xu
Browse files

fix the issue that clearCallingIdentity before appops check

we should restore CallingIndentity when do the appops check for
access device/subscriber identifier

Bug: 187147737
Bug: 183612370
Test: Manual test
Change-Id: Id0abfee602823f56811799a6d5c2bbe8cd5e2cc1
(cherry picked from commit 020d831c)
Merged-in: Id0abfee602823f56811799a6d5c2bbe8cd5e2cc1
parent af728372
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -887,9 +887,12 @@ public class SubscriptionController extends ISub.Stub {

        // Now that all security checks passes, perform the operation as ourselves.
        final long identity = Binder.clearCallingIdentity();
        List<SubscriptionInfo> subList;
        try {
            List<SubscriptionInfo> subList = null;
            subList = getSubInfo(null, null);
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        if (subList != null) {
            if (VDBG) logd("[getAllSubInfoList]- " + subList.size() + " infos return");
            subList.stream().map(
@@ -900,9 +903,6 @@ public class SubscriptionController extends ISub.Stub {
            if (VDBG) logd("[getAllSubInfoList]- no info return");
        }
        return subList;
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
    }

    private List<SubscriptionInfo> makeCacheListCopyWithLock(List<SubscriptionInfo> cacheSubList) {