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

Commit 46e59fe8 authored by Zimuzo Ezeozue's avatar Zimuzo Ezeozue Committed by Automerger Merge Worker
Browse files

Merge "Fixed a race contidion in StorageManagerService" am: 782ef476 am:...

Merge "Fixed a race contidion in StorageManagerService" am: 782ef476 am: c6536c87 am: 93a82398

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

Change-Id: If6b1b4d78b28e70e7739726e70089d485c15f7c4
parents 304a52b4 93a82398
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -200,6 +200,21 @@ public class VolumeInfo implements Parcelable {
        internalPath = parcel.readString8();
    }

    public VolumeInfo(VolumeInfo volumeInfo) {
        this.id = volumeInfo.id;
        this.type = volumeInfo.type;
        this.disk = volumeInfo.disk;
        this.partGuid = volumeInfo.partGuid;
        this.mountFlags = volumeInfo.mountFlags;
        this.mountUserId = volumeInfo.mountUserId;
        this.state = volumeInfo.state;
        this.fsType = volumeInfo.fsType;
        this.fsUuid = volumeInfo.fsUuid;
        this.fsLabel = volumeInfo.fsLabel;
        this.path = volumeInfo.path;
        this.internalPath = volumeInfo.internalPath;
    }

    @UnsupportedAppUsage
    public static @NonNull String getEnvironmentForState(int state) {
        final String envState = sStateToEnvironment.get(state);
+3 −2
Original line number Diff line number Diff line
@@ -1312,12 +1312,13 @@ class StorageManagerService extends IStorageManager.Stub
                    final int oldState = vol.state;
                    final int newState = state;
                    vol.state = newState;
                    final VolumeInfo vInfo = new VolumeInfo(vol);
                    final SomeArgs args = SomeArgs.obtain();
                    args.arg1 = vol;
                    args.arg1 = vInfo;
                    args.arg2 = oldState;
                    args.arg3 = newState;
                    mHandler.obtainMessage(H_VOLUME_STATE_CHANGED, args).sendToTarget();
                    onVolumeStateChangedLocked(vol, oldState, newState);
                    onVolumeStateChangedLocked(vInfo, oldState, newState);
                }
            }
        }