Merge "Ignore package mode for MANAGE_EXTERNAL_STORAGE" into rvc-dev am: ab2132d460
Change-Id: I832df1eddba66f49406e1242a70d69274ace3c18
This commit is contained in:
@@ -4060,9 +4060,11 @@ public class AppOpsService extends IAppOpsService.Stub {
|
|||||||
private void readOp(XmlPullParser parser, @NonNull UidState uidState,
|
private void readOp(XmlPullParser parser, @NonNull UidState uidState,
|
||||||
@NonNull String pkgName, boolean isPrivileged) throws NumberFormatException,
|
@NonNull String pkgName, boolean isPrivileged) throws NumberFormatException,
|
||||||
XmlPullParserException, IOException {
|
XmlPullParserException, IOException {
|
||||||
Op op = new Op(uidState, pkgName,
|
int opCode = Integer.parseInt(parser.getAttributeValue(null, "n"));
|
||||||
Integer.parseInt(parser.getAttributeValue(null, "n")),
|
if (isIgnoredAppOp(opCode)) {
|
||||||
uidState.uid);
|
return;
|
||||||
|
}
|
||||||
|
Op op = new Op(uidState, pkgName, opCode, uidState.uid);
|
||||||
|
|
||||||
final int mode = XmlUtils.readIntAttribute(parser, "m",
|
final int mode = XmlUtils.readIntAttribute(parser, "m",
|
||||||
AppOpsManager.opToDefaultMode(op.op));
|
AppOpsManager.opToDefaultMode(op.op));
|
||||||
@@ -4096,6 +4098,16 @@ public class AppOpsService extends IAppOpsService.Stub {
|
|||||||
ops.put(op.op, op);
|
ops.put(op.op, op);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO(b/149995538): Remove once this has reached all affected devices
|
||||||
|
private static boolean isIgnoredAppOp(int op) {
|
||||||
|
switch (op) {
|
||||||
|
case AppOpsManager.OP_MANAGE_EXTERNAL_STORAGE:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void writeState() {
|
void writeState() {
|
||||||
synchronized (mFile) {
|
synchronized (mFile) {
|
||||||
FileOutputStream stream;
|
FileOutputStream stream;
|
||||||
|
|||||||
Reference in New Issue
Block a user