diff --git a/frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java b/frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
index 728cca4..702c240 100755
--- a/frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
方法:deletePackageAsUser
@@ -15775,8 +15775,20 @@ public class PackageManagerService extends IPackageManager.Stub {
@Override
public void deletePackageAsUser(String packageName, IPackageDeleteObserver observer, int userId,
int flags) {
+ if(android.os.SystemProperties.getBoolean("m.ban.uninstall", true) && packageName.equals("com.alipay.iot.xpaas")){
+ if (observer != null) {
+ try {
+ final IPackageDeleteObserver2 observer2 = new LegacyPackageDeleteObserver(observer).getBinder();
+ observer2.onPackageDeleted(packageName, -1, null);
+ } catch (RemoteException e) {
+ Log.i(TAG, "Observer no longer exists.");
+ }
+ }
+ }else{
+ android.os.SystemProperties.set("m.ban.uninstall", "true");
deletePackage(packageName, new LegacyPackageDeleteObserver(observer).getBinder(), userId,
flags);
+ }
}
rk3288 Android 7.1限制普通应用被卸载
最新推荐文章于 2023-10-07 13:54:38 发布