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

Commit df13a636 authored by Keun-young Park's avatar Keun-young Park Committed by Android (Google) Code Review
Browse files

Merge "Remove only selected messages for vold reset" into rvc-dev

parents 35e288c6 0c00e523
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -1085,7 +1085,12 @@ class StorageManagerService extends IStorageManager.Stub
            final List<UserInfo> users = mContext.getSystemService(UserManager.class).getUsers();
            final List<UserInfo> users = mContext.getSystemService(UserManager.class).getUsers();


            if (mIsFuseEnabled) {
            if (mIsFuseEnabled) {
                mStorageSessionController.onReset(mVold, mHandler);
                mStorageSessionController.onReset(mVold, () -> {
                    mHandler.removeMessages(H_RESET);
                    mHandler.removeMessages(H_VOLUME_BROADCAST);
                    mHandler.removeMessages(H_VOLUME_MOUNT);
                    mHandler.removeMessages(H_VOLUME_UNMOUNT);
                });
            } else {
            } else {
                killMediaProvider(users);
                killMediaProvider(users);
            }
            }
+2 −3
Original line number Original line Diff line number Diff line
@@ -27,7 +27,6 @@ import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.pm.ServiceInfo;
import android.os.Handler;
import android.os.IVold;
import android.os.IVold;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.os.RemoteException;
@@ -238,7 +237,7 @@ public final class StorageSessionController {
     *
     *
     * Does nothing if {@link #shouldHandle} is {@code false}
     * Does nothing if {@link #shouldHandle} is {@code false}
     **/
     **/
    public void onReset(IVold vold, Handler handler) {
    public void onReset(IVold vold, Runnable resetHandlerRunnable) {
        if (!shouldHandle(null)) {
        if (!shouldHandle(null)) {
            return;
            return;
        }
        }
@@ -280,7 +279,7 @@ public final class StorageSessionController {
            connection.close();
            connection.close();
        }
        }


        handler.removeCallbacksAndMessages(null);
        resetHandlerRunnable.run();
        synchronized (mLock) {
        synchronized (mLock) {
            mConnections.clear();
            mConnections.clear();
            mIsResetting = false;
            mIsResetting = false;