119 Commits

Author SHA1 Message Date
Filip Pavlis
59dd2ebfc1 Merge "Omit using ctor of PreferenceViewHolder in tests." into oc-dev 2017-04-07 10:31:44 +00:00
William Luh
1b54760eee Merge "Fix injected settings titles not matching a locale change." into oc-dev 2017-04-07 00:00:44 +00:00
TreeHugger Robot
5883a40931 Merge "Add showChargingMethod in BatteryInfo" into oc-dev 2017-04-06 22:06:25 +00:00
William Luh
4c978a302a Fix injected settings titles not matching a locale change.
The injected tiles code currently treats the string metadata value
for the title key in the Activity's manifest as the title itself.
When the language on the device is changed the title remains in the
previous language until a reboot.

This CL will make injected tiles attempt to treat the string metadata
value as a resource variable to get the integer res id and then
properly load the localized title using the res id. To be backwards
compatible, if the res id is 0, we treat the string metadata value as
the title itself (current behavior).

Bug:36470694
Test: make RunSettingsLibRoboTests
Change-Id: I3963534a3a3a27d0455c4ed1ad4fa574b03d67fc
2017-04-06 14:35:51 -07:00
jackqdyulei
806f78d988 Add showChargingMethod in BatteryInfo
This toggle is used to decide whether to show charging method.
If it is off, then "Charging over ac" will become "Charging"

Bug: 36558216
Test: RunSettingsLibRoboTests
Change-Id: I98b1f7e7b77d7ce0a7e1aae29e55a33ac79ff0d7
(cherry picked from commit b3c33f63ed120cf4758ec67426bb45291e289fce)
2017-04-06 13:16:58 -07:00
Stephen Chen
21f6868d80 Set AccessPoint metered bit using ScoredNetwork, WifiInfo, and WifiConfiguration.
Bug: 36888471
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java

Change-Id: I5228512a832665916520658acddc9bf93d78a1a1
2017-04-05 19:17:57 -07:00
Filip Pavlis
81d53516ab Omit using ctor of PreferenceViewHolder in tests.
See the topic for related change in the support lib.

Bug: b/33774880
Test: N/A
Change-Id: I557278175db17b32ff9ce65ceaebc9a7386d2c20
2017-04-05 10:56:38 +01:00
Jesse Evans
13be12e314 Adds appropriate filtering for instant apps
Adds a new filter that includes downloaded and launcher apps, as well
as instant apps, and ensured that instant apps do not appear where
they previously were not expected (downloaded and launcher apps).

Test: Added testing for the existing filter and the new one.

Bug: 36515324
Change-Id: I7ef94442bae14ee18d4b4d70f04f9bf62af9eff8
(cherry picked from commit a4e0356ed48021c353a6964ec8ea4c6b55006282)
2017-04-02 16:10:22 +00:00
Peter Qiu
ced37dba7b SettingsLib: wifi: encapsulate Passpoint configuration in AccessPoint
The configurations that are managed by "Saved Networks" page are
centered around the abstraction of AccessPoint.  Since we will
need to manage Passpoint configuration in the "Saved Networks"
(for configuration removal), encapsulate necessary information
in an AccessPoint for a Passpoint configuration.

Bug: 34207710
Test: manual test
Test: runtest --path
      frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java
Change-Id: Ide556f5ec6c4ef9e1f82016efe17dc9860f298de
2017-03-31 10:50:45 -07:00
Peter Qiu
f562838125 wifi: add test for tracking Passpoint AP on devices with Passpoint disabled
On a device with Passspoint disabled (config_wifi_hotspot2_enabled build config
set to false), calls to WifiManager#getMatchingWifiConfig will throw
an UnsupportedOperationException.  So add a test to verify that exception
is being caught in WifiTracker#udpateAccessPoints.

Bug: 36649203
Test: runtest --path
      frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java

Change-Id: If7d3d4122c36b1b98c24abf703d6492771918125
2017-03-28 13:24:34 -07:00
Amin Shaikh
a80ae0c0b6 Store the number of saved networks in WifiTracker.
Bug: 36532777
Test:  runtest --path frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
Change-Id: Ia43ba22e271c08a6dc17683b993fd8231057e45e
2017-03-24 10:42:41 -07:00
TreeHugger Robot
54cacb7aed Merge "Remove tests from SettingsLibShell" 2017-03-23 03:13:59 +00:00
TreeHugger Robot
f93cdbd58f Merge "Fix AppRestrictionsHelperTest." 2017-03-23 02:38:41 +00:00
TreeHugger Robot
8efea16f1e Merge "Move two target preference layout from settings to lib" 2017-03-23 01:26:53 +00:00
Sudheer Shanka
83083cf358 Fix AppRestrictionsHelperTest.
Recently mockito has been updated to version 2.7.* and any(*.class) will now
reject null values.

Bug: 36531717
Test: runtest -x packages/SettingsLib/tests/integ/src/com/android/settingslib/users/AppRestrictionsHelperTest.java
Change-Id: Ia3ff2f470a95f6ee36a97eba8699425274500f17
2017-03-22 18:01:17 -07:00
Fan Zhang
035ff93430 Move two target preference layout from settings to lib
Change-Id: I5eda0cdcc4e8d8bb25f95ee12837d90179ac5c0a
Fix: 36511169
Test: make RunSettingsLibRoboTests
2017-03-22 16:02:37 -07:00
Colin Cross
3c17d77610 Remove tests from SettingsLibShell
The tests and the robolectric libraries are already in
SettingsLibRoboTests, and shouldn't be in the package being tested.
Including robolectric in the package causes it to go through
proguard, which complains about missing dependencies.

Also remove the unnecessary libraries that are already included
through frameworks/base/packages/SettingsLib/common.mk.

Test: m -j ANDROID_COMPILE_WITH_JACK=false RunSettingsLibRoboTests
Change-Id: I11f007c4321bb9b147f62010eae046f75d1a52e3
2017-03-22 16:01:52 -07:00
Dan Shi
874a0916fc Merge "Add test configs to apct tests under frameworks/base" 2017-03-22 17:55:58 +00:00
Dan Shi
7f2afd2dff Add test configs to apct tests under frameworks/base
TouchLatency is needed by test TouchLatencyJankTestWear
UiBench is needed by test UiBenchJankTests

Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
make -j32 TouchLatency TouchLatencyJankTestWear  && \
tradefed.sh run template/local --template:map test=TouchLatencyJankTestWear \
      --test-tag testname --log-level-display VERBOSE
make -j32 UiBenchJankTests UiBench  && \
tradefed.sh run template/local --template:map test=UiBenchJankTests \
      --test-tag testname --log-level-display VERBOSE

Change-Id: I63f23e3a21ad1343607953958fb7bb0a5fb8c343
2017-03-21 00:05:14 -07:00
Sundeep Ghuman
ce78a5f2d3 Average scan results for AccessPoints.
This reduces jitter in the WifiTracker and is modeled after a prior
broken implementation which attempted to half-life the rssi each time
AccessPoint.update(ScanResult) is called.

Bug: 34774783
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java

Change-Id: Iab3f9914af40f2fd56e8ae7b45dcbd62176c8a67
2017-03-17 13:29:59 -07:00
Sundeep Ghuman
b9647ebba0 Fix broken AccessPointTests.
Bug: None
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java

Change-Id: I5d5da5e7e0faf1c124816f0dd8ab5f0249e54637
2017-03-17 12:44:54 -07:00
TreeHugger Robot
587b60282e Merge "frameworks/base: Add APCT tests to the device-tests suite." 2017-03-16 17:35:12 +00:00
Simran Basi
473a16e492 frameworks/base: Add APCT tests to the device-tests suite.
This CL adds the APCT tests within this project to
a similar suite as CTS known as device-tests.

The current method of running APCT tests in the infrastructure
is unaffected.

Bug: 35882476
Test: `make dist device-tests -j` and local builds of
      continuous_instrumentation_tests & continuous_native_tests

Change-Id: Ifa382fe691842c1cd76897775b9e2a1653449eb5
2017-03-15 14:46:27 -07:00
Sundeep Ghuman
54bdcfa081 Consolidate getRssi logic to return mRssi.
Changed previous getRssi method to updateeRssi in order to clarify
process, and also changed logic to return current mRssi when the given
AP is active. mRssi is set directly from WifiInfo for active networks.
For non-active networks we return the highest Rssi for any recently seen
BSSID (multiple APs with the same SSID are grouped together).

Change getSeen to updateSeen for consistency, although seen is never
used anywhere.

Also fixes b/34889252.

Bug: b/36077865
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java

Change-Id: Ic52df41b8eb317e83d835c745b404007a53cf5d7
2017-03-14 15:43:17 -07:00
Doris Ling
0acbdda13e Merge "Update sort order for settings category tiles." 2017-03-14 20:20:43 +00:00
Doris Ling
ce31159be7 Update sort order for settings category tiles.
- change the sort to first compare priority, then compare package name.
- do not normalize the tile's priority for all package.

Change-Id: I5501a8c3d5ca0a7f9e100411348d28cfe373c87a
Fix: 35928954
Test: make RunSettingsLibRoboTests
2017-03-13 12:56:10 -07:00
Paul Duffin
8b00751ff6 Use --multi-dex native to avoid dex limit
Bug: 32912773
Test: make checkbuild
Change-Id: I1adb219894c90487fe9455765972cadf50fb295a
2017-03-11 21:29:48 +00:00
Paul Duffin
192bb0bc54 Refactor code incompatible with Mockito 2.7.13
(cherry picked from 76e319f015c2b43498ce3ce610a253d63e76cbf3)

Some additional internal only refactorings were done as well.

Bug: 32912773
Test: make checkbuild
Change-Id: I96e3da967fad731fc8f39bde9db95f50ab7353fb
2017-03-10 14:18:53 +00:00
Fan Zhang
c93dadacdd Show help icon in actionbar
Fix: 35955986
Test: RunSettingsLibRoboTests
Change-Id: If4c328cacf1e3c9a5f66eeb248749c97c80cdb6c
2017-03-06 13:06:38 -08:00
Fan Zhang
f1c1bb49f8 Remove drawer code from settings
Change-Id: I3e9920f62745f6ba2236e37689f7603f9a30d6a9
Fix: 35809663
Test: make RunSettingsLibRoboTests
2017-02-28 11:54:28 -08:00
TreeHugger Robot
6ff8367dc2 Merge "AccessPoint - Add Builder; Add unit tests for compareTo()" 2017-02-27 20:39:36 +00:00
Dave Schaefer
9853743705 AccessPoint - Add Builder; Add unit tests for compareTo()
Add a Builder class to make testing easy and clean.
Add unit tests to enforce the sorting order that we want.
Refactor some compareTo() internals to use existing methods rather than
duplicating functionality.
Refactor isReachable() functionality to a new method.
Update tests to use Truth assertion library.

Test: Run local AccessPoint unit tests:

adb shell am instrument -w -e class
com.android.settingslib.wifi.AccessPointTest
com.android.settingslib/android.support.test.runner.AndroidJUnitRunner

Bug: 35042429
Change-Id: I7c8a1ca69800f62e1fb13141e58b4e52b2bc3d70
2017-02-27 08:52:01 -08:00
Sundeep Ghuman
2b48990b9c Process the NetworkInfo before updating AccessPoints.
This fixes a UI issue where the Tracker first displays the connected
accessPoint as inactive before processing the connected state, which
causes the list to jump around.

Also add useful debugging information to AccessPoint toString.

Bug: 35681450
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
Change-Id: I9a8356cfdd2e5be2da58ce5de82e228fddf301f9
2017-02-24 16:57:53 -08:00
TreeHugger Robot
ab6798951a Merge "Fix broken RestrictedLockUtils KeyGuard APIs" 2017-02-24 19:29:48 +00:00
TreeHugger Robot
23830a0909 Merge "Remove ContentProvider queries in updateTileData." 2017-02-23 21:11:18 +00:00
William Luh
204af1cb44 Remove ContentProvider queries in updateTileData.
The ContentProvider queries in updateTileData are not being used, and
adds extra latency. Queries are performed later in Settings to get the
freshest data.

Bug: 35708630
Test: make RunSettingsLibRoboTests
Change-Id: I3798af0a89ed7261cfa4ebec4fada077495034ed
2017-02-23 11:16:47 -08:00
TreeHugger Robot
120f971679 Merge "Disable settings nav drawer entirely." 2017-02-22 20:08:37 +00:00
Lei Yu
b0833461e4 Merge "Make precentage calculation round up by 0.5%" 2017-02-22 18:44:38 +00:00
Antony Sargent
8b0813c3e4 Merge "Add "Instant apps" filter to app listing" 2017-02-22 18:40:43 +00:00
Fan Zhang
5ba2d3fef9 Disable settings nav drawer entirely.
Change-Id: I3e9bdd3759a47fc09a654b6dad00b611138d5de6
Fix: 34806148
Test: make RunSettingsLibRoboTests
2017-02-22 10:36:30 -08:00
Robin Lee
acdeac6809 Fix broken RestrictedLockUtils KeyGuard APIs
They were all broken in that they returned profile admins for parent
queries even when they clearly shouldn't.

Examples:
 - disable unredacted notifications
 - disable fingerprint

This doesn't seem to have been tested beyond the bare basics of one
user with one device admin. Added some reasonable coverage. It could
still do with more.

Test: make RunSettingsLibRoboTests
Bug: 34929375
Change-Id: I1b0e986056ffa62d47091c0010977ac810ebd690
2017-02-22 17:39:34 +00:00
jackqdyulei
5dc1f36599 Make precentage calculation round up by 0.5%
So we will show 1% when actually number is 0.5%

Bug: 35305983
Test: RunSettingsLibRoboTests
Change-Id: I26f11f25a7d78cc6b09cb358abd82017fa7cea00
2017-02-21 16:40:01 -08:00
Lei Yu
1335669b0e Merge "Add statusLabel in BatteryInfo" 2017-02-21 18:40:52 +00:00
TreeHugger Robot
6e82080513 Merge "Move Badging from ScoredNetwork to NetworkingBadging." 2017-02-18 01:14:04 +00:00
Fan Zhang
b1d49225c0 Add logging constant for settings search result click
Bug: 34975477
Test: Builds
Change-Id: Ie59fb0639c6aa4044ba4fdb0a71dd489bd2d3b68
2017-02-17 16:07:07 -08:00
jackqdyulei
111418e7ad Add statusLabel in BatteryInfo
The statusLabel shows the current status of the battery(i.e. not
charging, charging).

Bug: 35328749
Test: RunSettingsLibRoboTests
Change-Id: I5be13635be9b2749c0c62edeb1e0ac17ff423d83
2017-02-17 13:58:49 -08:00
TreeHugger Robot
4e43b811e7 Merge "Add multi-dex to SettingsLibTests when buliding with coverage" 2017-02-17 20:47:52 +00:00
TreeHugger Robot
8c9a6b0089 Merge "Revert "Revert "Per user setting for instant app""" 2017-02-17 20:46:12 +00:00
Colin Cross
a7cfd57759 Add multi-dex to SettingsLibTests when buliding with coverage
Building with coverage enabled pushes SettingsLibTests over the dex
limit, enable multi-dex.

Test: builds
Change-Id: Ia72db71a2e46e2fdc8cf3e5484f122fa985f25c7
2017-02-17 18:54:37 +00:00
Doris Ling
2ddd29df61 Remove nested preference from its parent.
PreferenceScreen.remvoePreference() only removes top level preference in
the preference screen. When we try to remove preference inside a
preference category, it will fail. Add handling to recursively find
the preference and remove it directly from its parent instead.

Change-Id: Ib33efe0b716db2366d712ce1d1eb8b5e33a4683a
Fix: 35365702
Test: make RunSettingsLibRoboTests
2017-02-16 15:29:26 -08:00