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

Commit 2f4cbc7e 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: aa629f8c am: 94d62acd am: 454b13d3 am: 55c1a2dd

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

Change-Id: I0762d975f6898787d811660127f462e2b97b8dea
parents 558d837d 55c1a2dd
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) {