Only check op in Settings UI

noteOp should only used if the data protected by the app-op was
accessed. If you only want to know the state, use checkOp.

Test: TH
Bug: 136595429
Change-Id: I2b53ad413c10a71feb9c94848aef2f9f38f851d8
This commit is contained in:
Philip P. Moltmann
2020-03-24 15:55:57 -07:00
parent 87c0179c01
commit 12954d5060

View File

@@ -108,7 +108,7 @@ public class WriteSettingsDetails extends AppInfoWithHeader implements OnPrefere
}
private boolean canWriteSettings(String pkgName) {
int result = mAppOpsManager.noteOpNoThrow(AppOpsManager.OP_WRITE_SETTINGS,
int result = mAppOpsManager.checkOpNoThrow(AppOpsManager.OP_WRITE_SETTINGS,
mPackageInfo.applicationInfo.uid, pkgName);
if (result == AppOpsManager.MODE_ALLOWED) {
return true;