Merge "Cleanup config_mobile_hotspot_provision_app usage" am: 443092b9a8 am: 921d8c0fb5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1329014 Change-Id: Ib3bb0129419ffd55df6c2c53cce3ad7e9155e854
This commit is contained in:
@@ -2270,27 +2270,6 @@ public class ConnectivityManager {
|
|||||||
throwException);
|
throwException);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@hide} */
|
|
||||||
public static final void enforceTetherChangePermission(Context context, String callingPkg,
|
|
||||||
String callingAttributionTag) {
|
|
||||||
Preconditions.checkNotNull(context, "Context cannot be null");
|
|
||||||
Preconditions.checkNotNull(callingPkg, "callingPkg cannot be null");
|
|
||||||
|
|
||||||
if (context.getResources().getStringArray(
|
|
||||||
com.android.internal.R.array.config_mobile_hotspot_provision_app).length == 2) {
|
|
||||||
// Have a provisioning app - must only let system apps (which check this app)
|
|
||||||
// turn on tethering
|
|
||||||
context.enforceCallingOrSelfPermission(
|
|
||||||
android.Manifest.permission.TETHER_PRIVILEGED, "ConnectivityService");
|
|
||||||
} else {
|
|
||||||
int uid = Binder.getCallingUid();
|
|
||||||
// If callingPkg's uid is not same as Binder.getCallingUid(),
|
|
||||||
// AppOpsService throws SecurityException.
|
|
||||||
checkAndNoteWriteSettingsOperation(context, uid, callingPkg,
|
|
||||||
callingAttributionTag, true /* throwException */);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the package is a allowed to write settings. This also accounts that such an access
|
* Check if the package is a allowed to write settings. This also accounts that such an access
|
||||||
* happened.
|
* happened.
|
||||||
|
|||||||
Reference in New Issue
Block a user