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

Commit b01ea683 authored by Roshan Pius's avatar Roshan Pius
Browse files

NetworkStack: Allow modules with network_stack uid

The wifi service will start running with network_stack uid, so allow
modules with the same uid to use the network stack interfaces.

Note: Only modules signed with the same certificate (same as network_stack
APK) can share the uid, so this is restricted to Google signed modules.

Bug: 113174748
Test: Local wifi stack testing
Change-Id: I0fa1eef691601afd837a83a0dd041f8870ddfc77
(cherry-picked from 204d6c5b211c7ad5cb71b885bcb1bf4fa1a34c21)
parent 8203fa46
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -41,7 +41,8 @@ public final class PermissionUtil {
            return;
            return;
        }
        }


        if (UserHandle.getAppId(caller) != Process.BLUETOOTH_UID) {
        if (caller != Process.myUid() && // apps with NETWORK_STACK_UID
                UserHandle.getAppId(caller) != Process.BLUETOOTH_UID) {
            throw new SecurityException("Invalid caller: " + caller);
            throw new SecurityException("Invalid caller: " + caller);
        }
        }
    }
    }