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

@@ -1,64 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.utils;
import android.app.INotificationManager;
import android.app.NotificationChannel;
import android.os.RemoteException;
/**
* Wrappers around methods in {@link INotificationManager} and {@link NotificationChannel} to
* facilitate unit testing.
*
* TODO: delete this class once robolectric supports Android O
*/
public class NotificationChannelHelper {
private INotificationManager mNotificationManager;
public NotificationChannelHelper(
INotificationManager notificationManager) {
mNotificationManager = notificationManager;
}
/**
* Returns the notification channel settings for a app given its package name, user id, and
* channel id.
*/
public NotificationChannelWrapper getNotificationChannelForPackage(String pkg, int uid,
String channelId, boolean includeDeleted) throws RemoteException {
NotificationChannel channel = mNotificationManager.getNotificationChannelForPackage(
pkg, uid, channelId, includeDeleted);
return channel == null ? null : new NotificationChannelWrapper(channel);
}
/**
* Wrapper around {@link NotificationChannel} to facilitate unit testing.
*
* TODO: delete this class once robolectric supports Android O
*/
public class NotificationChannelWrapper {
private NotificationChannel mChannel;
public NotificationChannelWrapper(NotificationChannel channel) {
mChannel = channel;
}
public int getImportance() {
return mChannel.getImportance();
}
}
}