Don't log privapp-permissions violations for updated apps

Only warn about violations in non-updated apps. If an updated privileged
app started requesting a new privileged permission, it cannot be
whitelisted on system image, so we should revoke it as before, but not log.

Test: manual
Bug: 35633526
Change-Id: I6aacaed4be7bf6eaef08ea81ea49cd250c81e71e
This commit is contained in:
Fyodor Kupolov
2017-02-24 12:46:37 -08:00
parent 5faf303931
commit 0ba0d814b3

View File

@@ -11662,7 +11662,8 @@ public class PackageManagerService extends IPackageManager.Stub {
if (!whitelisted) {
Slog.w(TAG, "Privileged permission " + perm + " for package "
+ pkg.packageName + " - not in privapp-permissions whitelist");
if (!mSystemReady) {
// Only report violations for apps on system image
if (!mSystemReady && !pkg.isUpdatedSystemApp()) {
if (mPrivappPermissionsViolations == null) {
mPrivappPermissionsViolations = new ArraySet<>();
}