[core] Fix uninstalling
This commit is contained in:
parent
d3e87f3944
commit
83045a69a7
|
|
@ -173,6 +173,7 @@ public class ModulesActivity extends ListActivity implements ModuleUtil.ModuleLi
|
|||
Toast.makeText(ModulesActivity.this, text, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
if (success) moduleUtil.reloadSingleModule(module.packageName);
|
||||
}))
|
||||
.setNegativeButton(android.R.string.cancel, null)
|
||||
.show();
|
||||
|
|
|
|||
|
|
@ -107,6 +107,9 @@ public final class ModuleUtil {
|
|||
PackageInfo pkg;
|
||||
try {
|
||||
pkg = ConfigManager.getPackageInfo(packageName, PackageManager.GET_META_DATA);
|
||||
if (pkg == null) {
|
||||
throw new NameNotFoundException();
|
||||
}
|
||||
} catch (NameNotFoundException e) {
|
||||
InstalledModule old = installedModules.remove(packageName);
|
||||
if (old != null) {
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ public class PackageService {
|
|||
public static boolean uninstallPackage(VersionedPackage versionedPackage) throws RemoteException, InterruptedException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
|
||||
CountDownLatch latch = new CountDownLatch(1);
|
||||
final boolean[] result = {false};
|
||||
pm.getPackageInstaller().uninstallExistingPackage(versionedPackage, "com.android.shell", new IntentSenderAdaptor() {
|
||||
pm.getPackageInstaller().uninstall(versionedPackage, null, 0x00000002, new IntentSenderAdaptor() {
|
||||
@Override
|
||||
public void send(Intent intent) {
|
||||
int status = intent.getIntExtra(PackageInstaller.EXTRA_STATUS, PackageInstaller.STATUS_FAILURE);
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
package android.content.pm;
|
||||
|
||||
import android.content.IntentSender;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
|
||||
public interface IPackageInstaller extends IInterface {
|
||||
|
||||
void uninstallExistingPackage(VersionedPackage versionedPackage, String callerPackageName,
|
||||
IntentSender statusReceiver, int userId);
|
||||
void uninstall(android.content.pm.VersionedPackage versionedPackage, java.lang.String callerPackageName, int flags, android.content.IntentSender statusReceiver, int userId) throws android.os.RemoteException;
|
||||
|
||||
abstract class Stub extends Binder implements IPackageInstaller {
|
||||
public static IPackageInstaller asInterface(IBinder obj) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue