summaryrefslogtreecommitdiff
path: root/packages/SettingsLib/src/com/android/settingslib/Utils.java
AgeCommit message (Collapse)Author
2021-04-23Merge SP1A.210412.001Scott Lobdell
Change-Id: I0e1c2f5679d5f721cd605b7da785959763311698
2021-04-08Support wireless charge stateWesley.CW Wang
- Add new condition for wireless charging, make getBatteryStatus can return wireless charging state Bug: 177407113 Test: make SettingsLibRoboTests Change-Id: I9c02f8108baa7fe4fa96e85ce1e6efadb87a47b4
2021-04-02Merge SP1A.210329.001Scott Lobdell
Change-Id: I1e21c5890b5b2e2f2855f09960bc8eec8aa922bf
2021-03-24Merge SP1A.210311.001Scott Lobdell
Change-Id: Id1a205bf3f0609c0b13e4bea377056c3b06299fa
2021-03-17Replace hidden CM#isNetworkSupported() usageChiachang Wang
It's a refactor work for connectivity mainline module. The hidden methods access is no longer allowed, so the usage for isNetworkSupported() should be replaced. Settingslib use it to check if device support telephony service. Use alternative method to check if device supports such feature. Bug: 172183305 Test: make RunSettingsLibRoboTests Change-Id: I713c6410fcf9543d54d9b0057ed7b2ecdab201ee
2021-03-08Replace ConnectivityManager hidden symbols on SettingsLibpaulhu
Connectivity is becoming a mainline module in S, so ConnectivityManager hidden symbols can not be used for outside components. Besides, most Tethering relevant methods or variables on CM are migrated to TetheringManager. So replace all these methods or variables from ConnectivityManager to TetheringManager on SettingsLib. Bug: 180693313 Test: atest SettingsLibRoboTests Change-Id: I11e317ed0d3aab2628082bbe6b8292fec82109a9
2021-03-03Revert "resolve merge conflicts of a8ebd89cdb11dbedfff2a55346f936ff9c9f5259 ↵Paul Hu
to sc-dev" This reverts commit 03f060702a8d064f6fa9b2f79de56eea2dc61fdd. Reason for revert: Build break commit has been reverted. Change-Id: Ie80a4173e92709a2ab75c6c2174adacf58c2f776
2021-03-03resolve merge conflicts of a8ebd89cdb11dbedfff2a55346f936ff9c9f5259 to sc-devBonian Chen
Bug: 180693313 Test: build pass Change-Id: I77a4d189e3ac067cdc8dd01f2031920011bb3ec1
2021-03-03Merge "Replace ConnectivityManager hidden symbols on SettingsLib" am: 56b1b24940Paul Hu
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1601533 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I5a2fd69d93e6e4464291adb62944ac3bf38c39da
2021-02-23Replace ConnectivityManager hidden symbols on SettingsLibpaulhu
Connectivity is becoming a mainline module in S, so ConnectivityManager hidden symbols can not be used for outside components. Besides, most Tethering relevant methods or variables on CM are migrated to TetheringManager. So replace all these methods or variables from ConnectivityManager to TetheringManager on SettingsLib. Bug: 180693313 Test: atest SettingsLibRoboTests Change-Id: I7ec35dc1d0ff106d7b8b77d23c8e925e717bd69c
2021-02-17Merge SP1A.210208.001Daniel Norman
Change-Id: I7d4929024872b369444e276a60ded06e37b1fefb
2021-01-25Support VCN in SysUIyinxu
Bug: 175739479 Test: atest NetworkControllerWifiTest Change-Id: I48caeac0e1f0a99c5848ec9cdf70a5830a700be0
2020-12-02Add image utility methodstimhypeng
-Add convertCornerRadiusBitmap to edit bitmap cornor -Add createIconWithDrawable to create icon from bitmap Bug: 155822415 Test: manual test Merged-In: Idb770ce5f3b9aaa1288538aa1e51ffc0d9f34a6e Change-Id: Idb770ce5f3b9aaa1288538aa1e51ffc0d9f34a6e (cherry picked from commit 37017a739c885ffd4aa450a4605dbeaaa2e4f7f3)
2020-11-13Merge SP1A.201105.002Scott Lobdell
Change-Id: Iec83a0c1f6f286a1e51abfc4356633ca9d8aea5f
2020-10-28Default dual tone alpha set to 0.3Evan Laird
In the event where a user of ThemedBatteryDrawable does not set the foreground / background colors explicitly, but rather uses a color filter, just set a default alpha for the background paint. Test: manual; set theme to any dualtone icon pack and visit settings battery page Bug: 162901879 Change-Id: If9becd40fbebeba15f3714e012623d3da61a7efe
2020-10-26Default dual tone alpha set to 0.3Evan Laird
In the event where a user of ThemedBatteryDrawable does not set the foreground / background colors explicitly, but rather uses a color filter, just set a default alpha for the background paint. Test: manual; set theme to any dualtone icon pack and visit settings battery page Bug: 162901879 Change-Id: If9becd40fbebeba15f3714e012623d3da61a7efe
2020-10-09Add overload for getWifiIconResourceScott Lobdell
Add overload for getWifiIconResource to match SP1A.200921.001 changes in packages/apps/Settings/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java Bug: 170343971 Change-Id: Ibd30324dd3c72e57123fc7bc921f935859877984
2020-10-09Merge SP1A.200921.001Scott Lobdell
Change-Id: I6a8d7215f874fed05e9fec71b17c8a3d1e2c94e0
2020-09-02Merge "Add image utility methods"tim peng
2020-09-01Add image utility methodstimhypeng
-Add convertCornerRadiusBitmap to edit bitmap cornor -Add createIconWithDrawable to create icon from bitmap Bug: 155822415 Test: manual test Change-Id: Idb770ce5f3b9aaa1288538aa1e51ffc0d9f34a6e
2020-08-23[Wi-Fi] Show Pie+x Wi-Fi icon when a connected Wi-Fi is not default routeArc Wang
From Android 11, a connected Wi-Fi network may not be default route if rating provider thinks it has bad connection quality. Framework service will keep the Wi-Fi connection but uses other connection as default route. This change shows Pie+x Wi-Fi icon for a connected Wi-Fi network which is not default route. Bug: 163627176 Test: make RunSettingsLibRoboTests ROBOTEST_FILTER=WifiEntryPreferenceTest make RunSettingsLibRoboTests ROBOTEST_FILTER=com.android.settingslib.UtilsTest Change-Id: Ia9c98db59a5eb61ae22a5e9249d1219443876e16
2020-05-07Merge RP1A.200507.001Steven Laver
Change-Id: Ibc2625f46b3cd6f9c8467efaed57803f6786e3d8
2020-05-02Use adaptive icon in SettingsTracy Zhou
Fixed the usage of icons in the following pages - apps info page (https://screenshot.googleplex.com/RLyDQ1PcO7X) - accounts page (https://screenshot.googleplex.com/VjY87JxrKqZ) Bug: 130916962 Test: Manual Change-Id: I3720fab1ce56505c85a175a8f4c550f6f465f507
2020-04-28Merge RP1A.200428.001Steven Laver
Change-Id: Ib91d14aa3fcaa1627e3a5ebcd12ef2db407dac8d
2020-04-27Update one-line layout for conversation notifsSteve Elliott
Fixes: 152770837 Test: manual, visual Change-Id: I8433d5e26be4e6fe0c16acc87b29bac334011cbf
2020-04-22wifi: refactor Wi-Fi generation UI enhancementsVeerendranath Jakkam
- Use WifiInfo.getWifiStandard API to get active connection capability - Use ScanResult.getWifiStandard API to get capability of a BSS - Consider active connection is 11ax ready capable when connection is 8SS capable and AP is HE capable - Consider a BSS is 11ax ready capable when device is 8SS capable and AP is 8SS and HE capable - Add support for Wi-Fi generation UI enhancements in WiFitrackerLib - Remove deprecated legacy code Change-Id: I77605cfb835a799d4851d5a6c15942c94e66cbc6 CRs-Fixed: 2654326, 2627712
2020-02-18Merge RP1A.200214.001Steven Laver
Change-Id: Id5ee82843b287332c41409e587bbdd33b5872ecd
2020-02-07Merge "Show charging speed in Settings"Raff Tsai
2020-02-06Create a util method to get icon badged.Tsung-Mao Fang
In order to prevent DoS attack from icon size, we're usinga system lib to help convert any loaded drawable into a flattened bitmap with an appropriate size. Test: Rebuild Bug: 33646131 Change-Id: I92e76fb4e4c23c4995f63ebd2df8cbe0a349fbce
2020-01-22Merge RP1A.200106.001Steven Laver
Change-Id: I321486af27bd4665b73da2c51d88e293b54f3a4c
2019-12-27Show charging speed in SettingsRaff Tsai
- Move BatteryStatus from KeyguardUpdateMonitor to SettingsLib which can be used in Settings and SystemUI - Add string to support show rapid and slow charging in Settings - Move config from res-keyguard to SettingsLib Fixes: 79559900 Fixes: 66573773 Test: manual, make RunSettingsLibRoboTests Change-Id: I2ffd902743819f999ee3a10bbadc2d3ca45495c2
2019-12-23mainline:Replace serviceState.getDataRegState and getVoiceRegStateSongFerngWang
Replace serviceState.getVoiceRegState with getState Replace serviceState.getDataRegState with getDataRegistrationState Bug: 146637978 Test: atest NetworkControllerBaseTest (PASS) atest CarrierTextControllerTest (PASS) Change-Id: I0cbdfd5d3de3a78326703ede1640f01430bae18a
2019-12-18[Mainline] decouple ServiceState.getDataNetworkType()SongFerngWang
Use NetworkRegistrationInfo.getRegistrationState() to replace serviceState.getDataNetworkType() inside getCombinedServiceState Bug: 146473838 Test: atest frameworks/base/packages/SettingsLib/tests/robotests/\ src/com/android/settingslib/UtilsTest.java (PASS) Change-Id: Iddf23778be5d275c76ad01bfbac8f4ed0c655331
2019-10-14Overload getWifiIconResource().Chris Gross
getWifiIconResource() has been modified to include two extra parameters from upstream. New unmodified upstream code in WifiEntryPreference.java does not have the required information to call the modified getWifiIconResource method. This change instead overloads the getWifiIconResource method to also accept a single parameter as it does upstream. Bug: 142554997 Change-Id: I38494a0e973048fdf6265c7ed47901ec845118fd
2019-09-27Merge RP1A.190822.001Scott Lobdell
Change-Id: I515dc97a1060fccf4c2fd8f678f8f90753aa1289
2019-07-19Remove obsolete constants.Soonil Nagarkar
These constants are not in use anywhere. Test: na Bug: 137675020 Change-Id: I9f1b2101b75779ff2f9c5f9d945189eccff782ae
2019-07-18Fix Disabled text color in dark themeRaff Tsai
disabled_text_color is similar to background color in dark theme. Use text color multiply disabledAlpha to get disabled text color. Fixes: 137639665 Test: manual Change-Id: I00bb1dbedd0032001c2fc325b412dacb08f84132
2019-04-03wifi: Wifi generation and WPA3 UI enhancements for Access points.Veerendranath Jakkam
Display Wifi generation in wifi signal strength. Revert OWE and SAE icon UI changes and display WPA3 AKM(OWE/SAE) type in Access point summary text. CRs-Fixed: 2415360 Change-Id: I2ebdde69f59b9d5d8bfcbd313b0d7e3b271c28f0
2019-01-31Remove dead codeSoonil Nagarkar
Bug: 118883513 Test: manually Change-Id: I0bbdfac91cbe26d08445178b5690c2e9171a39c8
2019-01-11Use the correct Smart Storage flag in SettingsLib.Daniel Nishi
Previously, the show_opt_in and enabled flags were conflated to basically mean the same thing. Because we are now distinctly making show_opt_in refer to showing a toggle to opt into the feature in SUW and enabled to mean the default enabled status, we need to change the utility method for querying the default enabled status. Bug: 122461924 Test: RunSettingsLibRoboTests Change-Id: I9802d307597d90514e7dc6631998daa1d2fab253
2019-01-08Exclude IWLAN network type from isInService checkEvan Laird
The current behavior of MobileNetworkController is to consider the device in service if we have an out_of_service service state, but an in_service data reg state. This is to handle "data only" SIM cards. This change excludes IWLAN network types from this behavior because that is the state of wifi calling and shouldn't cause the device to report cell service. Change-Id: I408fe282ebeb00425776b745abee0468ac0567c9 Fixes: 111958683 Test: atest com.android.settingslib.UtilsTest#isInService_voiceOutOfServiceDataOutOfService_returnFalse
2018-08-24Refactor SystemUI and add function in settingslib for service stateSongFerngWang
To make behavior consistent in the long run and refactor the code into settingslib and call it from both Settings and SystemUI. Bug: 110973964 Test: run testcase as below: 1. frameworks/base/packages/SettingsLib: -> ALL PASS make RunSettingsLibRoboTests -j40 2. frameworks/base/packages/SystemUI: -> ALL PASS atest frameworks/base/packages/SystemUI/tests/src/com/android/systemui /statusbar/policy/NetworkControllerSignalTest.java Change-Id: Ie8899dd5398a503b861557c222bbd93bd2049d10
2018-05-21Merge "[SettingsLib] Update Utils.getColorAccent() and Utils.getColorError() ↵TreeHugger Robot
to return ColorStateLists instead of colors."
2018-05-16[SettingsLib] Update Utils.getColorAccent() and Utils.getColorError() to ↵Jason Chang
return ColorStateLists instead of colors. Update Utils.getColorAccent() and Utils.getColorError() to return ColorStateLists instead of colors and change every callers entry. Bug: 78215054 Test: manually test for UI Change-Id: I830222a14ef81b2456dd89c9f8631b5fd36f12ff
2018-04-30Add isAudioModeOngoingCall function to check call status am: 1b25c9a89ctimhypeng
am: 7128338376 Change-Id: Id3e7a22c73dfa2285dd87ccbb7770b084a9ee5e3
2018-04-30Add isAudioModeOngoingCall function to check call statustimhypeng
*return true if it is in ringing/call/communication(VoIP) status Bug: 78318415 Test: make -j50 RunSettingsLibRoboTests Change-Id: Ifb84da386fcd5bf03eaccf78fc264fbad86a9707
2018-04-27Remove wrapper for LocationManagerhjchangliao
Remove LocationManagerWrapper from SettingsLib Bug: 76167422 Test: RunSettingsLibRoboTests Change-Id: I5c50c88175d807d0758b2dc6b4992435df493408
2018-04-11[SettingsLib] Update Utils APIs usageJason Chang
Update Utils.getColorAttr and similar methods in Utils to return a ColorStateList instead of a color Bug: 74872054 Test: Force to display different color items then manually test Change-Id: I92697a597b532ba95f29a886baa114ed6d0ac632
2018-03-12Use the correct drawable to badge user iconTony Mak
Also, ic_corp_user_badge is now tinted by default color, insteaad on white by default. Test: Create managed user, observe the icon is now blue on white. Test: Wifi data usage, observe the icon of "All work apps" are now grey instead of white. FIXES: 71568987 Merged-In:Ic6c8ed15644c6e7894f2a84320077a3962603b5b Change-Id: Ic6c8ed15644c6e7894f2a84320077a3962603b5b
2018-03-06Use the correct drawable to badge user iconTony Mak
Also, ic_corp_user_badge is now tinted by default color, insteaad on white by default. Test: Create managed user, observe the icon is now blue on white. Test: Wifi data usage, observe the icon of "All work apps" are now grey instead of white. Change-Id: Ic6c8ed15644c6e7894f2a84320077a3962603b5b