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

Commit 2e763c28 authored by Santiago Seifert's avatar Santiago Seifert
Browse files

Remove flag to disable the screen off broadcast receiver

It was originally added to prototype the watch-to-phone output switcher,
in ag/24993347. We now have a proper API for this, so this flag is no
longer useful.

Bug: b/304234628
Test: N/A.
Change-Id: I928f5ec3b8532a134f269d03a75e0b82cac1ca30
parent d4ff0b50
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -24,13 +24,6 @@ flag {
    bug: "280576228"
}

flag {
    name: "disable_screen_off_broadcast_receiver"
    namespace: "media_solutions"
    description: "Disables the broadcast receiver that prevents scanning when the screen is off."
    bug: "304234628"
}

flag {
    name: "fallback_to_default_handling_when_media_session_has_fixed_volume_handling"
    namespace: "media_solutions"
+6 −12
Original line number Diff line number Diff line
@@ -189,12 +189,10 @@ class MediaRouter2ServiceImpl {
        mUserManagerInternal = LocalServices.getService(UserManagerInternal.class);
        mAppOpsManager = mContext.getSystemService(AppOpsManager.class);

        if (!Flags.disableScreenOffBroadcastReceiver()) {
        IntentFilter screenOnOffIntentFilter = new IntentFilter();
        screenOnOffIntentFilter.addAction(ACTION_SCREEN_ON);
        screenOnOffIntentFilter.addAction(ACTION_SCREEN_OFF);
        mContext.registerReceiver(mScreenOnOffReceiver, screenOnOffIntentFilter);
        }

        // Passing null package name to listen to all events.
        mAppOpsManager.startWatchingMode(
@@ -3435,9 +3433,7 @@ class MediaRouter2ServiceImpl {
        @NonNull
        private static List<RouterRecord> getIndividuallyActiveRouters(
                MediaRouter2ServiceImpl service, List<RouterRecord> allRouterRecords) {
            if (!Flags.disableScreenOffBroadcastReceiver()
                    && !service.mPowerManager.isInteractive()
                    && !Flags.enableScreenOffScanning()) {
            if (!service.mPowerManager.isInteractive() && !Flags.enableScreenOffScanning()) {
                return Collections.emptyList();
            }

@@ -3453,9 +3449,7 @@ class MediaRouter2ServiceImpl {

        private static boolean areManagersScanning(
                MediaRouter2ServiceImpl service, List<ManagerRecord> managerRecords) {
            if (!Flags.disableScreenOffBroadcastReceiver()
                    && !service.mPowerManager.isInteractive()
                    && !Flags.enableScreenOffScanning()) {
            if (!service.mPowerManager.isInteractive() && !Flags.enableScreenOffScanning()) {
                return false;
            }