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

Commit f20ee48c authored by Amith Yamasani's avatar Amith Yamasani Committed by Gerrit Code Review
Browse files

Merge "Handle stopped apps" into main

parents c5a3c90c 5b001d8d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ import android.util.Log;

import com.android.bluetooth.BluetoothEventLogger;
import com.android.bluetooth.Utils;
import com.android.bluetooth.flags.FeatureFlags;
import com.android.bluetooth.flags.FeatureFlagsImpl;
import com.android.internal.annotations.VisibleForTesting;

import java.util.ArrayList;
@@ -90,6 +92,7 @@ public class MediaPlayerList {
    private MediaSessionManager mMediaSessionManager;
    private MediaData mCurrMediaData = null;
    private final AudioManager mAudioManager;
    private final FeatureFlags mFeatureFlags = new FeatureFlagsImpl();

    private final BluetoothEventLogger mActivePlayerLogger =
            new BluetoothEventLogger(ACTIVE_PLAYER_LOGGER_SIZE, ACTIVE_PLAYER_LOGGER_TITLE);
@@ -208,6 +211,10 @@ public class MediaPlayerList {

        // Build the list of browsable players and afterwards, build the list of media players
        Intent intent = new Intent(android.service.media.MediaBrowserService.SERVICE_INTERFACE);
        if (mFeatureFlags.keepStoppedMediaBrowserService()) {
            // Don't query stopped apps, that would end up unstopping them
            intent.addFlags(Intent.FLAG_EXCLUDE_STOPPED_PACKAGES);
        }
        List<ResolveInfo> playerList =
                mContext
                    .getApplicationContext()