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

Commit ead1f8ee authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Avoid spurious logging for read device identifier denial.

The change is to avoid reporting failure if the check is done
as part of an intermediate step.

Test: manual
Bug: 151875019
Change-Id: Ia813607ef701c6cf3175f3de49bb7a53541eb4ef
parent 155a9824
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -456,10 +456,10 @@ public class SubscriptionController extends ISub.Stub {
     * SecurityException.
     */
    private boolean hasSubscriberIdentifierAccess(int subId, String callingPackage,
            String callingFeatureId, String message) {
            String callingFeatureId, String message, boolean reportFailure) {
        try {
            return TelephonyPermissions.checkCallingOrSelfReadSubscriberIdentifiers(mContext, subId,
                    callingPackage, callingFeatureId, message);
                    callingPackage, callingFeatureId, message, reportFailure);
        } catch (SecurityException e) {
            // A SecurityException indicates that the calling package is targeting at least the
            // minimum level that enforces identifier access restrictions and the new access
@@ -4159,7 +4159,7 @@ public class SubscriptionController extends ISub.Stub {
            if (canReadPhoneState) {
                canReadIdentifiers = hasSubscriberIdentifierAccess(
                        SubscriptionManager.INVALID_SUBSCRIPTION_ID, callingPackage,
                        callingFeatureId, "getSubscriptionInfoList");
                        callingFeatureId, "getSubscriptionInfoList", false);
                canReadPhoneNumber = hasPhoneNumberAccess(
                        SubscriptionManager.INVALID_SUBSCRIPTION_ID, callingPackage,
                        callingFeatureId, "getSubscriptionInfoList");
@@ -4211,7 +4211,7 @@ public class SubscriptionController extends ISub.Stub {
        SubscriptionInfo result = subInfo;
        int subId = subInfo.getSubscriptionId();
        boolean hasIdentifierAccess = hasSubscriberIdentifierAccess(subId, callingPackage,
                callingFeatureId, message);
                callingFeatureId, message, true);
        boolean hasPhoneNumberAccess = hasPhoneNumberAccess(subId, callingPackage, callingFeatureId,
                message);
        return conditionallyRemoveIdentifiers(subInfo, hasIdentifierAccess, hasPhoneNumberAccess);