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

710 Views Asked by At

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??

2

There are 2 best solutions below

1
On BEST ANSWER

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).

0
On

This can also be called by the device owner application.

Android M and up