From 6980d12c5864941e68933705c1f15a102ac348cb Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Mon, 15 Jun 2015 10:07:55 -0400 Subject: Make references to ssid use a verbatim TtsSpan Bug: 20059794 Change-Id: Id92ef11e78547e168f55515dea2fc28519871d6f --- .../com/android/settingslib/wifi/AccessPoint.java | 25 +++++++++++++++------- .../com/android/settingslib/wifi/WifiTracker.java | 4 ++-- .../src/com/android/systemui/qs/QSDetailItems.java | 4 ++-- 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'packages') diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java index 3130875..4cef286 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java @@ -16,7 +16,11 @@ package com.android.settingslib.wifi; +import android.app.AppGlobals; import android.content.Context; +import android.content.pm.ApplicationInfo; +import android.content.pm.IPackageManager; +import android.content.pm.PackageManager; import android.net.ConnectivityManager; import android.net.Network; import android.net.NetworkCapabilities; @@ -30,17 +34,15 @@ import android.net.wifi.WifiConfiguration.KeyMgmt; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Bundle; -import android.text.TextUtils; import android.os.RemoteException; import android.os.ServiceManager; +import android.os.UserHandle; +import android.text.Spannable; +import android.text.SpannableString; +import android.text.TextUtils; +import android.text.style.TtsSpan; import android.util.Log; import android.util.LruCache; -import android.content.pm.ApplicationInfo; -import android.content.pm.IPackageManager; -import android.content.pm.PackageManager; -import android.os.UserHandle; -import android.os.RemoteException; -import android.app.AppGlobals; import com.android.settingslib.R; @@ -280,10 +282,17 @@ public class AccessPoint implements Comparable { } } - public String getSsid() { + public String getSsidStr() { return ssid; } + public CharSequence getSsid() { + SpannableString str = new SpannableString(ssid); + str.setSpan(new TtsSpan.VerbatimBuilder(ssid).build(), 0, ssid.length(), + Spannable.SPAN_INCLUSIVE_INCLUSIVE); + return str; + } + public String getConfigName() { if (mConfig != null && mConfig.isPasspoint()) { return mConfig.providerFriendlyName; diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java index 09c93e9..19be4a5 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java @@ -273,7 +273,7 @@ public class WifiTracker { accessPoints.add(accessPoint); if (config.isPasspoint() == false) { - apMap.put(accessPoint.getSsid(), accessPoint); + apMap.put(accessPoint.getSsidStr(), accessPoint); } } else { // If we aren't using saved networks, drop them into the cache so that @@ -321,7 +321,7 @@ public class WifiTracker { } accessPoints.add(accessPoint); - apMap.put(accessPoint.getSsid(), accessPoint); + apMap.put(accessPoint.getSsidStr(), accessPoint); } } } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java index 95ac558..2a44e56 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java @@ -239,8 +239,8 @@ public class QSDetailItems extends FrameLayout { public static class Item { public int icon; public Drawable overlay; - public String line1; - public String line2; + public CharSequence line1; + public CharSequence line2; public Object tag; public boolean canDisconnect; } -- cgit v1.1