Loading services/java/com/android/server/AppOpsService.java +5 −16 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ public class AppOpsService extends IAppOpsService.Stub { // Write at most every 30 minutes. static final long WRITE_DELAY = DEBUG ? 1000 : 30*60*1000; static final int CURRENT_VERSION = 1; Context mContext; final AtomicFile mFile; final Handler mHandler; Loading Loading @@ -633,9 +631,6 @@ public class AppOpsService extends IAppOpsService.Stub { throw new IllegalStateException("no start tag found"); } String versStr = parser.getAttributeValue(null, "vers"); int vers = versStr != null ? Integer.parseInt(versStr) : 0; int outerDepth = parser.getDepth(); while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { Loading @@ -645,7 +640,7 @@ public class AppOpsService extends IAppOpsService.Stub { String tagName = parser.getName(); if (tagName.equals("pkg")) { readPackage(parser, vers); readPackage(parser); } else { Slog.w(TAG, "Unknown element under <app-ops>: " + parser.getName()); Loading Loading @@ -678,7 +673,7 @@ public class AppOpsService extends IAppOpsService.Stub { } } void readPackage(XmlPullParser parser, int vers) throws NumberFormatException, void readPackage(XmlPullParser parser) throws NumberFormatException, XmlPullParserException, IOException { String pkgName = parser.getAttributeValue(null, "n"); int outerDepth = parser.getDepth(); Loading @@ -691,7 +686,7 @@ public class AppOpsService extends IAppOpsService.Stub { String tagName = parser.getName(); if (tagName.equals("uid")) { readUid(parser, vers, pkgName); readUid(parser, pkgName); } else { Slog.w(TAG, "Unknown element under <pkg>: " + parser.getName()); Loading @@ -700,7 +695,7 @@ public class AppOpsService extends IAppOpsService.Stub { } } void readUid(XmlPullParser parser, int vers, String pkgName) throws NumberFormatException, void readUid(XmlPullParser parser, String pkgName) throws NumberFormatException, XmlPullParserException, IOException { int uid = Integer.parseInt(parser.getAttributeValue(null, "n")); int outerDepth = parser.getDepth(); Loading @@ -716,13 +711,8 @@ public class AppOpsService extends IAppOpsService.Stub { Op op = new Op(Integer.parseInt(parser.getAttributeValue(null, "n"))); String mode = parser.getAttributeValue(null, "m"); if (mode != null) { if (vers < CURRENT_VERSION && op.op != AppOpsManager.OP_POST_NOTIFICATION) { Slog.w(TAG, "AppOps vers " + vers + ": drop mode from " + pkgName + "/" + uid + " op " + op.op); } else { op.mode = Integer.parseInt(mode); } } String time = parser.getAttributeValue(null, "t"); if (time != null) { op.time = Long.parseLong(time); Loading Loading @@ -771,7 +761,6 @@ public class AppOpsService extends IAppOpsService.Stub { out.setOutput(stream, "utf-8"); out.startDocument(null, true); out.startTag(null, "app-ops"); out.attribute(null, "vers", Integer.toString(CURRENT_VERSION)); if (allOps != null) { String lastPkg = null; Loading Loading
services/java/com/android/server/AppOpsService.java +5 −16 Original line number Diff line number Diff line Loading @@ -63,8 +63,6 @@ public class AppOpsService extends IAppOpsService.Stub { // Write at most every 30 minutes. static final long WRITE_DELAY = DEBUG ? 1000 : 30*60*1000; static final int CURRENT_VERSION = 1; Context mContext; final AtomicFile mFile; final Handler mHandler; Loading Loading @@ -633,9 +631,6 @@ public class AppOpsService extends IAppOpsService.Stub { throw new IllegalStateException("no start tag found"); } String versStr = parser.getAttributeValue(null, "vers"); int vers = versStr != null ? Integer.parseInt(versStr) : 0; int outerDepth = parser.getDepth(); while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) { Loading @@ -645,7 +640,7 @@ public class AppOpsService extends IAppOpsService.Stub { String tagName = parser.getName(); if (tagName.equals("pkg")) { readPackage(parser, vers); readPackage(parser); } else { Slog.w(TAG, "Unknown element under <app-ops>: " + parser.getName()); Loading Loading @@ -678,7 +673,7 @@ public class AppOpsService extends IAppOpsService.Stub { } } void readPackage(XmlPullParser parser, int vers) throws NumberFormatException, void readPackage(XmlPullParser parser) throws NumberFormatException, XmlPullParserException, IOException { String pkgName = parser.getAttributeValue(null, "n"); int outerDepth = parser.getDepth(); Loading @@ -691,7 +686,7 @@ public class AppOpsService extends IAppOpsService.Stub { String tagName = parser.getName(); if (tagName.equals("uid")) { readUid(parser, vers, pkgName); readUid(parser, pkgName); } else { Slog.w(TAG, "Unknown element under <pkg>: " + parser.getName()); Loading @@ -700,7 +695,7 @@ public class AppOpsService extends IAppOpsService.Stub { } } void readUid(XmlPullParser parser, int vers, String pkgName) throws NumberFormatException, void readUid(XmlPullParser parser, String pkgName) throws NumberFormatException, XmlPullParserException, IOException { int uid = Integer.parseInt(parser.getAttributeValue(null, "n")); int outerDepth = parser.getDepth(); Loading @@ -716,13 +711,8 @@ public class AppOpsService extends IAppOpsService.Stub { Op op = new Op(Integer.parseInt(parser.getAttributeValue(null, "n"))); String mode = parser.getAttributeValue(null, "m"); if (mode != null) { if (vers < CURRENT_VERSION && op.op != AppOpsManager.OP_POST_NOTIFICATION) { Slog.w(TAG, "AppOps vers " + vers + ": drop mode from " + pkgName + "/" + uid + " op " + op.op); } else { op.mode = Integer.parseInt(mode); } } String time = parser.getAttributeValue(null, "t"); if (time != null) { op.time = Long.parseLong(time); Loading Loading @@ -771,7 +761,6 @@ public class AppOpsService extends IAppOpsService.Stub { out.setOutput(stream, "utf-8"); out.startDocument(null, true); out.startTag(null, "app-ops"); out.attribute(null, "vers", Integer.toString(CURRENT_VERSION)); if (allOps != null) { String lastPkg = null; Loading