Commit Graph

44074 Commits

Author SHA1 Message Date
Doris Ling
70206e6ff2 Fixes crash in security settings.
- save the loaded icon drawable to a local var, instead of setting it to
the tile.icon and later reset it, so that we will not run into the issue
that the icon will become null when this is called multiple times.

Change-Id: I0fc73961986cddd97ad1e74b0609ac47d011cc87
Fixes: 78445923
Test: make RunSettingsRoboTests
2018-04-24 16:54:42 -07:00
Phil Weaver
1979829294 Improve battery saver setting a11y semantics
Adding the ability to override a couple a11y traits
of the Settings version of SeekBarPreference.
Setting semantics for the battery level to report
itself as a percentage. Also tweaking the content
description to use a different title. The title isn't
exactly what I'd like, but it is better than just
saying "At 15% - 15%".

Bug: 74357845
Fixes: 78479637
Test: Used a custom accessibility service to inspect
the information coming from the battery saver seek bar.

Change-Id: I9db55cf0bb3cfee86a46d22c1208262407332d5f
2018-04-24 15:23:38 -07:00
Jason Monk
4913183def Fix settings slice caching
Previously if there were multiple clients it would trigger an infinite
loop as the cache gits dropped after the first bind, and the second
client would trigger another load. Instead now cache as long as slices
are pinned since thats the intended behavior of caching.

Test: make RunSettingsRoboTests
Change-Id: I7d29fab87573120b34cd55e1696c4c5b70fc891c
Fixes: 78471335
2018-04-24 17:08:26 -04:00
Doris Ling
1cf0dfd3b2 Fix Data warning title not translated.
- change to use the title resource id instead of getting the title from
the preference, so that it can react to language change properly.

Change-Id: I7f4b3c49ef1622b3d90bf035597742cac6f7af3c
Fixes: 78318536
Test: run i18nscreenshots
2018-04-24 13:42:19 -07:00
Fan Zhang
1346b066bd Update brightness percentage display logic to match sysui.
The brightness raw value is in linear pace, we need to convert
it to gamma space to make it match the way sysui represents the
brightness level.

Bug: 73810208
Change-Id: Ic4551bbeff4a6af30f7af2871a79a7d797279edb
Fixes: 78173473
Test: robotests
2018-04-24 12:10:46 -07:00
TreeHugger Robot
465f6da15b Merge "Add intent receiver in BatterySaverCondition" into pi-dev 2018-04-24 17:19:52 +00:00
TreeHugger Robot
4a1b84e613 Merge "Switch to new checkPasswordHistory method" into pi-dev 2018-04-24 13:06:57 +00:00
HJ ChangLiao
3b7f08d1ee Add intent receiver in BatterySaverCondition
Receive ACTION_POWER_SAVE_MODE_CHANGING
to listen state and update immediately.

Change-Id: Iff2ebb262d95f43d0c970b32f326e3a3e6981a2a
Fixes: 78104542
Test: make RunSettingsRoboTests
2018-04-24 11:12:29 +08:00
Doris Ling
b0877b390d Fix footer text not translated in Magnification settings.
- pass in the summary res id instead of the actual text when building
the launch bundle for the magnification settings.
- remove the title argument as we are passing the title res already,
which takes precedence.

Change-Id: I4ba624e1d9722aa980ea94c306df9a015a159555
Fixes: 78126057
Test: run i18nscreenshots
2018-04-23 17:07:32 -07:00
Salvador Martinez
be6a844a06 Check if boxes still available when restoring state
Apparently when the device is idle long enough the system will clean
up the dialog view for the hotspot band preference. This will cause
restore state to fail once it decides to pause the activity. To avoid
this we should make sure the boxes are not null.

Test: robotest
Bug: 78445411
Change-Id: I2a82b01f894f62be6c5209c78faddc4089aa6301
2018-04-23 17:07:29 -07:00
Jason Monk
0ef0c367e9 Add auto-granting of slice permissions
Allow things that can read the index to access slices too.

Test: existing tests unaffected
Bug: 77313888
Change-Id: I54c4b89eefb4354aa6b7dcafb7ac09dc96cbdbeb
2018-04-23 18:42:21 -04:00
TreeHugger Robot
ac951a69aa Merge "Disable hidden network spinner on existing networks" into pi-dev 2018-04-23 21:38:55 +00:00
Lei Yu
4bfbaa6047 Update insert method for battery database
1. Add conflict code to ignore the confliction and return -1 when
insert fails.
2. Add boolean return value to show whether insert sucessfully
3. Add unit test. We don't write robo test because robolectirc use
"update" to shadow "insert" operation, which returns the wrong data.

Bug: 77968649
Test: SettingsUnitTest
Change-Id: Ibd3b53cdb1796d74ea4a2ca1f067e2b302b939e9
2018-04-23 13:13:56 -07:00
Lei Yu
0fcddc77c7 Add primary key for anomaly database.
In this case it won't insert the duplicate data. We don't do migration since
anomaly database only contains transient data.

Bug: 77968649
Test: test still pass
Change-Id: I638564d89ead008ec184b9a4db137436d47df5bc
2018-04-23 13:08:33 -07:00
Salvador Martinez
35b76437e0 Disable hidden network spinner on existing networks
We only want this to be modifiable if you are adding a network
manually, so this CL disables it for existing networks. You
can still see what the spinner is set to though.

Test: robotests
Bug: 78436456
Change-Id: If660e432eca2dabf5bd16881368657ee89fe5a57
2018-04-23 10:50:22 -07:00
Lei Yu
69c370f594 Don't show high usage tip when device is charing
The summary is "Battery may run out soon", it doesn't make sense
when device is charging.

Change-Id: I27394c8a75dac4dcad171e5e215102d39cb33546
Fixes: 78261389
Test: RunSettingsRoboTests
2018-04-23 10:10:20 -07:00
Lei Yu
f6e2c19fcc Merge "Fix bugs in auto restriction." into pi-dev 2018-04-23 17:03:39 +00:00
Lei Yu
10280a53b0 Merge "Fix the bug using wrong TimeUnit" into pi-dev 2018-04-23 16:59:47 +00:00
TreeHugger Robot
bb839f81e3 Merge "Pick default notification setting for work profile" into pi-dev 2018-04-23 16:38:43 +00:00
TreeHugger Robot
77e716e463 Merge "Import translations. DO NOT MERGE" into pi-dev 2018-04-21 05:09:44 +00:00
TreeHugger Robot
524babb389 Merge "Catch exception when failing to create slice" into pi-dev 2018-04-21 02:03:49 +00:00
Fan Zhang
0e5a3273af Catch exception when failing to create slice
- Created a non-generic exception type when failing SliceData.build()
- Catch exception and log error instead of crash.
- Added a presubmit test

Fixes: 78347031
Test: robotests, atest
Change-Id: I06e528cb5e1cd328f82f9561553f3c4b5b0bed26
Merged-In: I06e528cb5e1cd328f82f9561553f3c4b5b0bed26
2018-04-20 23:55:39 +00:00
Lei Yu
4c94926ba5 Fix the bug using wrong TimeUnit
It should use DAYS, not HOURS.

Change-Id: I26784822c86e58cad93d35b6772ea54af7efb8f5
Fixes: 78362305
Test: RunSettingsRoboTests
2018-04-20 16:45:02 -07:00
TreeHugger Robot
2f911e2e9e Merge "Add keywords to Slices" into pi-dev 2018-04-20 23:30:18 +00:00
Salvador Martinez
681353f725 Merge "Update settings main page battery string" into pi-dev 2018-04-20 23:27:25 +00:00
Matthew Fritze
47a44e8fa4 Add keywords to Slices
Attach the keywords used for Settings search to Slices.
Their primary use is helping match synonyms for presenters
which display slices without explicit Uri requests, like a launcher.

This changes:
- Updates database scheme
- Adds to SliceData object
- Grab keywords in the SliceDataConverter
- Set keywords on all slices

Test: robotests
Change-Id: I16c40d2380ffddaf0a87fb1b9cd58e95573b308f
Fixes: 78306195
2018-04-20 14:50:55 -07:00
Jeff Sharkey
b9a1ebcb45 Increase volume search timeout, fix dialog flow.
Slower devices can take longer to process kernel events, so try up
to 25 times (~6 seconds) to find the volume after the partitioning
is finished.

Fix bug where we'd finish() while trying to show the format
confirmation dialog, meaning users couldn't format corrupted
non-primary volumes.

Bug: 74129968, 77849654, 74132243
Test: atest com.android.settings.ui.StorageWizardTest
Change-Id: I91144051cb6de0cd944d93b03dc5127676e24be8
2018-04-20 14:34:31 -06:00
Lei Yu
252d4e1fc0 Fix bugs in auto restriction.
1. Dismiss this tip once user clicks it and goes to detail page.
2. In auto restriction, since apps are automatically restricted,
we need to remove apps in list that unrestricted by user.
3. Refactor the code to remove the unnecessary parameter(i.e.
SettingsActivity)

Bug: 78187414
Test: RunSettingsRoboTests
Change-Id: I1c950f7c55df35795641c2ea8579ce9e011dba28
2018-04-20 12:55:53 -07:00
Bill Yi
4bcbd46e0d Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I93f8c6f0051cf15e218d1c761c300c7e16109165
2018-04-20 10:37:50 -07:00
Julia Reynolds
5766d6e443 Collapse notification advanced settings
Leave footers visible outside of advanced

Test: visual inspection
Fixes: 77324998
Fixes: 38011858
Change-Id: I2d6fcb832b134bc97081f03a3ab38d593e943f76
2018-04-20 13:24:45 -04:00
Rubin Xu
c33e2a1cef Switch to new checkPasswordHistory method
This is part of the fix that upgrades the hashing of password history
to a more secure design.

Bug: 32826058
Test: manual
Change-Id: Ib022c8db1f7b63f75b69d0177fa5f6be528a83c5
2018-04-20 18:09:59 +01:00
Pavel Grafov
c29b984a98 Pick default notification setting for work profile
Managed profiles cannot completely hide notifications, so
this setting should be treated as always "true" for them.

Change-Id: I9808c1e9736d83efccb0e947d9097379bda59ebb
Fixes: 78194020
Test: atest RedactionInterstitialTest
2018-04-20 16:29:37 +01:00
Julia Reynolds
3bdd65e255 Merge "Fix crash on rotation" into pi-dev 2018-04-20 13:30:28 +00:00
TreeHugger Robot
ff2653a0d8 Merge "Update Slice APIs to current versions" into pi-dev 2018-04-20 03:11:14 +00:00
TreeHugger Robot
96d4cd3c61 Merge "Make WifiTether listen to datasaver" into pi-dev 2018-04-20 02:57:04 +00:00
Salvador Martinez
7ba65c39ae Make WifiTether listen to datasaver
Wifi Tethering is already turned off when appropriate. However
if you re-enable it you still can't toggle the tether switchbar.
This CL makes it so that if you disable data saver the toggle
becomes enabled again.

Test: robotests
Bug: 77860936
Change-Id: I03fa74c21674678a90cde7bd20fa68167f02ae3c
2018-04-20 02:56:47 +00:00
TreeHugger Robot
be22830fde Merge "Fix Network details title not being translated." into pi-dev 2018-04-20 00:50:34 +00:00
TreeHugger Robot
21a34488ba Merge "Fix limit data usage dialog body not being translated." into pi-dev 2018-04-20 00:43:58 +00:00
TreeHugger Robot
35d1d43bb3 Merge "Adjust comment on data over usage string." into pi-dev 2018-04-20 00:36:43 +00:00
Matthew Fritze
f9f72e8c2c Update Slice APIs to current versions
Change-Id: Icf40673e518534487be77f33427df937717735e5
Fixes: 77982356
Test: robotests
2018-04-19 17:29:18 -07:00
TreeHugger Robot
3fff843e57 Merge "Fix App data usage title not being translated." into pi-dev 2018-04-20 00:18:27 +00:00
TreeHugger Robot
d9abb0e914 Merge "Update Wifi Tether band selection UI" into pi-dev 2018-04-20 00:15:45 +00:00
Fan Zhang
0468f68c02 Merge "Format number to local locale." into pi-dev 2018-04-20 00:01:01 +00:00
Doris Ling
dad557305e Fix Network details title not being translated.
- use the title resource id instead of the actual string in the launch
intent so that it can react to language change.

Change-Id: I424dc026a9298d12627c05f97f27e9d4cba5a341
Fixes: 77896130
Test: run i18nscreenshots
2018-04-19 16:49:35 -07:00
Doris Ling
689bb2c27c Fix limit data usage dialog body not being translated.
- need to pass the resource id instead of the text when building the
dialog in order for it to react to language change.
- also remove the unnecessary set/get the body message in the dialog
creation since the msg id can be used directly.

Change-Id: I399dcda54961fac457fc5f0fad9082f2c1e1a2b2
Fixes: 77897157
Test: run i18nscreenshots
2018-04-19 16:35:28 -07:00
Sundeep Ghuman
201d6ffcdb Adjust comment on data over usage string.
Bug: 75981328
Test: NA
Change-Id: I393ab6637d563a34e9cea2da2b9c29e32efb056f
2018-04-19 16:20:30 -07:00
Doris Ling
6784296248 Fix App data usage title not being translated.
- we need to pass the title resource id instead of the actual text in
the launch intent in order for it react to language change properly.

Change-Id: I72ccbe67411c9f4da328dd24671f4e71ab927851
Fixes: 77898325
Test: run i18nscreenshots
2018-04-19 16:09:58 -07:00
Fan Zhang
040df90c50 Format number to local locale.
Change-Id: Iffa91eb8c40f09e5ac4cce10f355e348e62d8fce
Fixes: 78134172
Test: robotests
2018-04-19 15:54:39 -07:00
Salvador Martinez
10ba9c1786 Update Wifi Tether band selection UI
This CL updates the preference for selecting the enabled tether bands
to allow individual selection of multiple bands instead of forcing
a single selection. Note that while this makes the UI theoretically
support new bands in the future, the wifi backend only supports
selecting a single band or all bands which this CL does not address.

Test: robotests
Bug: 73102003
Change-Id: Ib2d4a2834c5cd11875515d308f7b20bfc8471959
2018-04-19 13:37:09 -07:00
Salvador Martinez
dbe38b09cf Merge "Fix restricted fragment dialogs" into pi-dev 2018-04-19 20:09:08 +00:00