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 716a9412cd)
This commit is contained in:
@@ -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<>();
|
||||
|
||||
Reference in New Issue
Block a user