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

Commit 93464fa9 authored by Mark Chien's avatar Mark Chien Committed by Automerger Merge Worker
Browse files

Merge "Check TETHER_PRIVILEGED permission directly in PanService" am:...

Merge "Check TETHER_PRIVILEGED permission directly in PanService" am: 1f699e0a am: d3742627 am: 8f2d9913 am: 86e29eec am: 329fef34

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

Change-Id: Iaa4f57cff898233451dd0ee30beac35858521aba
parents eca30652 329fef34
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.bluetooth.pan;

import static android.Manifest.permission.TETHER_PRIVILEGED;

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

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

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