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

Commit 8f2d9913 authored by Mark Chien's avatar Mark Chien Committed by Automerger Merge Worker
Browse files

Merge "Check TETHER_PRIVILEGED permission directly in PanService" am: 1f699e0a am: d3742627

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1328475

Change-Id: I21af30763b3e8f255774eaa22a62654cc3b23570
parents 273373e4 d3742627
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@


package com.android.bluetooth.pan;
package com.android.bluetooth.pan;


import static android.Manifest.permission.TETHER_PRIVILEGED;

import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothPan;
import android.bluetooth.BluetoothPan;
import android.bluetooth.BluetoothPan.LocalPanRole;
import android.bluetooth.BluetoothPan.LocalPanRole;
@@ -397,9 +399,8 @@ public class PanService extends ProfileService {
        }
        }
        enforceCallingOrSelfPermission(
        enforceCallingOrSelfPermission(
                BLUETOOTH_PRIVILEGED, "Need BLUETOOTH_PRIVILEGED permission");
                BLUETOOTH_PRIVILEGED, "Need BLUETOOTH_PRIVILEGED permission");
        final Context context = getBaseContext();
        enforceCallingOrSelfPermission(

                TETHER_PRIVILEGED, "Need TETHER_PRIVILEGED permission");
        ConnectivityManager.enforceTetherChangePermission(context, pkgName, callingAttributionTag);


        UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
        UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
        if (um.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING) && value) {
        if (um.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING) && value) {