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

Commit 16778691 authored by paulhu's avatar paulhu Committed by Lorenzo Colitti
Browse files

Fix ConnectivityServiceTest fail.

NetdService#getInstance() will get null object in
WrappedConnectivityService constructor. Then pass this null
INetd object to PermissionMonitor will case NPE in
PermissionMonitor#sendPackagePermissionsToNetd()

Bug: 128024100
Test: atest FrameworksNetTests
Change-Id: Ia1c80f9600a19c4aaf3f3c1b497b355d96c49c8e
Merged-In: I7f185e731db91c30a9b0f14aefbdbb067942190e
Merged-In: Ic77ef73841266da487401ffd657ef63562b6fc1e
(cherry picked from commit 7d215078)
parent 8d994400
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -469,7 +469,10 @@ public class PermissionMonitor {
     */
    @VisibleForTesting
    void sendPackagePermissionsToNetd(SparseIntArray netdPermissionsAppIds) {

        if (mNetd == null) {
            Log.e(TAG, "Failed to get the netd service");
            return;
        }
        ArrayList<Integer> allPermissionAppIds = new ArrayList<>();
        ArrayList<Integer> internetPermissionAppIds = new ArrayList<>();
        ArrayList<Integer> updateStatsPermissionAppIds = new ArrayList<>();