am b46e9da6: am bedd1744: am ef44c051: Merge "Work on issue #18572506: AppOps in-memory state is invalid after..." into lmp-mr1-dev

* commit 'b46e9da64c51bcbfdd21b8e18850064eeb50d930':
  Work on issue #18572506: AppOps in-memory state is invalid after...
This commit is contained in:
Dianne Hackborn
2014-12-03 21:50:10 +00:00
committed by Android Git Automerger
4 changed files with 241 additions and 31 deletions

View File

@@ -26,6 +26,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.ArrayMap;
@@ -733,6 +734,18 @@ public class AppOpsManager {
return op < sOpNames.length ? sOpNames[op] : ("Unknown(" + op + ")");
}
/**
* @hide
*/
public static int strDebugOpToOp(String op) {
for (int i=0; i<sOpNames.length; i++) {
if (sOpNames[i].equals(op)) {
return i;
}
}
throw new IllegalArgumentException("Unknown operation string: " + op);
}
/**
* Retrieve the permission associated with an operation, or null if there is not one.
* @hide
@@ -996,7 +1009,7 @@ public class AppOpsManager {
/** @hide */
public void resetAllModes() {
try {
mService.resetAllModes();
mService.resetAllModes(UserHandle.myUserId(), null);
} catch (RemoteException e) {
}
}

View File

@@ -36,7 +36,7 @@ interface IAppOpsService {
List<AppOpsManager.PackageOps> getPackagesForOps(in int[] ops);
List<AppOpsManager.PackageOps> getOpsForPackage(int uid, String packageName, in int[] ops);
void setMode(int code, int uid, String packageName, int mode);
void resetAllModes();
void resetAllModes(int reqUserId, String reqPackageName);
int checkAudioOperation(int code, int usage, int uid, String packageName);
void setAudioRestriction(int code, int usage, int uid, int mode, in String[] exceptionPackages);