[Provider Model] Redirect Settings Internet panel request to SystemUI.

From QPR, the panel should be launched from SystemUI, so redirect the panel to SystemUI

Test: make
Bug: 187779230
Change-Id: I5b4131c4d986399944c038f8bce0723fcb5ba3b3
This commit is contained in:
Zoey Chen
2021-07-01 00:16:22 +08:00
parent 28da952fb2
commit ab8a922f77
4 changed files with 22 additions and 772 deletions

View File

@@ -17,11 +17,14 @@
package com.android.settings.panel;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.provider.Settings;
public class PanelFeatureProviderImpl implements PanelFeatureProvider {
private static final String SYSTEMUI_PACKAGE_NAME = "com.android.systemui";
@Override
public PanelContent getPanel(Context context, Bundle bundle) {
if (context == null) {
@@ -35,7 +38,12 @@ public class PanelFeatureProviderImpl implements PanelFeatureProvider {
switch (panelType) {
case Settings.Panel.ACTION_INTERNET_CONNECTIVITY:
return InternetConnectivityPanel.create(context);
// Redirect to the internet dialog in SystemUI.
Intent intent = new Intent(Settings.Panel.ACTION_INTERNET_CONNECTIVITY);
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
.setPackage(SYSTEMUI_PACKAGE_NAME);
context.sendBroadcast(intent);
return null;
case Settings.Panel.ACTION_NFC:
return NfcPanel.create(context);
case Settings.Panel.ACTION_WIFI: