Commit Graph

2500 Commits

Author SHA1 Message Date
Roozbeh Pournader
4de9df2943 Define Utils.formatRelativeTime() and use it
Previously, relative times were formatted using formatElapsedTime()
(appending translations of "ago" to them), sometimes resulting in
grammatically hard-to-understand or unnatural localizations. Now we
use ICU's RelativeDateTimeFormatter, which uses grammatically correct
and natural localizations from CLDR data.

Bug: 64507689
Bug: 64605781
Bug: 64556849
Bug: 64550172
Test: make -j RunSettingsRoboTests
Change-Id: Ia2d098b190ab99e7748ef6f03b919f5c6174ba7d
2017-09-12 20:48:00 +00:00
TreeHugger Robot
ad3a7f4066 Merge "Add switch bar to enable/disable dev settings in new page." 2017-09-12 19:50:15 +00:00
TreeHugger Robot
e71fa15fe2 Merge "Add modify button to WifiNetworkDetailsFragment." 2017-09-12 19:35:29 +00:00
Fan Zhang
d77881f88d Add switch bar to enable/disable dev settings in new page.
Bug: 65522852
Test: make RunSettingsRoboTests -j40 ROBOTEST_FILTER=Development
Change-Id: I0958950dc6aaee24d8d5e0be58d7564d108bc72e
2017-09-12 10:25:43 -07:00
TreeHugger Robot
a26b07292d Merge "Adding switch for Forced App Standby" 2017-09-11 22:48:35 +00:00
Suprabh Shukla
4c64777b2a Adding switch for Forced App Standby
Reusing the 'Background activity' switch found in App Info. The switch
now needs to be shown for all apps and will toggle another app op
RUN_ANY_IN_BACKGROUND which controls whether jobs or alarms are run for
background apps.
Also fixed handling of multiple packages with shared uid. The controller
was picking the first package for uid but the order of packages can
change on a reboot which would cause wrong app ops settings across
packages of the same uid.

Test: make -j32 RunSettingsRoboTests

Bug: 65176793
Change-Id: I2a9b96bc02730776172c3ae317cb7f7f890bec30
2017-09-11 14:05:26 -07:00
Antony Sargent
0f93979e98 Merge "Fix focus behavior of ValidatedEditTextPreference" into oc-mr1-dev am: b8ff97fbd5
am: 707552888d

Change-Id: I2399b0336772742ef3afb34df393d96bb5a37a08
2017-09-11 20:16:44 +00:00
TreeHugger Robot
b8ff97fbd5 Merge "Fix focus behavior of ValidatedEditTextPreference" into oc-mr1-dev 2017-09-11 19:52:47 +00:00
TreeHugger Robot
c939be6551 Merge "Fork a new developer options page." 2017-09-11 19:47:26 +00:00
jackqdyulei
7854b554c8 Merge "Make system item has a consistent name." into oc-mr1-dev am: 9a3cb9b835
am: 52a2d32a37

Change-Id: I420581233b77c88772058730e8535c8d72b2cad5
2017-09-11 19:13:00 +00:00
Maurice Lam
c11a2f0745 Merge "Don't default to PIN on non FBE devices" 2017-09-11 17:41:47 +00:00
TreeHugger Robot
9a3cb9b835 Merge "Make system item has a consistent name." into oc-mr1-dev 2017-09-11 17:33:09 +00:00
Antony Sargent
9be8c3fbfe Fix focus behavior of ValidatedEditTextPreference
The bug report was that the cursor is set to the beginning of the
EditText for wifi hotspot password field, instead of at the end (or
having the entire field selected). This fix makes it so that all
ValidatedEditTextPreference's will put the cursor at the end of the
EditText.

Bug: 65413206
Test: make RunSettingsRoboTests
Change-Id: I23f3bb1b3f1b49b2f193c0ae2e103eae5c1a1019
2017-09-11 10:12:05 -07:00
Erik Kline
c8e912e5c4 Merge "Include IPv6 DNS servers in wifi details" into oc-mr1-dev am: 1b62d99433
am: 775807f422

Change-Id: I55fbd611fee9f17215412a76b480cdee96f62b32
2017-09-11 05:04:28 +00:00
TreeHugger Robot
1b62d99433 Merge "Include IPv6 DNS servers in wifi details" into oc-mr1-dev 2017-09-11 04:56:28 +00:00
Erik Kline
9adc588749 Include IPv6 DNS servers in wifi details
Test: as follows
    - built
    - flashed
    - booted
    - export ROBOTEST_FILTER=WifiDetailPreferenceControllerTest \
          make -j RunSettingsRoboTests
      RunSettingsRoboTests:
      RunSettingsRoboTests: Time: 19.821
      RunSettingsRoboTests:
      RunSettingsRoboTests: OK (37 tests)
      RunSettingsRoboTests:
    - make -j RunSettingsRoboTests
      RunSettingsRoboTests: ...........................
      RunSettingsRoboTests: Time: 424.847
      RunSettingsRoboTests:
      RunSettingsRoboTests: OK (2250 tests)
      RunSettingsRoboTests:

Bug: 65037256
Bug: 65467586

Change-Id: Icd3d09aa35c04101c41e2521b48e64f28f69ae29
2017-09-11 11:24:45 +09:00
Fan Zhang
4c26da9e13 Fork a new developer options page.
- Create a new activity/fragment and add it to manifest
- Mark old activity/fragment deprecated
- Enable/disable the new activity based on FeatureFlag
- Initial skeleton code for new fragment

Bug: 65522852
Test: make RunSettingsRoboTests -j40 ROBOTEST_FILTER=DevelopmentSettingsDashboardFragmentTest
Change-Id: Ib1395693f8b6f61d4726573a9ea841ea53cf207b
2017-09-10 15:02:51 -07:00
TreeHugger Robot
14e4964be0 Merge "Add FakeFeatureFactory.setupForTest" 2017-09-08 22:30:05 +00:00
Fan Zhang
1f92faad27 Merge "Don't attempt to tint icon if icon is not available" into oc-mr1-dev am: 90f9398f4e
am: ed71e21541

Change-Id: Ic2f5d6c35ac8bb7a14d1949be53beb6b6bf4cd16
2017-09-08 22:23:19 +00:00
Daniel Nishi
56e04db460 Merge "Re-add the block of text explaining the feature." into oc-mr1-dev am: 3315f38c3f
am: df0e716b43

Change-Id: Ibe767b5bd21ed75ea188a1a6561aa974edd2b449
2017-09-08 22:22:32 +00:00
TreeHugger Robot
90f9398f4e Merge "Don't attempt to tint icon if icon is not available" into oc-mr1-dev 2017-09-08 21:42:32 +00:00
Daniel Nishi
3315f38c3f Merge "Re-add the block of text explaining the feature." into oc-mr1-dev 2017-09-08 21:39:16 +00:00
Eric Schwarzenbach
5a7e46dd80 Add modify button to WifiNetworkDetailsFragment.
Adds pencil icon to Wifi Detail action bar to modify the network.
Modifies package/public visibility to allow the detail package to
use the WifiDialog. Listens for changes in WifiConfigurations to
propagate changes to the UI in WifiNetworkDetailsFragment.

Changes WifiNetworkDetail preference launch to conform to pattern
of other Settings apps. Removes unused WifiDetailActionBarObserver.

Bug: 36483704, 37082355
Test: make -j40 RunSettingsRoboTests
Change-Id: Ie9dc1892eaefdfad4a6bd7040bfc5dbf6236cfb4
2017-09-08 13:39:22 -07:00
Maurice Lam
d78ea6af4a Don't default to PIN on non FBE devices
So that EncryptionInterstitial is shown as part of the flow

Test: cd tests/robotests && mma
Bug: 65192141
Change-Id: I13e8b9059aae39cef2a8509f9f0eee1cd0808220
2017-09-08 13:31:58 -07:00
Maurice Lam
563af1cda9 Add FakeFeatureFactory.setupForTest
In AssisGestureSettingsTest, FakeFeatureFactory was used but was
missing a setupForTest call.

Test: cd tests/robotests && \
      ROBOTEST_FILTER=AssistGestureSettingsTest mma

Change-Id: Ie78232d854aee00c7969a3d2dc148354be7de484
2017-09-08 13:08:03 -07:00
Maurice Lam
40e284b196 Merge "Don't default to PIN on non FBE devices. DO NOT MERGE" into oc-mr1-dev 2017-09-08 19:50:52 +00:00
TreeHugger Robot
0bac26b6cd Merge "Policy transparency when DISALLOW_FACTORY_RESET prevents OEM unlock." into oc-mr1-dev 2017-09-08 19:08:48 +00:00
Stephen Chen
fbc7a00a5c Merge "Make auto Wi-Fi summary text consistent with feature availability." into oc-mr1-dev am: 194638ac78
am: d2f9de37c7

Change-Id: Id8725588b14f6a74efbdb2065864f2fce1561873
2017-09-08 19:04:48 +00:00
Maurice Lam
f2063cff30 Don't default to PIN on non FBE devices. DO NOT MERGE
So that EncryptionInterstitial is shown as part of the flow

Test: cd tests/robotests && mma
Bug: 65192141
Change-Id: I13e8b9059aae39cef2a8509f9f0eee1cd0808220
2017-09-08 18:58:27 +00:00
TreeHugger Robot
194638ac78 Merge "Make auto Wi-Fi summary text consistent with feature availability." into oc-mr1-dev 2017-09-08 18:47:08 +00:00
Daniel Nishi
59c8d77c8c Re-add the block of text explaining the feature.
When the automatic storage manager  is off (or has never been run), we
display a block of text that explains what it does. In order to make
this testable, I've implemented the feature in a PreferenceController
and upgraded the existing AutomaticStorageManagerSettings class to be
closer to the newer Settings IA.

Change-Id: I3f7d20347a6d5a7bae8bffcd2014c3fdcd315b90
Fixes: 63082545
Test: Settings Robotest
2017-09-08 09:58:05 -07:00
Andrew Scull
2ca3017f8e Policy transparency when DISALLOW_FACTORY_RESET prevents OEM unlock.
If an admin has set the DISALLOW_FACTORY_RESET user restriction, OEM
unlock is also restricted. If this is the case, it should be explained
to the user that the admin is preventing the OEM unlock.

DISALLOW_OEM_UNLOCK is deprecated and now managed by OemLockManager.
This restriction is also one set by the carrier, not an admin.

Test: RunSettingsRoboTests
Test: CTS verifier test from the bug
Bug: 65124732
Change-Id: I8bde87a522742a7cbda006eee17c2a19797b1835
(cherry picked from commit 0aa45bed65)
2017-09-08 16:11:36 +00:00
Andrew Scull
f9ab23ef03 Merge "Policy transparency when DISALLOW_FACTORY_RESET prevents OEM unlock." 2017-09-08 16:01:41 +00:00
Andrew Scull
0aa45bed65 Policy transparency when DISALLOW_FACTORY_RESET prevents OEM unlock.
If an admin has set the DISALLOW_FACTORY_RESET user restriction, OEM
unlock is also restricted. If this is the case, it should be explained
to the user that the admin is preventing the OEM unlock.

DISALLOW_OEM_UNLOCK is deprecated and now managed by OemLockManager.
This restriction is also one set by the carrier, not an admin.

Test: RunSettingsRoboTests
Test: CTS verifier test from the bug
Bug: 65124732
Change-Id: I8bde87a522742a7cbda006eee17c2a19797b1835
2017-09-08 12:40:25 +01:00
TreeHugger Robot
4ce113d6f8 Merge "Set title in remote views if present in bundle" into oc-mr1-dev 2017-09-08 06:36:46 +00:00
Ajay Nadathur
2e6e4c12a9 Merge "Set title in remote views if present in bundle" 2017-09-08 05:09:21 +00:00
Fan Zhang
1ca6b25321 Don't attempt to tint icon if icon is not available
Change-Id: I0aa2a17d51d966dce182381c7bba8913ad997738
Fixes: 65460834
Test: robotests
2017-09-08 00:10:55 +00:00
Jack He
9a45bab608 Bluetooth: add metrics for pairing with devices without names am: 5b017f7b05
am: d9de1ecc03

Change-Id: I34a61269d955ffd9aa073aa1c514c3f3e148adbc
2017-09-07 23:54:21 +00:00
Jack He
5b017f7b05 Bluetooth: add metrics for pairing with devices without names
* Also caches context in onClick() method

Bug: 34685932
Test: make, unit test
Change-Id: I99beab2c85b8e48c4bc41f69146759d4b7c62428
2017-09-07 12:09:00 -07:00
TreeHugger Robot
6f7f25e3fe Merge "Separate collection of indexable data from indexing" 2017-09-07 17:51:22 +00:00
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
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
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