Redirect NFC Panel to settings page
Flag: com.android.settings.flags.slices_retirement Bug: 328528962 Test: manual test adb shell am start -a android.settings.panel.action.NFC Change-Id: I5232c9e8ed8608d8f27bedbef10c62d7cc12cb8e
This commit is contained in:
@@ -22,11 +22,15 @@ import android.os.Bundle;
|
|||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.FeatureFlagUtils;
|
import android.util.FeatureFlagUtils;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
|
import com.android.settings.flags.Flags;
|
||||||
|
|
||||||
public class PanelFeatureProviderImpl implements PanelFeatureProvider {
|
public class PanelFeatureProviderImpl implements PanelFeatureProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Nullable
|
||||||
public PanelContent getPanel(Context context, Bundle bundle) {
|
public PanelContent getPanel(Context context, Bundle bundle) {
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -46,7 +50,14 @@ public class PanelFeatureProviderImpl implements PanelFeatureProvider {
|
|||||||
context.sendBroadcast(intent);
|
context.sendBroadcast(intent);
|
||||||
return null;
|
return null;
|
||||||
case Settings.Panel.ACTION_NFC:
|
case Settings.Panel.ACTION_NFC:
|
||||||
return NfcPanel.create(context);
|
if (Flags.slicesRetirement()) {
|
||||||
|
Intent nfcIntent = new Intent(Settings.ACTION_NFC_SETTINGS);
|
||||||
|
nfcIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
context.startActivity(nfcIntent);
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return NfcPanel.create(context);
|
||||||
|
}
|
||||||
case Settings.Panel.ACTION_WIFI:
|
case Settings.Panel.ACTION_WIFI:
|
||||||
return WifiPanel.create(context);
|
return WifiPanel.create(context);
|
||||||
case Settings.Panel.ACTION_VOLUME:
|
case Settings.Panel.ACTION_VOLUME:
|
||||||
|
Reference in New Issue
Block a user