100 Commits

Author SHA1 Message Date
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
Todd Kennedy
be0b8896d1 Revert "Revert "Per user setting for instant app""
This reverts commit be9ffa15af9e1906e9ffb505768328d62d4a3793.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ib21321cf157a79890de487060a093840f7182047
2017-02-16 12:43:37 -08:00
Antony Sargent
67952e94a9 Add "Instant apps" filter to app listing
Bug: 35098444
Test: new test added in ApplicationsStateTest.java ; run it by doing the
following commands:
 make SettingsLibTests -j40
 adb install -r $OUT/data/app/SettingsLibTests/SettingsLibTests.apk
 adb shell am instrument -w com.android.settingslib

In Settings->Apps&Notifications->Apps, the list of filters before this CL is:

 All | Enabled | Disabled

With this CL, the filter list becomes:

 All apps | Installed apps | Disabled apps | Instant apps

Change-Id: Ia2ec099f758901839a2aa84fe155ae032990092f
2017-02-15 15:52:33 -08:00
Guang Zhu
be9ffa15af Revert "Per user setting for instant app"
Bug: 35390781

This reverts commit 2f5811dcfd840e149851a9333e27ef3cdddf7a46.

Change-Id: Ibb1c8dacbdc6908fc7fa2bc5dca664f2455162bf
2017-02-15 21:43:48 +00:00
Sundeep Ghuman
699deaf610 Move Badging from ScoredNetwork to NetworkingBadging.
This is a non-functional refactor. The old enums will be removed once
ag/35323372 is addressed.

Bug: 35114358
Test: Ran existing tests (see files touched).
Change-Id: I08fd8c7964463b5908ce361e61f8fe811d0ff6f3
2017-02-14 14:04:18 -08:00
Todd Kennedy
2f5811dcfd Per user setting for instant app
The same application can run as either an instant app or an installed
app. Store this setting per-user instead of based upon the install
location.

Bug: 25119046
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Iff565bb1ac10d631499f0bd0f69b401cb073c10e
2017-02-14 13:42:01 -08:00
Daniel Nishi
646b56c844 Merge "Don't show game and music apps in Other Apps." 2017-02-14 18:45:33 +00:00
Fan Zhang
fdfc88faef Don't hide summary text in RestrictedPreference.
Bug: 34974598
Test: RunSettingsLibRoboTests
Change-Id: I8ea74fb52c38430c120fd4158867a9184d8f16cf
2017-02-10 17:22:51 -08:00
Sundeep Ghuman
ac7b43616e Serially (un/)register score cache in WifiTracker.
Before the cache unregistration logic was posted to the worker thread.
However, when WifiSettings is quit, the onDestroy method immediately
kills the WorkHandler. This caused unregistration to never occur, which
left the cache registered and the listener to try to post work on the
dead worker thread. The cache is now registered and unregistered
serially in start and stop tracking, respectively. Furthermore, the
cachelistener is running on the mainHandler as it is a lightweight task
(posting to work handler).

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

Change-Id: I7739fdbe036be5b2870be45f33f670fd69d69af1
2017-02-08 20:56:07 -08:00
TreeHugger Robot
4a7b9f2b90 Merge "Fix a crash when opening app data usage for work profile" 2017-02-08 22:33:47 +00:00
Daniel Nishi
bd8c6652cd Don't show game and music apps in Other Apps.
Bug: 35143240
Test: SettingsLib Robotest
Change-Id: Ifaa086373d27dc81203137d20fa1617df21f6093
2017-02-08 12:20:12 -08:00
Fan Zhang
73b161ddc1 Fix a crash when opening app data usage for work profile
The icon on app header is a clone of original app icon, which relies on
getConstantState() of the orginal drawable non-null.

Change-Id: Ice5360f5d00d99b3cfe538b167ce67fc06d5e402
Fix: 34190136
Test: make RunSettingsLibRoboTests
2017-02-08 12:02:52 -08:00
Dan Sandler
6aa6e6e640 Clean up BatteryMeterDrawable internal api.
Bug: 32539932
Test: runtest -x frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/graph/BatteryMeterDrawableBaseTest.java
Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/BatteryMeterDrawableTest.java
Change-Id: Ifdc3368b930abcf248b60ee99f6f9139ad804f91
2017-02-08 10:10:46 -08:00
TreeHugger Robot
ba89ed754f Merge "Move the logic of batteryMeterDrawable to settingslib" 2017-02-08 10:14:28 +00:00
jackqdyulei
597b10f6db Move the logic of batteryMeterDrawable to settingslib
In Settings, we also need a BatteryMeterDrawable to show battery meter,
that's why I move it to settingslib.

In this cl, what I have changed is listed below:
1. Create BatteryMeterDrawableLib that contains logic of battery
drawing.
2. Still Keep the battery control logic in systemui.
3. Remove hardcoded battery color by using the color state lists.
4. Move some tests to settingslib

Bug: 34771849
Test: make SettingsLibTests

Change-Id: I39c0f0e31ca5e1b958467298db1d0590d16c9f6d
2017-02-07 17:27:00 -08:00
Soroosh Mariooryad
e622690efa Merge "Modifying SuggestionParser to support dismiss logic of smart suggestions." 2017-02-07 02:12:58 +00:00
Soroosh Mariooryad
56ce766e92 Modifying SuggestionParser to support dismiss logic of smart
suggestions.

Test: RunSettingsLibRoboTests
Fixes: 35059823
Change-Id: I8c257f4f89f7dbc179aee85e013bdaecc8c3c09c
2017-02-06 17:37:49 -08:00
Doris Ling
864b7f41bb Remove category key SYSTEM_INPUT
Since we are combining Language & regions and Input and gestures in
System settings, we don't need 2 separate category keys.

Bug: 34976047
Test: make RunSettingsLibRoboTests
Change-Id: Ic11bfb5e4e373a3499772b1d4654187749197899
2017-02-03 16:15:03 -08:00
Daniel Nishi
646f500315 Merge "Add a filter for audio apps." 2017-02-01 21:01:55 +00:00
Ido Ofir
a560cd947b Adding missing filters to suggested actions in Settings that that they
match the Optional Steps fliters in setup wizard.
Also added some more logging.

Bug: 34460278
Test: cd tests/; mma

Change-Id: Id576a1a19daa473e203cef41d67f6ef0cfc06dbe
2017-01-31 11:03:44 -08:00