问题
Have you ever used public void uninstall (String packageName, IntentSender statusReceiver)' of
PackageInstaller` ? 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