Merge "Remove only selected messages for vold reset" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
df13a6364b
@@ -1085,7 +1085,12 @@ class StorageManagerService extends IStorageManager.Stub
|
||||
final List<UserInfo> users = mContext.getSystemService(UserManager.class).getUsers();
|
||||
|
||||
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 {
|
||||
killMediaProvider(users);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ import android.content.pm.PackageManager;
|
||||
import android.content.pm.ProviderInfo;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.pm.ServiceInfo;
|
||||
import android.os.Handler;
|
||||
import android.os.IVold;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.RemoteException;
|
||||
@@ -238,7 +237,7 @@ public final class StorageSessionController {
|
||||
*
|
||||
* 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)) {
|
||||
return;
|
||||
}
|
||||
@@ -280,7 +279,7 @@ public final class StorageSessionController {
|
||||
connection.close();
|
||||
}
|
||||
|
||||
handler.removeCallbacksAndMessages(null);
|
||||
resetHandlerRunnable.run();
|
||||
synchronized (mLock) {
|
||||
mConnections.clear();
|
||||
mIsResetting = false;
|
||||
|
||||
Reference in New Issue
Block a user