Merge "Change the icon for the LOGGED_IN notification." into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
38254b8bd7
@@ -19,7 +19,6 @@ package com.android.server.connectivity;
|
|||||||
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
|
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
|
||||||
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
|
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
|
||||||
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
|
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
|
||||||
import static android.telephony.SubscriptionManager.DEFAULT_SUBSCRIPTION_ID;
|
|
||||||
|
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
@@ -107,10 +106,14 @@ public class NetworkNotificationManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getIcon(int transportType) {
|
private static int getIcon(int transportType, NotificationType notifyType) {
|
||||||
return (transportType == TRANSPORT_WIFI) ?
|
if (transportType != TRANSPORT_WIFI) {
|
||||||
R.drawable.stat_notify_wifi_in_range : // TODO: Distinguish ! from ?.
|
return R.drawable.stat_notify_rssi_in_range;
|
||||||
R.drawable.stat_notify_rssi_in_range;
|
}
|
||||||
|
|
||||||
|
return notifyType == NotificationType.LOGGED_IN
|
||||||
|
? R.drawable.ic_wifi_signal_4
|
||||||
|
: R.drawable.stat_notify_wifi_in_range; // TODO: Distinguish ! from ?.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,6 +130,7 @@ public class NetworkNotificationManager {
|
|||||||
* @param id an identifier that uniquely identifies this notification. This must match
|
* @param id an identifier that uniquely identifies this notification. This must match
|
||||||
* between show and hide calls. We use the NetID value but for legacy callers
|
* between show and hide calls. We use the NetID value but for legacy callers
|
||||||
* we concatenate the range of types with the range of NetIDs.
|
* we concatenate the range of types with the range of NetIDs.
|
||||||
|
* @param notifyType the type of the notification.
|
||||||
* @param nai the network with which the notification is associated. For a SIGN_IN, NO_INTERNET,
|
* @param nai the network with which the notification is associated. For a SIGN_IN, NO_INTERNET,
|
||||||
* or LOST_INTERNET notification, this is the network we're connecting to. For a
|
* or LOST_INTERNET notification, this is the network we're connecting to. For a
|
||||||
* NETWORK_SWITCH notification it's the network that we switched from. When this network
|
* NETWORK_SWITCH notification it's the network that we switched from. When this network
|
||||||
@@ -173,7 +177,7 @@ public class NetworkNotificationManager {
|
|||||||
Resources r = Resources.getSystem();
|
Resources r = Resources.getSystem();
|
||||||
CharSequence title;
|
CharSequence title;
|
||||||
CharSequence details;
|
CharSequence details;
|
||||||
int icon = getIcon(transportType);
|
int icon = getIcon(transportType, notifyType);
|
||||||
if (notifyType == NotificationType.NO_INTERNET && transportType == TRANSPORT_WIFI) {
|
if (notifyType == NotificationType.NO_INTERNET && transportType == TRANSPORT_WIFI) {
|
||||||
title = r.getString(R.string.wifi_no_internet,
|
title = r.getString(R.string.wifi_no_internet,
|
||||||
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
|
WifiInfo.removeDoubleQuotes(nai.networkCapabilities.getSSID()));
|
||||||
|
|||||||
Reference in New Issue
Block a user