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

Commit f79ca390 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8302671 from adc12a62 to sc-qpr3-release

Change-Id: Ibce4e5e76fa32796f5ffbb93af386c3c2cd0d4e7
parents 2f8d2c4b adc12a62
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -185,8 +185,13 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat

        initializeActivityRecognizersTags();

        // If this device does not have telephony, restrict the phone call ops
        if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
        // If this device does not have telephony or microphone features, the TelecomService will
        // not be started (which sets phone call ops to allow only its package). Therefore, phone
        // call ops need to be restricted here.
        PackageManager pm = mContext.getPackageManager();
        if (!pm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)
                && !pm.hasSystemFeature(PackageManager.FEATURE_MICROPHONE)
                && !pm.hasSystemFeature(PackageManager.FEATURE_CONNECTION_SERVICE)) {
            AppOpsManager appOps = mContext.getSystemService(AppOpsManager.class);
            appOps.setUserRestrictionForUser(AppOpsManager.OP_PHONE_CALL_MICROPHONE, true, mToken,
                    null, UserHandle.USER_ALL);