Revert "Update "Open networks available" toggle to instead open notification channel preferences."

This reverts commit 2c4b42c0b7.

Reason for revert: Need to use Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON to toggle the feature because system NotificationChannels cannot be disabled.
Bug: 37794067
Test: m RunSettingsRoboTests

Change-Id: I6aaad78686f4fe929fd6bcd94897341fdaf6bd23
This commit is contained in:
Amin Shaikh
2017-05-09 20:34:53 +00:00
parent b296697e8e
commit dfa9bb8914
5 changed files with 136 additions and 245 deletions

View File

@@ -15,13 +15,15 @@
*/
package com.android.settings.wifi;
import android.app.INotificationManager;
import static android.content.Context.NETWORK_SCORE_SERVICE;
import static android.content.Context.WIFI_SERVICE;
import android.content.Context;
import android.content.Intent;
import android.net.NetworkScoreManager;
import android.net.wifi.WifiManager;
import android.os.ServiceManager;
import android.provider.SearchIndexableResource;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
@@ -32,7 +34,6 @@ import com.android.settings.network.NetworkScorerPickerPreferenceController;
import com.android.settings.network.WifiCallingPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settings.utils.NotificationChannelHelper;
import com.android.settings.wifi.p2p.WifiP2pPreferenceController;
import java.util.ArrayList;
@@ -72,18 +73,14 @@ public class ConfigureWifiSettings extends DashboardFragment {
protected List<PreferenceController> getPreferenceControllers(Context context) {
final NetworkScoreManagerWrapper networkScoreManagerWrapper =
new NetworkScoreManagerWrapper(context.getSystemService(NetworkScoreManager.class));
final NotificationChannelHelper notificationChannelHelper =
new NotificationChannelHelper(INotificationManager.Stub.asInterface(
ServiceManager.getService(Context.NOTIFICATION_SERVICE)));
final WifiManager wifiManager = context.getSystemService(WifiManager.class);
mUseOpenWifiPreferenceController = new UseOpenWifiPreferenceController(context, this,
networkScoreManagerWrapper, getLifecycle());
final WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE);
final List<PreferenceController> controllers = new ArrayList<>();
controllers.add(new WifiWakeupPreferenceController(context, getLifecycle()));
controllers.add(new NetworkScorerPickerPreferenceController(context,
networkScoreManagerWrapper));
controllers.add(new NotifyOpenNetworksPreferenceController(context,
networkScoreManagerWrapper, notificationChannelHelper, getPackageManager()));
controllers.add(new NotifyOpenNetworksPreferenceController(context, getLifecycle()));
controllers.add(mUseOpenWifiPreferenceController);
controllers.add(new WifiSleepPolicyPreferenceController(context));
controllers.add(new WifiInfoPreferenceController(context, getLifecycle(), wifiManager));