summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorYohei Yukawa <yukawa@google.com>2017-10-12 15:02:26 -0700
committerYohei Yukawa <yukawa@google.com>2017-10-12 15:02:26 -0700
commita965d65cd382c381b5b83e460213174ac82ec2e0 (patch)
treec8c737dd470a736a99bf32207be30848354c1277 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent60d548786e5521d819c9eadeaa34fcffe36c45ff (diff)
Suppress warnings from AppOpsManager#checkPackage()
AppOpsManager#checkPackage() is the recommended API to check whether a given package belongs to a certain UID or not. You can check whether a SecurityException is thrown or not to get the answer. However, if the given package does not belong to the UID specified, the app developer not only sees SecurityException but also sees the warning in messages like below, which is a bit spammy and may actually confuse QA team. W AppOps : Bad call: specified package com.android under uid 12345 but it is really -1 W AppOps : java.lang.RuntimeException: here W AppOps : at com.android.server.AppOpsService.getOpsRawLocked(AppOpsService.java:1330) W AppOps : at com.android.server.AppOpsService.checkPackage(AppOpsService.java:1049) W AppOps : at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:169) W AppOps : at android.os.Binder.execTransact(Binder.java:696) With this CL, AppOpsManager#checkPackage() no longer triggers the above warnings in logcat. Hopefully app developers do log something in logcat if the package name / UID mismatch is actually unexpected. This CL should have no semantic behavior change anyway. Fixes: 67745316 Test: Locally verified by making the following API call. context.getSystemService(AppOpsManager.class) .checkPackage(12345, "com.android") While it still throws SecurityException, warning messages are no longer shown in the logcat. Change-Id: Ic7af4ef84ad9e7ae5c0fbaa9cd1343f5443e8603
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions