summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorStephen Chen <stewchen@google.com>2017-07-25 16:46:25 -0700
committerStephen Chen <stewchen@google.com>2017-08-14 11:36:39 -0700
commitce76a17ac5010e0b7ff5dcf6d8c9db8b48280f9c (patch)
tree5b8b1b97068a1d676847f7c3813be54a1bd48ab0 /service
parente699623dae17803bc8fb5dd56b3d6b17f64f9cc7 (diff)
ONA: Rename WifiNotificationController to OpenNetworkNotifier
Bug: 37357441 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: If59ecbd3078452f05e156091df1d098c8469a66a
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/OpenNetworkNotifier.java (renamed from service/java/com/android/server/wifi/WifiNotificationController.java)20
-rw-r--r--service/java/com/android/server/wifi/OpenNetworkRecommender.java2
-rw-r--r--service/java/com/android/server/wifi/WifiConnectivityManager.java16
-rw-r--r--service/java/com/android/server/wifi/WifiInjector.java6
4 files changed, 22 insertions, 22 deletions
diff --git a/service/java/com/android/server/wifi/WifiNotificationController.java b/service/java/com/android/server/wifi/OpenNetworkNotifier.java
index c226274a0..dee6c2f85 100644
--- a/service/java/com/android/server/wifi/WifiNotificationController.java
+++ b/service/java/com/android/server/wifi/OpenNetworkNotifier.java
@@ -42,7 +42,7 @@ import java.util.List;
* Takes care of handling the "open wi-fi network available" notification
* @hide
*/
-public class WifiNotificationController {
+public class OpenNetworkNotifier {
/**
* The icon to show in the 'available networks' notification. This will also
* be the ID of the Notification given to the NotificationManager.
@@ -52,7 +52,7 @@ public class WifiNotificationController {
/**
* When a notification is shown, we wait this amount before possibly showing it again.
*/
- private final long NOTIFICATION_REPEAT_DELAY_MS;
+ private final long mNotificationRepeatDelay;
/** Whether the user has set the setting to show the 'available networks' notification. */
private boolean mSettingEnabled;
@@ -86,11 +86,11 @@ public class WifiNotificationController {
private final OpenNetworkRecommender mOpenNetworkRecommender;
private ScanResult mRecommendedNetwork;
- WifiNotificationController(Context context,
- Looper looper,
- FrameworkFacade framework,
- Notification.Builder builder,
- OpenNetworkRecommender recommender) {
+ OpenNetworkNotifier(Context context,
+ Looper looper,
+ FrameworkFacade framework,
+ Notification.Builder builder,
+ OpenNetworkRecommender recommender) {
mContext = context;
mFrameworkFacade = framework;
mNotificationBuilder = builder;
@@ -99,7 +99,7 @@ public class WifiNotificationController {
mScreenOn = false;
// Setting is in seconds
- NOTIFICATION_REPEAT_DELAY_MS = mFrameworkFacade.getIntegerSetting(context,
+ mNotificationRepeatDelay = mFrameworkFacade.getIntegerSetting(context,
Settings.Global.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, 900) * 1000L;
mNotificationEnabledSettingObserver = new NotificationEnabledSettingObserver(
new Handler(looper));
@@ -215,7 +215,7 @@ public class WifiNotificationController {
mNotificationBuilder.setContentTitle(title);
mNotificationBuilder.setContentText(details);
- mNotificationRepeatTime = System.currentTimeMillis() + NOTIFICATION_REPEAT_DELAY_MS;
+ mNotificationRepeatTime = System.currentTimeMillis() + mNotificationRepeatDelay;
notificationManager.notifyAsUser(null, ICON_NETWORKS_AVAILABLE,
mNotificationBuilder.build(), UserHandle.ALL);
@@ -228,7 +228,7 @@ public class WifiNotificationController {
/** Dump ONA controller state. */
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
- pw.println("WifiNotificationController: ");
+ pw.println("OpenNetworkNotifier: ");
pw.println("mSettingEnabled " + mSettingEnabled);
pw.println("mNotificationRepeatTime " + mNotificationRepeatTime);
pw.println("mNotificationShown " + mNotificationShown);
diff --git a/service/java/com/android/server/wifi/OpenNetworkRecommender.java b/service/java/com/android/server/wifi/OpenNetworkRecommender.java
index 44b4db0e0..cd460e58b 100644
--- a/service/java/com/android/server/wifi/OpenNetworkRecommender.java
+++ b/service/java/com/android/server/wifi/OpenNetworkRecommender.java
@@ -22,7 +22,7 @@ import android.net.wifi.ScanResult;
import java.util.List;
/**
- * Helps recommend the best available network for {@link WifiNotificationController}.
+ * Helps recommend the best available network for {@link OpenNetworkNotifier}.
* @hide
*/
public class OpenNetworkRecommender {
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java
index 1cdc549ca..9603357a1 100644
--- a/service/java/com/android/server/wifi/WifiConnectivityManager.java
+++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java
@@ -133,7 +133,7 @@ public class WifiConnectivityManager {
private final WifiConnectivityHelper mConnectivityHelper;
private final WifiNetworkSelector mNetworkSelector;
private final WifiLastResortWatchdog mWifiLastResortWatchdog;
- private final WifiNotificationController mWifiNotificationController;
+ private final OpenNetworkNotifier mOpenNetworkNotifier;
private final WifiMetrics mWifiMetrics;
private final AlarmManager mAlarmManager;
private final Handler mEventHandler;
@@ -270,7 +270,7 @@ public class WifiConnectivityManager {
return true;
} else {
if (mWifiState == WIFI_STATE_DISCONNECTED) {
- mWifiNotificationController.handleScanResults(
+ mOpenNetworkNotifier.handleScanResults(
mNetworkSelector.getFilteredScanDetailsForOpenUnsavedNetworks());
}
return false;
@@ -540,7 +540,7 @@ public class WifiConnectivityManager {
WifiScanner scanner, WifiConfigManager configManager, WifiInfo wifiInfo,
WifiNetworkSelector networkSelector, WifiConnectivityHelper connectivityHelper,
WifiLastResortWatchdog wifiLastResortWatchdog,
- WifiNotificationController wifiNotificationController, WifiMetrics wifiMetrics,
+ OpenNetworkNotifier openNetworkNotifier, WifiMetrics wifiMetrics,
Looper looper, Clock clock, LocalLog localLog, boolean enable,
FrameworkFacade frameworkFacade,
SavedNetworkEvaluator savedNetworkEvaluator,
@@ -554,7 +554,7 @@ public class WifiConnectivityManager {
mConnectivityHelper = connectivityHelper;
mLocalLog = localLog;
mWifiLastResortWatchdog = wifiLastResortWatchdog;
- mWifiNotificationController = wifiNotificationController;
+ mOpenNetworkNotifier = openNetworkNotifier;
mWifiMetrics = wifiMetrics;
mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
mEventHandler = new Handler(looper);
@@ -1041,7 +1041,7 @@ public class WifiConnectivityManager {
mScreenOn = screenOn;
- mWifiNotificationController.handleScreenStateChanged(screenOn);
+ mOpenNetworkNotifier.handleScreenStateChanged(screenOn);
startConnectivityScan(SCAN_ON_SCHEDULE);
}
@@ -1071,7 +1071,7 @@ public class WifiConnectivityManager {
mWifiState = state;
if (mWifiState == WIFI_STATE_CONNECTED) {
- mWifiNotificationController.clearPendingNotification(false /* resetRepeatDelay */);
+ mOpenNetworkNotifier.clearPendingNotification(false /* resetRepeatDelay */);
}
// Reset BSSID of last connection attempt and kick off
@@ -1307,7 +1307,7 @@ public class WifiConnectivityManager {
stopConnectivityScan();
clearBssidBlacklist();
resetLastPeriodicSingleScanTimeStamp();
- mWifiNotificationController.clearPendingNotification(true /* resetRepeatDelay */);
+ mOpenNetworkNotifier.clearPendingNotification(true /* resetRepeatDelay */);
mLastConnectionAttemptBssid = null;
mWaitForFullBandScanResults = false;
}
@@ -1367,6 +1367,6 @@ public class WifiConnectivityManager {
pw.println("WifiConnectivityManager - Log Begin ----");
mLocalLog.dump(fd, pw, args);
pw.println("WifiConnectivityManager - Log End ----");
- mWifiNotificationController.dump(fd, pw, args);
+ mOpenNetworkNotifier.dump(fd, pw, args);
}
}
diff --git a/service/java/com/android/server/wifi/WifiInjector.java b/service/java/com/android/server/wifi/WifiInjector.java
index 0e769524b..1be3d7884 100644
--- a/service/java/com/android/server/wifi/WifiInjector.java
+++ b/service/java/com/android/server/wifi/WifiInjector.java
@@ -87,7 +87,7 @@ public class WifiInjector {
private final WifiStateMachine mWifiStateMachine;
private final WifiSettingsStore mSettingsStore;
private final WifiCertManager mCertManager;
- private final WifiNotificationController mNotificationController;
+ private final OpenNetworkNotifier mOpenNetworkNotifier;
private final WifiLockManager mLockManager;
private final WifiController mWifiController;
private final WificondControl mWificondControl;
@@ -231,7 +231,7 @@ public class WifiInjector {
this, mBackupManagerProxy, mCountryCode, mWifiNative,
new WrongPasswordNotifier(mContext, mFrameworkFacade));
mCertManager = new WifiCertManager(mContext);
- mNotificationController = new WifiNotificationController(mContext,
+ mOpenNetworkNotifier = new OpenNetworkNotifier(mContext,
mWifiStateMachineHandlerThread.getLooper(), mFrameworkFacade, null,
new OpenNetworkRecommender());
mLockManager = new WifiLockManager(mContext, BatteryStatsService.getService());
@@ -432,7 +432,7 @@ public class WifiInjector {
boolean hasConnectionRequests) {
return new WifiConnectivityManager(mContext, mWifiStateMachine, getWifiScanner(),
mWifiConfigManager, wifiInfo, mWifiNetworkSelector, mWifiConnectivityHelper,
- mWifiLastResortWatchdog, mNotificationController, mWifiMetrics,
+ mWifiLastResortWatchdog, mOpenNetworkNotifier, mWifiMetrics,
mWifiStateMachineHandlerThread.getLooper(), mClock, mConnectivityLocalLog,
hasConnectionRequests, mFrameworkFacade, mSavedNetworkEvaluator,
mScoredNetworkEvaluator, mPasspointNetworkEvaluator);