notify netd about uid internet permission changes when package replaced
1. If a previous version of an app doesn't declare internet permission; 2. The User upgraded it to a new version and the new one does declare the internet permission; 3. The new app are not allowed to access the internet until next boot Bug: 137864893 Test: Manual, just make sure the onPackageChanged would be executed on package changes Change-Id: I69cdbb16a027a9c4e974b32371b1f64a23a51a23 Signed-off-by: wangmingming1 <wangmingming1@xiaomi.com>
This commit is contained in:
committed by
Lorenzo Colitti
parent
7b0411782a
commit
71df3da8ae
@@ -51,6 +51,13 @@ public class PackageList implements PackageListObserver, AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPackageChanged(String packageName, int uid) {
|
||||
if (mWrappedObserver != null) {
|
||||
mWrappedObserver.onPackageChanged(packageName, uid);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPackageRemoved(String packageName, int uid) {
|
||||
if (mWrappedObserver != null) {
|
||||
|
||||
@@ -129,6 +129,11 @@ public class PermissionMonitor {
|
||||
sendPackagePermissionsForUid(uid, getPermissionForUid(uid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPackageChanged(@NonNull String packageName, int uid) {
|
||||
sendPackagePermissionsForUid(uid, getPermissionForUid(uid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPackageRemoved(String packageName, int uid) {
|
||||
sendPackagePermissionsForUid(uid, getPermissionForUid(uid));
|
||||
|
||||
Reference in New Issue
Block a user