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

Commit 9bebf767 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by android-build-merger
Browse files

Merge "Fix bluetooth tethering on multi-user" am: 4bb4c1a792 am: 1a0ac241e8

am: b077c11c2f

Change-Id: I21169bd77683c2f991f0ad1ab76e94b3e871a565
parents 815cf007 d9595902
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.util;
import static android.os.Binder.getCallingUid;

import android.os.Process;
import android.os.UserHandle;

/**
 * Utility class to check calling permissions on the network stack.
@@ -32,7 +33,7 @@ public final class PermissionUtil {
    public static void checkNetworkStackCallingPermission() {
        // TODO: check that the calling PID is the system server.
        final int caller = getCallingUid();
        if (caller != Process.SYSTEM_UID && caller != Process.BLUETOOTH_UID) {
        if (caller != Process.SYSTEM_UID && UserHandle.getAppId(caller) != Process.BLUETOOTH_UID) {
            throw new SecurityException("Invalid caller: " + caller);
        }
    }