Merge "[VolumePanel] Redirect volume panel action to SystemUI" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
95912773f9
@@ -20,6 +20,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
public class PanelFeatureProviderImpl implements PanelFeatureProvider {
|
||||
|
||||
@@ -49,9 +50,19 @@ public class PanelFeatureProviderImpl implements PanelFeatureProvider {
|
||||
case Settings.Panel.ACTION_WIFI:
|
||||
return WifiPanel.create(context);
|
||||
case Settings.Panel.ACTION_VOLUME:
|
||||
return VolumePanel.create(context);
|
||||
if (FeatureFlagUtils.isEnabled(context,
|
||||
FeatureFlagUtils.SETTINGS_VOLUME_PANEL_IN_SYSTEMUI)) {
|
||||
// Redirect to the volume panel in SystemUI.
|
||||
Intent volumeIntent = new Intent(Settings.Panel.ACTION_VOLUME);
|
||||
volumeIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND).setPackage(
|
||||
SYSTEMUI_PACKAGE_NAME);
|
||||
context.sendBroadcast(volumeIntent);
|
||||
return null;
|
||||
} else {
|
||||
return VolumePanel.create(context);
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalStateException("No matching panel for: " + panelType);
|
||||
throw new IllegalStateException("No matching panel for: " + panelType);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user