Merge "Fix bluetooth tethering on multi-user"

This commit is contained in:
Remi NGUYEN VAN
2019-01-31 11:53:53 +00:00
committed by Gerrit Code Review
2 changed files with 3 additions and 2 deletions

View File

@@ -223,7 +223,7 @@ public class NetworkStack {
private void requestConnector(@NonNull NetworkStackCallback request) {
// TODO: PID check.
final int caller = Binder.getCallingUid();
if (caller != Process.SYSTEM_UID && caller != Process.BLUETOOTH_UID) {
if (caller != Process.SYSTEM_UID && !UserHandle.isSameApp(caller, Process.BLUETOOTH_UID)) {
// Don't even attempt to obtain the connector and give a nice error message
throw new SecurityException(
"Only the system server should try to bind to the network stack.");