summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2019-12-20 12:45:12 -0800
committerEtan Cohen <etancohen@google.com>2019-12-20 14:15:29 -0800
commit4b2668279f14d7123991bb6149d5dc5acc40992a (patch)
treeb3fc8b07e5d60731031d49e8c8293ae95f28c8d0
parent35b851ea5f2b0bd7da35590579b99cf4f0d3e19e (diff)
[WIFI] Remove System APIs overlays added as part of Wi-Fi mainline
The removed 4 overlays are unnecessarily shared between connectivity and Wi-Fi: there's no reason or requirement to assume they are identical. Having them as System API would necessitate a formal API - getters. Therefore, remove them as System API. Duplicate them within the Wi-Fi mainline module. Bug: 144764992 Test: atest android.net.wifi Test: atest ConnectivityServiceTest Test: atest com.android.server.wifi Change-Id: I529f2c3afcf8476ec6e884825d60291a43dc1fcb
-rw-r--r--service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java2
-rw-r--r--service/java/com/android/server/wifi/ConnectionFailureNotificationBuilder.java2
-rw-r--r--service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java2
-rw-r--r--service/java/com/android/server/wifi/WifiService.java6
-rw-r--r--service/java/com/android/server/wifi/WrongPasswordNotifier.java2
-rw-r--r--service/res/drawable/stat_notify_wifi_in_range.xml27
-rw-r--r--service/res/values/overlayable.xml3
-rw-r--r--service/res/values/strings.xml7
8 files changed, 44 insertions, 7 deletions
diff --git a/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java b/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java
index 621aa7823..ec4b9bf0e 100644
--- a/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java
+++ b/service/java/com/android/server/wifi/ConnectToNetworkNotificationBuilder.java
@@ -157,7 +157,7 @@ public class ConnectToNetworkNotificationBuilder {
CharSequence title, CharSequence content, String extraData) {
return mFrameworkFacade.makeNotificationBuilder(mContext,
WifiService.NOTIFICATION_NETWORK_AVAILABLE)
- .setSmallIcon(android.R.drawable.stat_notify_wifi_in_range)
+ .setSmallIcon(com.android.wifi.resources.R.drawable.stat_notify_wifi_in_range)
.setTicker(title)
.setContentTitle(title)
.setContentText(content)
diff --git a/service/java/com/android/server/wifi/ConnectionFailureNotificationBuilder.java b/service/java/com/android/server/wifi/ConnectionFailureNotificationBuilder.java
index 44ee41288..315d36bdd 100644
--- a/service/java/com/android/server/wifi/ConnectionFailureNotificationBuilder.java
+++ b/service/java/com/android/server/wifi/ConnectionFailureNotificationBuilder.java
@@ -80,7 +80,7 @@ public class ConnectionFailureNotificationBuilder {
return mFrameworkFacade.makeNotificationBuilder(
mContext, WifiService.NOTIFICATION_NETWORK_ALERTS)
- .setSmallIcon(android.R.drawable.stat_notify_wifi_in_range)
+ .setSmallIcon(com.android.wifi.resources.R.drawable.stat_notify_wifi_in_range)
.setTicker(title)
.setContentTitle(title)
.setContentText(content)
diff --git a/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java b/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java
index e507cffa2..d0e6c7e2b 100644
--- a/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java
+++ b/service/java/com/android/server/wifi/WifiNetworkSuggestionsManager.java
@@ -938,7 +938,7 @@ public class WifiNetworkSuggestionsManager {
CharSequence appName = getAppName(packageName, uid);
Notification notification = new Notification.Builder(
mContext, WifiService.NOTIFICATION_NETWORK_STATUS)
- .setSmallIcon(android.R.drawable.stat_notify_wifi_in_range)
+ .setSmallIcon(com.android.wifi.resources.R.drawable.stat_notify_wifi_in_range)
.setTicker(mResources.getString(R.string.wifi_suggestion_title))
.setContentTitle(mResources.getString(R.string.wifi_suggestion_title))
.setStyle(new Notification.BigTextStyle()
diff --git a/service/java/com/android/server/wifi/WifiService.java b/service/java/com/android/server/wifi/WifiService.java
index a6a32bb6e..f27fca075 100644
--- a/service/java/com/android/server/wifi/WifiService.java
+++ b/service/java/com/android/server/wifi/WifiService.java
@@ -85,21 +85,21 @@ public final class WifiService extends SystemService {
final NotificationChannel networkStatusChannel = new NotificationChannel(
NOTIFICATION_NETWORK_STATUS,
ctx.getResources().getString(
- android.R.string.notification_channel_network_status),
+ com.android.wifi.resources.R.string.notification_channel_network_status),
NotificationManager.IMPORTANCE_LOW);
channelsList.add(networkStatusChannel);
final NotificationChannel networkAlertsChannel = new NotificationChannel(
NOTIFICATION_NETWORK_ALERTS,
ctx.getResources().getString(
- android.R.string.notification_channel_network_alerts),
+ com.android.wifi.resources.R.string.notification_channel_network_alerts),
NotificationManager.IMPORTANCE_HIGH);
channelsList.add(networkAlertsChannel);
final NotificationChannel networkAvailable = new NotificationChannel(
NOTIFICATION_NETWORK_AVAILABLE,
ctx.getResources().getString(
- android.R.string.notification_channel_network_available),
+ com.android.wifi.resources.R.string.notification_channel_network_available),
NotificationManager.IMPORTANCE_LOW);
channelsList.add(networkAvailable);
diff --git a/service/java/com/android/server/wifi/WrongPasswordNotifier.java b/service/java/com/android/server/wifi/WrongPasswordNotifier.java
index e13029dbf..ed865d484 100644
--- a/service/java/com/android/server/wifi/WrongPasswordNotifier.java
+++ b/service/java/com/android/server/wifi/WrongPasswordNotifier.java
@@ -85,7 +85,7 @@ public class WrongPasswordNotifier {
.setAutoCancel(true)
.setTimeoutAfter(CANCEL_TIMEOUT_MILLISECONDS)
// TODO(zqiu): consider creating a new icon.
- .setSmallIcon(android.R.drawable.stat_notify_wifi_in_range)
+ .setSmallIcon(com.android.wifi.resources.R.drawable.stat_notify_wifi_in_range)
.setContentTitle(mContext.getString(
com.android.wifi.resources.R.string.wifi_available_title_failed_to_connect))
.setContentText(ssid)
diff --git a/service/res/drawable/stat_notify_wifi_in_range.xml b/service/res/drawable/stat_notify_wifi_in_range.xml
new file mode 100644
index 000000000..a271ca522
--- /dev/null
+++ b/service/res/drawable/stat_notify_wifi_in_range.xml
@@ -0,0 +1,27 @@
+<!--
+Copyright (C) 2014 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="26.0dp"
+ android:height="24.0dp"
+ android:viewportWidth="26.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#4DFFFFFF"
+ android:pathData="M19.1,14l-3.4,0l0,-1.5c0,-1.8 0.8,-2.8 1.5,-3.4C18.1,8.3 19.200001,8 20.6,8c1.2,0 2.3,0.3 3.1,0.8l1.9,-2.3C25.1,6.1 20.299999,2.1 13,2.1S0.9,6.1 0.4,6.5L13,22l0,0l0,0l0,0l0,0l6.5,-8.1L19.1,14z"/>
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M19.5,17.799999c0,-0.8 0.1,-1.3 0.2,-1.6c0.2,-0.3 0.5,-0.7 1.1,-1.2c0.4,-0.4 0.7,-0.8 1,-1.1s0.4,-0.8 0.4,-1.2c0,-0.5 -0.1,-0.9 -0.4,-1.2c-0.3,-0.3 -0.7,-0.4 -1.2,-0.4c-0.4,0 -0.8,0.1 -1.1,0.3c-0.3,0.2 -0.4,0.6 -0.4,1.1l-1.9,0c0,-1 0.3,-1.7 1,-2.2c0.6,-0.5 1.5,-0.8 2.5,-0.8c1.1,0 2,0.3 2.6,0.8c0.6,0.5 0.9,1.3 0.9,2.3c0,0.7 -0.2,1.3 -0.6,1.8c-0.4,0.6 -0.9,1.1 -1.5,1.6c-0.3,0.3 -0.5,0.5 -0.6,0.7c-0.1,0.2 -0.1,0.6 -0.1,1L19.5,17.700001zM21.4,21l-1.9,0l0,-1.8l1.9,0L21.4,21z"/>
+</vector>
diff --git a/service/res/values/overlayable.xml b/service/res/values/overlayable.xml
index 2b4fa71c0..5efa80345 100644
--- a/service/res/values/overlayable.xml
+++ b/service/res/values/overlayable.xml
@@ -140,6 +140,9 @@
<item type="string" name="wifi_disable_mac_randomization_dialog_success" />
<item type="string" name="wifi_disable_mac_randomization_dialog_failure" />
<item type="string" name="wifi_disable_mac_randomization_dialog_network_not_found" />
+ <item type="string" name="notification_channel_network_status" />
+ <item type="string" name="notification_channel_network_alerts" />
+ <item type="string" name="notification_channel_network_available" />
<!-- Params from strings.xml that can be overlayed -->
<!-- Params from styles.xml that can be overlayed -->
diff --git a/service/res/values/strings.xml b/service/res/values/strings.xml
index 69f438a6a..0b61ba348 100644
--- a/service/res/values/strings.xml
+++ b/service/res/values/strings.xml
@@ -43,6 +43,13 @@
<!-- Notification action name for opening the wifi picker, showing the user all the nearby networks. -->
<string name="wifi_available_action_all_networks">All networks</string>
+ <!-- Text shown when viewing channel settings for notifications related to network status -->
+ <string name="notification_channel_network_status">Network status</string>
+ <!-- Text shown when viewing channel settings for notifications related to network alerts -->
+ <string name="notification_channel_network_alerts">Network alerts</string>
+ <!-- Text shown when viewing the channel settings for notification about open nearby wireless networks. -->
+ <string name="notification_channel_network_available">Network available</string>
+
<!-- Notification title for a connection to a app suggested wireless network.-->
<string name="wifi_suggestion_title">Allow suggested Wi\u2011Fi networks?</string>
<!-- Notification content for a connection to a app suggested wireless network.-->