Check TETHER_PRIVILEGED permission directly in PanService

Originally #setBluetoothTethering always checked the tethering permissions,
but then in R it also check BLUETOOTH_PRIVILEGED as well. And given that
BLUETOOTH_PRIVILEGED is privileged permission and can't be held by third
party apps (and because this method is only intended to be called by
tethering), it's probably not necessary to have another permission check,
but for extra safety, keep check TETHER_PRIVILEGED as well.

Bug: 146918263
Test: m
Change-Id: I336ec412728e897f735249871dba90d9986a4047
Merged-In: I336ec412728e897f735249871dba90d9986a4047
diff --git a/src/com/android/bluetooth/pan/PanService.java b/src/com/android/bluetooth/pan/PanService.java
index 28943b3..c6e89a8 100644
--- a/src/com/android/bluetooth/pan/PanService.java
+++ b/src/com/android/bluetooth/pan/PanService.java
@@ -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;
@@ -396,9 +398,8 @@
         }
         enforceCallingOrSelfPermission(
                 BLUETOOTH_PRIVILEGED, "Need BLUETOOTH_PRIVILEGED permission");
-        final Context context = getBaseContext();
-
-        ConnectivityManager.enforceTetherChangePermission(context, pkgName);
+        enforceCallingOrSelfPermission(
+                TETHER_PRIVILEGED, "Need TETHER_PRIVILEGED permission");
 
         UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
         if (um.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING) && value) {