Fix a near instant stats permission check false negative.

The MODE_DEFAULT enforcePermission behavior fell through to
the switch default case, even if the calling permission was
granted.

Bug: 34258237
Test: Manual
Change-Id: I823fb4dc3657c15eb1fa3d12d4f4c7e1e9e21cd5
This commit is contained in:
Daniel Nishi
2017-01-12 16:10:57 -08:00
parent 6f773a0d87
commit d85d85394e

View File

@@ -86,6 +86,7 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
case AppOpsManager.MODE_DEFAULT:
mContext.enforceCallingPermission(
android.Manifest.permission.PACKAGE_USAGE_STATS, TAG);
return;
default:
throw new SecurityException("Blocked by mode " + mode);
}