Merge "Fixes the system server crash issues caused by null pointer in NetworkPolicyManagerService."
This commit is contained in:
@@ -2326,9 +2326,11 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub {
|
||||
final String[] packages = mContext.getPackageManager().getPackagesForUid(uid);
|
||||
final int userId = UserHandle.getUserId(uid);
|
||||
|
||||
for (String packageName : packages) {
|
||||
if (!mUsageStats.isAppIdle(packageName, uid, userId)) {
|
||||
return false;
|
||||
if (packages != null) {
|
||||
for (String packageName : packages) {
|
||||
if (!mUsageStats.isAppIdle(packageName, uid, userId)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user