Redirect Volume Panel to settings page

Flag: com.android.settings.flags.slices_retirement
Bug: 328529042
Bug: 202262476
Test: manual test
adb shell am start -a android.settings.panel.action.VOLUME

Change-Id: I54f30d18eb10db864dcf5ee745b168b03e388b14
This commit is contained in:
Mill Chen
2024-04-24 08:38:14 +00:00
parent 1acb816217
commit e4f785c773
2 changed files with 16 additions and 1 deletions

View File

@@ -22,11 +22,15 @@ import android.os.Bundle;
import android.provider.Settings;
import android.util.FeatureFlagUtils;
import androidx.annotation.Nullable;
import com.android.settings.Utils;
import com.android.settings.flags.Flags;
public class PanelFeatureProviderImpl implements PanelFeatureProvider {
@Override
@Nullable
public PanelContent getPanel(Context context, Bundle bundle) {
if (context == null) {
return null;
@@ -59,7 +63,14 @@ public class PanelFeatureProviderImpl implements PanelFeatureProvider {
context.sendBroadcast(volumeIntent);
return null;
} else {
return VolumePanel.create(context);
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);
}
}
}