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

* commit 'bedd1744b2afa0ede3ab7ac38a0e4a2111ed53bf':
  Work on issue #18572506: AppOps in-memory state is invalid after...
This commit is contained in:
Dianne Hackborn
2014-12-03 20:42:17 +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) {
}
}