diff options
| author | Fabian Kozynski <kozynski@google.com> | 2018-12-20 12:58:45 -0500 |
|---|---|---|
| committer | Fabian Kozynski <kozynski@google.com> | 2018-12-20 12:58:45 -0500 |
| commit | 0b4592cecb9374e5ff7802e1606707bde61abd1a (patch) | |
| tree | 6019933f9a32390994b63551bc2bdeb6c0a42bef /core/java | |
| parent | b34e8528ca7e6aee84ba5eef9739155f658690c5 (diff) | |
Use raw op codes for the watch noted APIs.
Test: atest com.android.server.AppOpsServiceTests
Test: atest com.android.systemui.appops.AppOpsControllerTest
bug:121246606
Change-Id: Id99923c566fbf132914b15c676cb766d8793e875
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/AppOpsManager.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index a2784237247c..c3839f95a8a5 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -2496,7 +2496,7 @@ public class AppOpsManager { * @param packageName The package performing the operation. * @param result The result of the note. */ - void onOpNoted(String code, int uid, String packageName, int result); + void onOpNoted(int code, int uid, String packageName, int result); } /** @@ -2953,7 +2953,7 @@ public class AppOpsManager { * @hide */ @RequiresPermission(value=Manifest.permission.WATCH_APPOPS, conditional=true) - public void startWatchingNoted(@NonNull String[] ops, @NonNull OnOpNotedListener callback) { + public void startWatchingNoted(@NonNull int[] ops, @NonNull OnOpNotedListener callback) { IAppOpsNotedCallback cb; synchronized (mNotedWatchers) { cb = mNotedWatchers.get(callback); @@ -2963,17 +2963,13 @@ public class AppOpsManager { cb = new IAppOpsNotedCallback.Stub() { @Override public void opNoted(int op, int uid, String packageName, int mode) { - callback.onOpNoted(sOpToString[op], uid, packageName, mode); + callback.onOpNoted(op, uid, packageName, mode); } }; mNotedWatchers.put(callback, cb); } try { - final int[] opCodes = new int[ops.length]; - for (int i = 0; i < opCodes.length; i++) { - opCodes[i] = strOpToOp(ops[i]); - } - mService.startWatchingNoted(opCodes, cb); + mService.startWatchingNoted(ops, cb); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -2983,7 +2979,7 @@ public class AppOpsManager { * Stop watching for noted app ops. An app op may be immediate or long running. * Unregistering a non-registered callback has no effect. * - * @see #startWatchingNoted(String[], OnOpNotedListener) + * @see #startWatchingNoted(int[], OnOpNotedListener) * @see #noteOp(String, int, String) * * @hide |
