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

Commit 8ab31771 authored by Chen Xu's avatar Chen Xu Committed by android-build-merger
Browse files

Merge "throw securityexception for notifyNetworkChange" into qt-dev am: d81cd262

am: ccc155ea

Change-Id: I5200ee08eb8ee6828cd5a0c9eaad070ae08dcf9b
parents 86c1843a ccc155ea
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1172,7 +1172,11 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    .filter(i -> TelephonyPermissions.checkCarrierPrivilegeForSubId(i))
                    .findFirst().getAsInt();
        } catch (NoSuchElementException ex) {
            log("notifyCarrierNetworkChange without carrier privilege");
            loge("notifyCarrierNetworkChange without carrier privilege");
        }
        // the active subId does not have carrier privilege. 
        if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
            throw new SecurityException("notifyCarrierNetworkChange without carrier privilege");
        }
        int phoneId = SubscriptionManager.getPhoneId(subId);

@@ -2272,6 +2276,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        Rlog.d(TAG, s);
    }

    private static void loge(String s) {
        Rlog.e(TAG, s);
    }

    boolean idMatch(int rSubId, int subId, int phoneId) {

        if(subId < 0) {