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

Commit 7897d1b6 authored by San Mehat's avatar San Mehat Committed by Android (Google) Code Review
Browse files

Merge "MountService: Handle volumes shared on startup"

parents 2e805b19 6a254403
Loading
Loading
Loading
Loading
+11 −4
Original line number Original line Diff line number Diff line
@@ -337,16 +337,23 @@ class MountService extends IMountService.Stub
                    public void run() {
                    public void run() {
                        try {
                        try {
                            String path = Environment.getExternalStorageDirectory().getPath();
                            String path = Environment.getExternalStorageDirectory().getPath();
                            if (getVolumeState(
                            String state = getVolumeState(path);
                                    Environment.getExternalStorageDirectory().getPath()).equals(

                                            Environment.MEDIA_UNMOUNTED)) {
                            if (state.equals(Environment.MEDIA_UNMOUNTED)) {
                                int rc = doMountVolume(path);
                                int rc = doMountVolume(path);
                                if (rc != StorageResultCode.OperationSucceeded) {
                                if (rc != StorageResultCode.OperationSucceeded) {
                                    Log.e(TAG, String.format("Boot-time mount failed (%d)", rc));
                                    Log.e(TAG, String.format("Boot-time mount failed (%d)", rc));
                                }
                                }
                            } else if (state.equals(Environment.MEDIA_SHARED)) {
                                /*
                                 * Bootstrap UMS enabled state since vold indicates
                                 * the volume is shared (runtime restart while ums enabled)
                                 */
                                notifyVolumeStateChange(null, path, VolumeState.NoMedia, VolumeState.Shared);
                            }
                            }

                            /*
                            /*
                             * If UMS is connected in boot, send the connected event
                             * If UMS was connected on boot, send the connected event
                             * now that we're up.
                             * now that we're up.
                             */
                             */
                            if (mSendUmsConnectedOnBoot) {
                            if (mSendUmsConnectedOnBoot) {