Merge "Null safe package name in AppOps writeState" into sc-dev am: 0abd07b3fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15301695 Change-Id: I016f141621cc890bb015d6c08688897dd7d47389
This commit is contained in:
@@ -5099,14 +5099,16 @@ public class AppOpsService extends IAppOpsService.Stub {
|
|||||||
String lastPkg = null;
|
String lastPkg = null;
|
||||||
for (int i=0; i<allOps.size(); i++) {
|
for (int i=0; i<allOps.size(); i++) {
|
||||||
AppOpsManager.PackageOps pkg = allOps.get(i);
|
AppOpsManager.PackageOps pkg = allOps.get(i);
|
||||||
if (!pkg.getPackageName().equals(lastPkg)) {
|
if (!Objects.equals(pkg.getPackageName(), lastPkg)) {
|
||||||
if (lastPkg != null) {
|
if (lastPkg != null) {
|
||||||
out.endTag(null, "pkg");
|
out.endTag(null, "pkg");
|
||||||
}
|
}
|
||||||
lastPkg = pkg.getPackageName();
|
lastPkg = pkg.getPackageName();
|
||||||
|
if (lastPkg != null) {
|
||||||
out.startTag(null, "pkg");
|
out.startTag(null, "pkg");
|
||||||
out.attribute(null, "n", lastPkg);
|
out.attribute(null, "n", lastPkg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.startTag(null, "uid");
|
out.startTag(null, "uid");
|
||||||
out.attributeInt(null, "n", pkg.getUid());
|
out.attributeInt(null, "n", pkg.getUid());
|
||||||
List<AppOpsManager.OpEntry> ops = pkg.getOps();
|
List<AppOpsManager.OpEntry> ops = pkg.getOps();
|
||||||
|
|||||||
Reference in New Issue
Block a user