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

Commit c7e21156 authored by Terry Wang's avatar Terry Wang Committed by Automerger Merge Worker
Browse files

Merge "Close AppSearchImpl in handling user removed broadcast." into sc-dev...

Merge "Close AppSearchImpl in handling user removed broadcast." into sc-dev am: aca6fae8 am: c8797985

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14928053

Change-Id: I4a4cae2fd0c4c0ecb82aaef1a3a52735f3e07b76
parents a0482ee4 c8797985
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ public class AppSearchManagerService extends SystemService {
     */
    private void handleUserRemoved(@NonNull UserHandle userHandle) {
        try {
            mImplInstanceManager.removeAppSearchImplForUser(userHandle);
            mImplInstanceManager.closeAndRemoveAppSearchImplForUser(userHandle);
            mLoggerInstanceManager.removePlatformLoggerForUser(userHandle);
            Log.i(TAG, "Removed AppSearchImpl instance for: " + userHandle);
        } catch (Throwable t) {
+0 −19
Original line number Diff line number Diff line
@@ -103,25 +103,6 @@ public final class ImplInstanceManager {
        }
    }

    /**
     * Remove an instance of {@link AppSearchImpl} for the given user.
     *
     * <p>This method should only be called if {@link AppSearchManagerService} receives an
     * ACTION_USER_REMOVED, which the instance of given user should be removed.
     *
     * <p>If the user is removed, the "credential encrypted" system directory where icing lives will
     * be auto-deleted. So we shouldn't worry about persist data or close the AppSearchImpl.
     *
     * @param userHandle The multi-user user handle of the user that need to be removed.
     */
    public void removeAppSearchImplForUser(@NonNull UserHandle userHandle) {
        Objects.requireNonNull(userHandle);
        synchronized (mInstancesLocked) {
            // no need to close and persist data to disk since we are removing them now.
            mInstancesLocked.remove(userHandle);
        }
    }

    /**
     * Close and remove an instance of {@link AppSearchImpl} for the given user.
     *