Commit Graph

3153 Commits

Author SHA1 Message Date
Matthew Fritze
bdc8fe6da9 Separate collection of indexable data from indexing
The first step in refactoring the god class,
DatabaseIndexingManager.

The class has one major entry point: indexDatabase
which begins a chain of calls that first collects all the
data from the fragments, and then massages that data into
the SQLite database. Unfortunately, most of the methods
do not return data, and just pass along some mutated
form of the data until it can be insterted.

Reading and testing this class is very difficult.

This first step moves the collection of the indexable data
into a new class which has a few benefits:
- The data can be easily mocked in tests
- Reduces complexity of D.I.M.
- Separates data collection from indexing, which allows the
indexable data to be piped into a new API that unbundled
search can consume.

Bug:33577327
Test: make RunSettingsRoboTests
Test: Grabbed a DB dump before change, compared to DB dump after change
to make sure everything is still indexed.
Change-Id: Ibc91e3d75ff5dcf5274b93b29bf3544f90b2194d
2017-09-07 08:53:41 -07:00
Daniel Nishi
ab5e8ce249 Merge "Cache storage values for fast loading." into oc-mr1-dev am: 7fae6c67fb
am: cad295918c

Change-Id: I42136185af82217383526a38c8c3a4ffc2e4829e
2017-09-07 15:35:03 +00:00
Daniel Nishi
cad295918c Merge "Cache storage values for fast loading." into oc-mr1-dev
am: 7fae6c67fb

Change-Id: I5e29852872dd08e0e5bb3f1822127879dc354319
2017-09-07 15:15:16 +00:00
Ajay Nadathur
ab07989b97 Set title in remote views if present in bundle
- Title set if defined in the Bundle returned by summaryUri's content
provider.
- summaryUri invoked inline with onBindView call

bug: 62713030
Test: Manually tested, verified that title and summary are retrieved
when settings app is resumed
Change-Id: Id82531eec5ec11ec3492f033fb34ec65a5437a48
2017-09-07 14:56:38 +00:00
Daniel Nishi
7fae6c67fb Merge "Cache storage values for fast loading." into oc-mr1-dev 2017-09-06 23:07:14 +00:00
Fan Zhang
6d5a277622 Merge "Misc polishing fixes for Settings" into oc-mr1-dev am: bda6500884
am: 08c4871dbe

Change-Id: Ib01d65ae56ac7f03f25ca320724ba6b3cd90b861
2017-09-06 22:54:09 +00:00
Fan Zhang
0a07b19dd9 Merge "Pre-set initial state to wifi tether switches." into oc-mr1-dev am: dad9b79630
am: b1ff93dfeb

Change-Id: I9206b968d53c89924076e1f3b9979fd00e68945d
2017-09-06 22:53:14 +00:00
Ajay Nadathur
d1c3084bd5 Set title in remote views if present in bundle
- Title set if defined in the Bundle returned by summaryUri's content
provider.
- summaryUri invoked inline with onBindView call

bug: 62713030
Test: Manually tested, verified that title and summary are retrieved
when settings app is resumed
Change-Id: Id82531eec5ec11ec3492f033fb34ec65a5437a48
2017-09-06 15:25:04 -07:00
jackqdyulei
1e887c17e2 Make system item has a consistent name.
In battery settings, the system item contains many packages. In old
behaviour it will use the first package(which has legal name and icon)
to represent this item. This behaviour is not consistent.

In this cl, we always use package "android" to extract name and icon
if it is system item.

Bug: 65090883
Test: RunSettingsRoboTests
Change-Id: Ibb7f85c06ab1745867f1eaa666cea32c8d3295a6
2017-09-06 14:49:49 -07:00
Fan Zhang
08c4871dbe Merge "Misc polishing fixes for Settings" into oc-mr1-dev
am: bda6500884

Change-Id: I119661153a87d0ebe67367c7350c2934679902a3
2017-09-06 21:23:04 +00:00
Fan Zhang
b1ff93dfeb Merge "Pre-set initial state to wifi tether switches." into oc-mr1-dev
am: dad9b79630

Change-Id: I6236900d715e7ef85e2855513c41689a68046a07
2017-09-06 21:22:14 +00:00
TreeHugger Robot
bda6500884 Merge "Misc polishing fixes for Settings" into oc-mr1-dev 2017-09-06 20:37:15 +00:00
TreeHugger Robot
dad9b79630 Merge "Pre-set initial state to wifi tether switches." into oc-mr1-dev 2017-09-06 19:53:39 +00:00
TreeHugger Robot
7f541b8227 Merge "Clean up test strings" 2017-09-06 19:49:36 +00:00
TreeHugger Robot
a43af4a43c Merge "Import translations. DO NOT MERGE" 2017-09-06 18:05:42 +00:00
Fan Zhang
31d8a89220 Misc polishing fixes for Settings
- Never return null when querying userDictionaryLocales
- Auto mirror mobile setting icon in RTL to match status bar.

Fixes: 65298627
Fixes: 65361092
Test: robotests
Change-Id: I0f9827f7bc23baf4895712c0f86584aeccfb9c73
2017-09-06 10:58:52 -07:00
Fan Zhang
a0372028f0 Clean up test strings
- Mark everything untranslatable to avoid TC confusion

Change-Id: Iea43b0f5f63253833d91aeaa11b3c463cd170741
Fixes: 65355069
Test: builds
2017-09-06 10:54:19 -07:00
Antony Sargent
cbb0bcfeae Merge "Fix Bluetooth switch status in Connected devices screen" into oc-mr1-dev am: c3b47925e3
am: f92f6c24f1

Change-Id: I81d955471c420647b884533cf09656cf7cae28c1
2017-09-06 16:55:27 +00:00
Antony Sargent
f92f6c24f1 Merge "Fix Bluetooth switch status in Connected devices screen" into oc-mr1-dev
am: c3b47925e3

Change-Id: I7c9a07543340992e8bd3ff15538d74d28a1aab22
2017-09-06 16:53:28 +00:00
Antony Sargent
c3b47925e3 Merge "Fix Bluetooth switch status in Connected devices screen" into oc-mr1-dev 2017-09-06 16:42:41 +00:00
Charles He
0a72c23393 Merge "Enforce wifi config lockdown on details page." into oc-mr1-dev am: 10adff1163
am: e7cf5e6221

Change-Id: I356a58cadd3e19e61d9585f08e47c9d4cdcf4318
2017-09-06 16:12:08 +00:00
Charles He
e7cf5e6221 Merge "Enforce wifi config lockdown on details page." into oc-mr1-dev
am: 10adff1163

Change-Id: I8aed4d127bc84c457a672cc5e524aa7ac477b15d
2017-09-06 16:06:32 +00:00
Charles He
289af93896 Enforce wifi config lockdown on details page.
Fixes the bug that, on the new WifiDetailPreference page, the "Forget"
button is not disabled properly for wifi configs created and protected
by DevicePolicyManger.

Robolectric test to follow in a separate CL.

Test: manual, by locking down wifi config with TestDPC
Test: make RunSettingsRoboTests
Bug: 64971700
Bug: 65396674
Change-Id: I27740eabd5eb94415e4258c9c80f91df2d9ab476
2017-09-06 15:58:14 +00:00
Bill Yi
ef8151c8b3 Import translations. DO NOT MERGE
Change-Id: If965ef4d51917904739ed4726b036a285adc6d6d
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import
2017-09-06 08:15:05 -07:00
Daniel Nishi
fb302de0d6 Cache storage values for fast loading.
If the user moves away from the storage fragment and returns, this
allows us to use cached data from the previous calculation. If the data
is > 1 minute old, we consider it stale. Otherwise, we can bypass the
loading screen.

Fixes: 37923463
Test: Settings Robotest

Change-Id: I7650d4d742852f8d447878c077b9190bc0a0bb22
2017-09-05 14:46:14 -07:00
Fan Zhang
657286112f Pre-set initial state to wifi tether switches.
The preset initial state helps eliminating animation jank when first
landing on the page.

Change-Id: Ia7ba83983f18409b1c653cc1ebb0f3aad281358c
Fixes: 64811322
Test: robotests
2017-09-05 13:57:14 -07:00
Stephen Chen
8ffcbccbce Make auto Wi-Fi summary text consistent with feature availability.
"Turn Wi-Fi on automatically" feature is disabled when airplane mode or
battery saver mode is enabled, when Wi-Fi scanning is disabled, or when
network recommendations are disabled / scorer unset. This change
captures these negative cases in the summary text.

Bug: 65085700
Test: make ROBOTEST_FILTER=WifiWakeupPreferenceControllerTest
RunSettingsRoboTests -j40
Change-Id: I2f2d22b5bef3ad03a28d34e79a27e6545cac557f
2017-09-05 13:51:58 -07:00
Antony Sargent
c626fcc028 Fix Bluetooth switch status in Connected devices screen
The symptom observed is that the Bluetooth master switch on the
Connected devices page doesn't properly respond to Bluetooth turning off
via quicksettings - either turning on airplane mode or just toggling
Bluetooth.

The root cause was that MasterSwitchPreference's isChecked method would
not return the true value of whether the switch was checked - if the
control is disabled, it always just returns false. This interacts badly
with code in BluetoothEnabler - we disable the switch when the Bluetooth
state is in transition (eg becomes STATE_TURNING_OFF), and we also
attempt to avoid calling setChecked if the switch is already in the
desired state. So the switch would be checked but disabled, and we'd
avoid ever calling setChecked(false) on it.

A thorough fix would be to remove the code from MasterSwitchPreference's
isChecked method that looks at the enabled state, since enabled and
checked really should be treated as separate concerns. But given the
timeframe of MR1, we're opting for a more conservative fix of directly
accessing the switch and checking it's state, to avoid introducing bugs
in other consumers that might be depending on the current
behavior. We'll then do the thorough fix on the master branch which will
give a lot more time for any unexpected issues to be found (I audited
other usages and none seemed likely to be a problem, but it's better to
be safe than sorry).

Change-Id: I19a6c6b71e74595be3ef32a9718a430b67a89d53
Bug: 64940731
Test: make RunSettingsRoboTests
2017-09-05 17:10:30 +00:00
Daniel Nishi
09ed020f13 Merge "Make photos/videos storage preference normal." into oc-mr1-dev am: 3d1f6abd6f
am: 5467aed58d

Change-Id: Ic5218a18aa0ea099a113a4c45737baf6bfc05e3a
2017-09-02 03:58:04 +00:00
Daniel Nishi
5467aed58d Merge "Make photos/videos storage preference normal." into oc-mr1-dev
am: 3d1f6abd6f

Change-Id: Ic944357091b2cd16115fd4b0f3ff0459090a3e27
2017-09-02 03:39:51 +00:00
TreeHugger Robot
3d1f6abd6f Merge "Make photos/videos storage preference normal." into oc-mr1-dev 2017-09-02 03:29:52 +00:00
Daniel Nishi
9be0ce09c9 Make photos/videos storage preference normal.
We had special behavior for it in the past, but this defines new
behavior that is much closer to what the other storage preferences do.
A photo app filter is used and a photos/video files preference exists on
it which intents over to the gallery app.

Fixes: 64147318
Test: Settings robotests

Change-Id: I47284515fe2dfcc924ae61a44bc47051e9f5fda6
2017-09-01 17:51:56 -07:00
Doris Ling
87ca13d446 Merge "Set drawable for the entity header app preference button." into oc-mr1-dev am: 5fe8e76b36
am: c905662743

Change-Id: Iea22293c41c88fbd9c0a20e71bcfc3972fba17c0
2017-09-02 00:46:36 +00:00
Doris Ling
c905662743 Merge "Set drawable for the entity header app preference button." into oc-mr1-dev
am: 5fe8e76b36

Change-Id: I02625057fd4636f8ce61d5772f7ce4083fb7f81f
2017-09-02 00:41:28 +00:00
TreeHugger Robot
5fe8e76b36 Merge "Set drawable for the entity header app preference button." into oc-mr1-dev 2017-09-02 00:17:08 +00:00
Daniel Nishi
2e47a32605 Merge "Show work profile apps only on app list." into oc-mr1-dev am: 8618b8649f
am: d3e0d745a8

Change-Id: Ieb84a6732af3eacb9d576ecc9cb685cff38b8e20
2017-09-01 23:37:21 +00:00
Daniel Nishi
d3e0d745a8 Merge "Show work profile apps only on app list." into oc-mr1-dev
am: 8618b8649f

Change-Id: I8757ff64193dc0754b01aa769e55a355464e2d01
2017-09-01 23:17:06 +00:00
Doris Ling
a7b40995de Set drawable for the entity header app preference button.
In the entity header layout, the action buttons resource is set to null by
default. When we bind the button with the app preference action, we
should also set the drawable to the settings icon as well.

Change-Id: Ic259b4c538f529671ca5a9c67664ef32fbbb25ae
Fixes: 64826061
Test: make RunSettingsRoboTests
2017-09-01 14:52:30 -07:00
Daniel Nishi
83ceab82e4 Show work profile apps only on app list.
For the work profile drilldown, we used to show all apps when the user
drilled down into the categories. This makes it so that the drill down
only shows the work apps when that deep.

Change-Id: I492cd3e9b9b923b87b68645a871dcfb2b91b4f95
Fixes: 62963093
Test: Settings robotest
2017-09-01 13:08:48 -07:00
Julia Reynolds
0e497230d9 Merge "Add settings page for notification channel groups" 2017-09-01 12:49:39 +00:00
Antony Sargent
ec452e58a5 Fix ClassScanner and re-enable CodeInspectionTest tests
This fixes the code in ClassScanner for finding all classes in a given
package to not depend on directory entries in the .jar files generated
by the build system. This dependency caused our tests in
CodeInspepectionTest.java to fail when this CL:

https://android-review.googlesource.com/#/c/platform/build/+/456418/

stopped adding directory entries in the .jar files generated by the
build process. Instead of depending on directories being present in the
list of resources provided by the classloader, this CL switches to using
Guava's ClassPath class to enumerate all loadable classes and filter
them to the ones in the package of interest.

Change-Id: I583919096450b61d4816256be280e2f5f1ce2316
Fixes: 64840107
Test: make RunSettingsRoboTests
2017-08-31 14:00:15 -07:00
Julia Reynolds
0c3f4bce57 Add settings page for notification channel groups
Bug: 63927402
Test: tests/unit/src/com/android/settings/notification/.*
Change-Id: Iebf7d8ba54f0cf5801a42f3161354d3cc5e5c848
2017-08-31 11:02:36 -04:00
Lei Yu
9260c92c24 Merge "Add device/profile app check in background check" into oc-mr1-dev am: f5d7db2cfa
am: ec8007b426

Change-Id: I118fee2b974a0815d21d422358250281da9804f0
2017-08-30 17:21:30 +00:00
Lei Yu
ec8007b426 Merge "Add device/profile app check in background check" into oc-mr1-dev
am: f5d7db2cfa

Change-Id: I7ffb1cd690b638f4266b5e37913510f545b780b9
2017-08-30 17:15:02 +00:00
Lei Yu
f5d7db2cfa Merge "Add device/profile app check in background check" into oc-mr1-dev 2017-08-30 17:02:21 +00:00
TreeHugger Robot
fd1f10640f Merge "Move tests from tests/app/ to tests/unit/" 2017-08-30 01:58:35 +00:00
jackqdyulei
00015fbf50 Add device/profile app check in background check
If app is device or profile app, we disable the background check
toggle. This cl also create an util method for this check and
remove duplicate code

Bug: 64665807
Test: RunSettingsRoboTests
Change-Id: Id8336eadaac8832327bc3653aaa7dfbacde352ac
2017-08-29 16:10:36 -07:00
TreeHugger Robot
7c2aebc2b7 Merge "Fix power usage detail page is launched in wrong user" 2017-08-29 22:42:47 +00:00
Doris Ling
d47606ab6d Move tests from tests/app/ to tests/unit/
- second round, move all remaining items
- removed SoundSettingsIntegrationTest and DashboardAdapterTest as they
are obsolete.

Fixes: 62103184
Test: make SettingsUnitTests
Change-Id: Idc2eeb285acd209ef2d00c5451fff697002e1734
2017-08-29 15:32:53 -07:00
Bill Yi
ef5d680cc4 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import

Bug: 64712476
Change-Id: I334be8406b13c2b00047753ed84f62cf6ae71fbd
2017-08-29 14:36:06 -07:00