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

Commit 3518a75b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "restrict updateExternalMediaStatus to non-emulated storage"

parents a447868f b32a4e01
Loading
Loading
Loading
Loading
+15 −13
Original line number Original line Diff line number Diff line
@@ -767,8 +767,9 @@ class MountService extends IMountService.Stub


        Slog.d(TAG, "volume state changed for " + path + " (" + oldState + " -> " + state + ")");
        Slog.d(TAG, "volume state changed for " + path + " (" + oldState + " -> " + state + ")");


        // Tell PackageManager about changes, not only to primary volume,
        // Tell PackageManager about changes, only to the non-emulated
        // to all the non-emulated storage volumes
        // storage volumes.
        if (!volume.isEmulated()) {
            if (Environment.MEDIA_UNMOUNTED.equals(state)) {
            if (Environment.MEDIA_UNMOUNTED.equals(state)) {
                mPms.updateExternalMediaStatus(false, false);
                mPms.updateExternalMediaStatus(false, false);


@@ -782,6 +783,7 @@ class MountService extends IMountService.Stub
            } else if (Environment.MEDIA_MOUNTED.equals(state)) {
            } else if (Environment.MEDIA_MOUNTED.equals(state)) {
                mPms.updateExternalMediaStatus(true, false);
                mPms.updateExternalMediaStatus(true, false);
            }
            }
        }


        synchronized (mListeners) {
        synchronized (mListeners) {
            for (int i = mListeners.size() -1; i >= 0; i--) {
            for (int i = mListeners.size() -1; i >= 0; i--) {