Loading core/java/android/net/NetworkStack.java +1 −1 Original line number Diff line number Diff line Loading @@ -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."); Loading packages/NetworkStack/src/com/android/server/util/PermissionUtil.java +2 −1 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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); } } Loading Loading
core/java/android/net/NetworkStack.java +1 −1 Original line number Diff line number Diff line Loading @@ -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."); Loading
packages/NetworkStack/src/com/android/server/util/PermissionUtil.java +2 −1 Original line number Diff line number Diff line Loading @@ -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. Loading @@ -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); } } Loading