1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.server.wifi; 18 19 import android.content.Context; 20 import android.os.Looper; 21 import android.provider.Settings; 22 23 import com.android.internal.messages.nano.SystemMessageProto.SystemMessage; 24 25 /** 26 * This class handles the "open wi-fi network available" notification 27 * 28 * NOTE: These API's are not thread safe and should only be used from WifiStateMachine thread. 29 */ 30 public class OpenNetworkNotifier extends AvailableNetworkNotifier { 31 public static final String TAG = "WifiOpenNetworkNotifier"; 32 private static final String STORE_DATA_IDENTIFIER = "OpenNetworkNotifierBlacklist"; 33 private static final String TOGGLE_SETTINGS_NAME = 34 Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON; 35 36 public OpenNetworkNotifier( 37 Context context, 38 Looper looper, 39 FrameworkFacade framework, 40 Clock clock, 41 WifiMetrics wifiMetrics, 42 WifiConfigManager wifiConfigManager, 43 WifiConfigStore wifiConfigStore, 44 WifiStateMachine wifiStateMachine, 45 ConnectToNetworkNotificationBuilder connectToNetworkNotificationBuilder) { 46 super(TAG, STORE_DATA_IDENTIFIER, TOGGLE_SETTINGS_NAME, 47 SystemMessage.NOTE_NETWORK_AVAILABLE, context, looper, framework, clock, 48 wifiMetrics, wifiConfigManager, wifiConfigStore, wifiStateMachine, 49 connectToNetworkNotificationBuilder); 50 } 51 } 52