Usage of 'public void uninstall (String packageName, IntentSender statusReceiver)' method of PackageInstaller

有些话、适合烂在心里 提交于 2021-01-28 06:11:43

问题


Have you ever used public void uninstall (String packageName, IntentSender statusReceiver)' ofPackageInstaller` ? This is new API added in apilevel 21.

And this API description is

Uninstall the given package, removing it completely from the device. This method is only available to the current "installer of record" for the package.

what does 'installer of record' mean here??


回答1:


Following the PackageInstaller code shows that the uninstall() session is bound to a PackageInstaller.Session which only works from the same installerPackageName.

So you can only uninstall an app installed from the same installer, e.g. a market application (which is what they seem to mean with 'installer of record').

(Can't comment, yet so I wrote this into a new answer).




回答2:


This can also be called by the device owner application.

Android M and up



来源:https://stackoverflow.com/questions/30461325/usage-of-public-void-uninstall-string-packagename-intentsender-statusreceiver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!