Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3625c0e2 authored by Anthony Hugh's avatar Anthony Hugh Committed by android-build-merger
Browse files

Handle exception when removing package am: dd8fef70

am: 72dcbede

Change-Id: I99241113318c806c9e85ee56273c536a80a9c7fa
parents 786c22d2 72dcbede
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -361,13 +361,20 @@ public class WearPackageInstallerService extends Service {

            // Found package, send uninstall request.
            PowerManager.WakeLock lock = getLock(this.getApplicationContext());

            try {
                pm.deletePackage(packageName, new PackageDeleteObserver(lock, startId),
                        PackageManager.DELETE_ALL_USERS);
            } catch (IllegalArgumentException e) {
                // Couldn't find the package, no need to call uninstall.
                Log.w(TAG, "Could not find package, not deleting " + packageName, e);
            }

            startPermsServiceForUninstall(packageName);
            Log.i(TAG, "Sent delete request for " + packageName);
        } catch (PackageManager.NameNotFoundException e) {
            // Couldn't find the package, no need to call uninstall.
            Log.w(TAG, "Could not find package, not deleting " + packageName);
            Log.w(TAG, "Could not find package, not deleting " + packageName, e);
        }
    }