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

Commit cf28a1bd authored by Mill Chen's avatar Mill Chen Committed by Android (Google) Code Review
Browse files

Merge "Redirect Volume Panel to settings page" into main

parents 288d9879 e4f785c7
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -76,10 +76,17 @@ public class PanelFeatureProviderImpl implements PanelFeatureProvider {
                            Utils.SYSTEMUI_PACKAGE_NAME);
                    context.sendBroadcast(volumeIntent);
                    return null;
                } else {
                    if (Flags.slicesRetirement()) {
                        Intent volIntent = new Intent(Settings.ACTION_SOUND_SETTINGS);
                        volIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        context.startActivity(volIntent);
                        return null;
                    } else {
                        return VolumePanel.create(context);
                    }
                }
        }

        throw new IllegalStateException("No matching panel for: " + panelType);
    }
+4 −0
Original line number Diff line number Diff line
@@ -27,12 +27,15 @@ import static org.mockito.Mockito.verify;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.platform.test.annotations.DisableFlags;
import android.provider.Settings;
import android.util.FeatureFlagUtils;

import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.android.settings.flags.Flags;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -68,6 +71,7 @@ public class PanelFeatureProviderImplTest {
    }

    @Test
    @DisableFlags(Flags.FLAG_SLICES_RETIREMENT)
    public void getPanel_volumePanel_returnsCorrectPanel() {
        FeatureFlagUtils.setEnabled(mContext, FeatureFlagUtils.SETTINGS_VOLUME_PANEL_IN_SYSTEMUI,
                false);