diff options
Diffstat (limited to 'packages/SettingsLib/src')
7 files changed, 37 insertions, 25 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java index 4b4861a01898..59d8acb82196 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java @@ -298,18 +298,12 @@ public class BluetoothEventManager { CachedBluetoothDevice cachedDevice = mDeviceManager.findDevice(device); if (cachedDevice == null) { cachedDevice = mDeviceManager.addDevice(device); - Log.d(TAG, "DeviceFoundHandler created new CachedBluetoothDevice: " - + cachedDevice); + Log.d(TAG, "DeviceFoundHandler created new CachedBluetoothDevice"); } else if (cachedDevice.getBondState() == BluetoothDevice.BOND_BONDED && !cachedDevice.getDevice().isConnected()) { // Dispatch device add callback to show bonded but // not connected devices in discovery mode dispatchDeviceAdded(cachedDevice); - Log.d(TAG, "DeviceFoundHandler found bonded and not connected device:" - + cachedDevice); - } else { - Log.d(TAG, "DeviceFoundHandler found existing CachedBluetoothDevice:" - + cachedDevice); } cachedDevice.setRssi(rssi); cachedDevice.setJustDiscovered(true); diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index db219c9ce74e..4c80b91f300d 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -151,8 +151,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> void onProfileStateChanged(LocalBluetoothProfile profile, int newProfileState) { if (BluetoothUtils.D) { - Log.d(TAG, "onProfileStateChanged: profile " + profile + ", device=" + mDevice - + ", newProfileState " + newProfileState); + Log.d(TAG, "onProfileStateChanged: profile " + profile + ", device " + + mDevice.getAlias() + ", newProfileState " + newProfileState); } if (mLocalAdapter.getState() == BluetoothAdapter.STATE_TURNING_OFF) { @@ -290,9 +290,6 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } public void setHiSyncId(long id) { - if (BluetoothUtils.D) { - Log.d(TAG, "setHiSyncId: mDevice " + mDevice + ", id " + id); - } mHiSyncId = id; } @@ -638,7 +635,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } if (BluetoothUtils.D) { - Log.e(TAG, "updating profiles for " + mDevice.getAlias() + ", " + mDevice); + Log.d(TAG, "updating profiles for " + mDevice.getAlias()); BluetoothClass bluetoothClass = mDevice.getBluetoothClass(); if (bluetoothClass != null) Log.v(TAG, "Class: " + bluetoothClass.toString()); @@ -688,8 +685,8 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> * If a connect was attempted earlier without any UUID, we will do the connect now. * Otherwise, allow the connect on UUID change. */ - if (!mProfiles.isEmpty() - && ((mConnectAttempted + timeout) > SystemClock.elapsedRealtime())) { + if ((mConnectAttempted + timeout) > SystemClock.elapsedRealtime()) { + Log.d(TAG, "onUuidChanged: triggering connectAllEnabledProfiles"); connectAllEnabledProfiles(); } diff --git a/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java b/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java index d48aa246ecba..e5fd0ba5d9bc 100644 --- a/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java +++ b/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java @@ -32,12 +32,11 @@ import androidx.annotation.VisibleForTesting; import androidx.core.text.BidiFormatter; import androidx.core.text.TextDirectionHeuristicsCompat; +import com.android.i18n.timezone.CountryTimeZones; +import com.android.i18n.timezone.CountryTimeZones.TimeZoneMapping; +import com.android.i18n.timezone.TimeZoneFinder; import com.android.settingslib.R; -import libcore.timezone.CountryTimeZones; -import libcore.timezone.CountryTimeZones.TimeZoneMapping; -import libcore.timezone.TimeZoneFinder; - import org.xmlpull.v1.XmlPullParserException; import java.util.ArrayList; @@ -242,7 +241,16 @@ public class ZoneGetter { final TimeZoneNames.NameType nameType = tz.inDaylightTime(now) ? TimeZoneNames.NameType.LONG_DAYLIGHT : TimeZoneNames.NameType.LONG_STANDARD; - return names.getDisplayName(tz.getID(), nameType, now.getTime()); + return names.getDisplayName(getCanonicalZoneId(tz), nameType, now.getTime()); + } + + private static String getCanonicalZoneId(TimeZone timeZone) { + final String id = timeZone.getID(); + final String canonicalId = android.icu.util.TimeZone.getCanonicalID(id); + if (canonicalId != null) { + return canonicalId; + } + return id; } private static void appendWithTtsSpan(SpannableStringBuilder builder, CharSequence content, diff --git a/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlLoaderCompat.java b/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlLoaderCompat.java index ac7a12187fd6..121f5492a5ab 100644 --- a/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlLoaderCompat.java +++ b/packages/SettingsLib/src/com/android/settingslib/license/LicenseHtmlLoaderCompat.java @@ -38,7 +38,10 @@ public class LicenseHtmlLoaderCompat extends AsyncLoaderCompat<File> { "/odm/etc/NOTICE.xml.gz", "/oem/etc/NOTICE.xml.gz", "/product/etc/NOTICE.xml.gz", - "/system_ext/etc/NOTICE.xml.gz"}; + "/system_ext/etc/NOTICE.xml.gz", + "/vendor_dlkm/etc/NOTICE.xml.gz", + "/odm_dlkm/etc/NOTICE.xml.gz", + }; static final String NOTICE_HTML_FILE_NAME = "NOTICE.html"; private final Context mContext; diff --git a/packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java b/packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java index 246f2ceac87c..e1174fa05ea5 100644 --- a/packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java +++ b/packages/SettingsLib/src/com/android/settingslib/net/SignalStrengthUtil.java @@ -17,7 +17,8 @@ package com.android.settingslib.net; import android.content.Context; -import android.telephony.SubscriptionManager; +import android.os.PersistableBundle; +import android.telephony.CarrierConfigManager; /** * Utilities for dealing with signal strength. @@ -28,7 +29,13 @@ public class SignalStrengthUtil { * bar for the subscription with the given id */ public static boolean shouldInflateSignalStrength(Context context, int subscriptionId) { - return SubscriptionManager.getResourcesForSubId(context, subscriptionId) - .getBoolean(com.android.internal.R.bool.config_inflateSignalStrength); + final CarrierConfigManager carrierConfigMgr = + context.getSystemService(CarrierConfigManager.class); + PersistableBundle bundle = null; + if (carrierConfigMgr != null) { + bundle = carrierConfigMgr.getConfigForSubId(subscriptionId); + } + return (bundle != null && bundle.getBoolean( + CarrierConfigManager.KEY_INFLATE_SIGNAL_STRENGTH_BOOL, false)); } } diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java index e77d1a2ccea1..bc58bfc97718 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java @@ -216,6 +216,9 @@ public class WifiStatusTracker { } private void updateStatusLabel() { + if (mWifiManager == null) { + return; + } NetworkCapabilities networkCapabilities; isDefaultNetwork = false; if (mDefaultNetworkCapabilities != null) { diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java index 3015397ff1a3..bf5ab1c9951a 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java @@ -256,7 +256,7 @@ public class WifiTracker implements LifecycleObserver, OnStart, OnStop, OnDestro } /** - * Sanity warning: this wipes out mScoreCache, so use with extreme caution + * Validity warning: this wipes out mScoreCache, so use with extreme caution * @param workThread substitute Handler thread, for testing purposes only */ @VisibleForTesting |