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

Commit 546c1ffa authored by Anthony Hugh's avatar Anthony Hugh Committed by android-build-merger
Browse files

Fix wake lock leak

am: cfc6b97c

* commit 'cfc6b97c':
  Fix wake lock leak
parents ee232c4b cfc6b97c
Loading
Loading
Loading
Loading
+32 −27
Original line number Diff line number Diff line
@@ -586,6 +586,7 @@ public class WearPackageInstallerService extends Service {
        }

        public void packageInstalled(String packageName, int returnCode) {
            try {
                // If installation failed, bail out and remove the ShowPermsStore entry
                if (returnCode < 0) {
                    Log.e(TAG, "Package install failed " + mApplicationPackageName
@@ -609,10 +610,11 @@ public class WearPackageInstallerService extends Service {
                    gmsInstalledIntent.setPackage(GMS_PACKAGE_NAME);
                    mContext.sendBroadcast(gmsInstalledIntent);
                }

            } finally {
                finishService(mWakeLock, mStartId);
            }
        }
    }

    private class PackageDeleteObserver extends IPackageDeleteObserver.Stub {
        private PowerManager.WakeLock mWakeLock;
@@ -624,13 +626,16 @@ public class WearPackageInstallerService extends Service {
        }

        public void packageDeleted(String packageName, int returnCode) {
            try {
                if (returnCode >= 0) {
                    Log.i(TAG, "Package " + packageName + " was uninstalled.");
                } else {
                    Log.e(TAG, "Package uninstall failed " + packageName + ", returnCode " +
                            returnCode);
                }
            } finally {
                finishService(mWakeLock, mStartId);
            }
        }
    }
}