518 Commits

Author SHA1 Message Date
Daniel Nishi
4325c181b7 Add a photos app filter and a metric for using it.
Bug: 64147318
Test: SettingsLib integ tests

Change-Id: Id165a514aa65d2efdd4e6753c3e73762293e892e
Merged-In: I4cae384fa565ac0928177bd85804d7904cd6156c
2017-09-01 10:38:43 -07:00
Daniel Nishi
a86115fdb3 Add a photos app filter and a metric for using it.
Bug: 64147318
Test: SettingsLib integ tests
Change-Id: I4cae384fa565ac0928177bd85804d7904cd6156c
2017-08-30 11:00:03 -07:00
Eric Schwarzenbach
2b35b512e3 Change AccessPointPreference key generation to match AccessPoint.
AccessPointPreference now uses SSID + security to determine preference
key, which matches the way WifiTracker groups scan results. This
prevents mismatches between WifiSettings and WifiTracker.

Bug: 64887518
Test: make -40 RunSettingsLibRoboTests
Change-Id: I021a266cbb1037b7ac82efc72f0670088a521640
2017-08-30 16:31:32 +00:00
TreeHugger Robot
6916aad046 Merge "Remove unused methods from SuggestionList" 2017-08-27 21:04:12 +00:00
Fan Zhang
6da22fb443 Remove unused methods from SuggestionList
Test: robotests
Change-Id: Ibfd5606917a2f6e2f22bca15c297ef34eb3cfe1e
2017-08-25 18:08:27 -07:00
jackqdyulei
1369bf693f Add battery indicator to bluetooth icon
This cl creates BluetoothDeviceLayerDrawable, which contains two
drwable:
1. previous bluetooth device drawable
2. battery drawable showing the battery level

If connected bt device has battery level, we will use this
LayerDrawable both in bluetooth main page and detail page.

Also, battery drawable is reused from BatteryMeterDrawableBase, we
rotate base drawable by 90 degree and update the spec a little bit.

Bug: 63393322
Test: RunSettingsLibRoboTests

Change-Id: I55313940576523dcbeb65a6e20e41289da8a3e0c
Merged-In: I55313940576523dcbeb65a6e20e41289da8a3e0c
2017-08-24 16:51:53 -07:00
jackqdyulei
d94a9388e8 Add battery indicator to bluetooth icon
This cl creates BluetoothDeviceLayerDrawable, which contains two
drwable:
1. previous bluetooth device drawable
2. battery drawable showing the battery level

If connected bt device has battery level, we will use this
LayerDrawable both in bluetooth main page and detail page.

Also, battery drawable is reused from BatteryMeterDrawableBase, we
rotate base drawable by 90 degree and update the spec a little bit.

Bug: 63393322
Test: RunSettingsLibRoboTests

Change-Id: I55313940576523dcbeb65a6e20e41289da8a3e0c
2017-08-24 14:00:36 -07:00
Jack He
6c008738d3 Merge "Bluetooth: Add flag for human readable name" into oc-mr1-dev am: 34eac2c59b
am: 10edd06b15

Change-Id: Ieb0ac6a65d7e56b074832f3909f9becbc5012b5b
2017-08-24 13:50:48 +00:00
Jack He
c219bc9b88 Bluetooth: Add flag for human readable name
* Add hasHumanReadableName() method to CachedBluetoothDevice that
  returns True when BluetoothDevice.getAliasName() is not null nor empty

Bug: 34685932
Test: pair Bluetooth device, send file over Bluetooth, unit tests
Change-Id: I197f3f7f3bcb7d785729473b25638006449ae862
2017-08-24 09:39:55 +00:00
Sundeep Ghuman
fedf461789 Implement score cache eviction in AccessPoint.
This prevents cached scores from being held indefinitely and used for
SSID fallback logic in WifiTracker (Picker).

Bug: 63073866
Test: runtest --path frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java
Change-Id: Ib351d20db30dfd18b69bb1f8e4d4f26fc6b74ef0
2017-08-23 16:52:28 -07:00
Sundeep Ghuman
a419b9b4db Implement score cache eviction in AccessPoint.
This prevents cached scores from being held indefinitely and used for
SSID fallback logic in WifiTracker (Picker).

Bug: 63073866
Test: runtest --path frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java
Change-Id: Ib351d20db30dfd18b69bb1f8e4d4f26fc6b74ef0
Merged-In: Ib351d20db30dfd18b69bb1f8e4d4f26fc6b74ef0
2017-08-23 15:22:28 -07:00
TreeHugger Robot
c967227f72 Merge "Fix AccessPointPreferenceTest and add updateIcon test." 2017-08-22 22:51:21 +00:00
Eric Schwarzenbach
6efd09a0ee Fix AccessPointPreferenceTest and add updateIcon test.
Dependency injects the getIcon() functionality in AccessPointPreference
to enable mocking the method in robolectric where it normally fails to
find the resource. Adds a test to verify that getIcon is called on
refresh. Also modifies the constructors to reduce redundancy.

Bug: 35854035, 64898200
Test: make -j40 RunSettingsLibRoboTests
Change-Id: Iaf9e27651db1d9f16f58ac80ac413e9f84f08b39
2017-08-22 13:40:28 -07:00
Eric Schwarzenbach
5e0535ec0a Fix flaky WifiTracker tests.
Injects the IntentFilter into the WifiTracker constructor, allowing
us to pass an empty IntentFilter into tests so that sticky system
broadcasts can be ignored.

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

Change-Id: Ic095e222284179c48bbc5f198a949f14ccbd8489
2017-08-22 08:58:35 -07:00
Sundeep Ghuman
6390fa836e Generate fallback speed label in AccessPoint.java
Cache all seen matching ScoredNetworks, and use these networks to
generate a fallback curve. This cache is kept in sync with WifiTracker's
WifiNetworkScoreCache, hence it does not permanently create any new
objects other than the map itself.

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

Change-Id: I0cdf17f63f0238e0e3a8324190f75d82beaa6672
Merged-In: I0cdf17f63f0238e0e3a8324190f75d82beaa6672
2017-08-15 20:28:48 -07:00
Sundeep Ghuman
be3a74c2de Generate fallback speed label in AccessPoint.java
Cache all seen matching ScoredNetworks, and use these networks to
generate a fallback curve. This cache is kept in sync with WifiTracker's
WifiNetworkScoreCache, hence it does not permanently create any new
objects other than the map itself.

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

Change-Id: I0cdf17f63f0238e0e3a8324190f75d82beaa6672
2017-08-14 12:32:12 -07:00
Tony Mantler
265e7fbcc3 Don't lose dialogs during configuration change
Bug: 62442606
Test: Rotate device when a dialog is showing
Change-Id: Iba63343d4e52e8e3ed2489f2f9482e698baf6111
2017-08-09 14:41:25 -07:00
Fan Zhang
066864a6ed Merge "Remove logic for parsing dismiss rule" into oc-mr1-dev am: 6a820f2238
am: 774eace18c

Change-Id: Ib86300ac020de47871bb4c2c0557628ee9d8eeb8
2017-08-08 22:53:16 +00:00
TreeHugger Robot
6a820f2238 Merge "Remove logic for parsing dismiss rule" into oc-mr1-dev 2017-08-08 22:13:11 +00:00
Sundeep Ghuman
ff09600616 Merge "Refactor WifiTracker sStaleScanResults." into oc-mr1-dev am: a5a660a84d
am: 9c628a7d7d

Change-Id: If982340d9d1bcc9eb903c743ebf83c77cbad4b40
2017-08-08 19:53:05 +00:00
Sundeep Ghuman
a580215fc3 Refactor WifiTracker sStaleScanResults.
In ag/2580164, in order to minimize changes, we used mutable static
state in WifiTracker to control cache eviction. This breaks a certain
flow in SetupWizard. This change reverts sStaleScanResults to an
instance member and then pipes the value into the AccessPoint update
call to control cache eviction instead of relying on error prone use of
mutable static state.

Bug: 63479352
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java
&&
runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
Manual: See bug

Change-Id: Ia6d79c1904294da69841cbdf6eafbf42fa70f2d0
Merged-In: Ia6d79c1904294da69841cbdf6eafbf42fa70f2d0
2017-08-08 09:45:57 -07:00
Sundeep Ghuman
d1e449267a Refactor WifiTracker sStaleScanResults.
In ag/2580164, in order to minimize changes, we used mutable static
state in WifiTracker to control cache eviction. This breaks a certain
flow in SetupWizard. This change reverts sStaleScanResults to an
instance member and then pipes the value into the AccessPoint update
call to control cache eviction instead of relying on error prone use of
mutable static state.

Bug: 63479352
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java
&&
runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
Manual: See bug

Change-Id: Ia6d79c1904294da69841cbdf6eafbf42fa70f2d0
2017-08-08 09:30:22 -07:00
TreeHugger Robot
8dc5772cfc Merge "Move LogPersist to SettingsLib" 2017-08-07 18:50:49 +00:00
Sundeep Ghuman
395c2cc1fc Merge "Fix race condition / test flakiness." into oc-dr1-dev am: 0c8e5b6dda am: 850ec9b235
am: 6911eb3879

Change-Id: I3b92831ece6dade82d334ad96d69937a520a79a2
2017-08-04 21:32:51 +00:00
Sundeep Ghuman
850ec9b235 Merge "Fix race condition / test flakiness." into oc-dr1-dev
am: 0c8e5b6dda

Change-Id: I0e7541f39696e226baf68418ea86ed94cea34827
2017-08-04 21:08:43 +00:00
TreeHugger Robot
0c8e5b6dda Merge "Fix race condition / test flakiness." into oc-dr1-dev 2017-08-04 20:59:34 +00:00
Tony Mantler
c48ba6a262 Move LogPersist to SettingsLib
Bug: 62442606
Test: LogdSizePreferenceControllerTest, LogpersistPreferenceControllerTest
Change-Id: Ie69248538a639e7b8ff0e1553b2393b38b1bf7fe
2017-08-04 13:57:22 -07:00
Fan Zhang
c07ae9cf09 Remove logic for parsing dismiss rule
We now still parse dismiss_rule from activity metadata, but intead of
treating it as "first show on Day x, then on day y if user dismiss
suggestion", we simply start showing suggestion on day x. If user
dismisses the suggestion, it's gone forever.

Change-Id: Ia4d14167a407983df22e582f8dbab0c2cc153e1e
Fix: 64297191
Test: robotests
2017-08-03 17:48:11 -07:00
Peter Qiu
41f3ad1c05 Merge "SettingsLib: wifi: add support for tracking carrier Wi-Fi APs" into oc-mr1-dev am: fca9a47ba8
am: 1387d056f9

Change-Id: Iad364bc777c571bac8aa1c31dcdc9e50ed815069
2017-08-03 04:47:05 +00:00
TreeHugger Robot
fca9a47ba8 Merge "SettingsLib: wifi: add support for tracking carrier Wi-Fi APs" into oc-mr1-dev 2017-08-03 04:28:24 +00:00
Fan Zhang
f0f9fa3307 Merge "Misc change to support loading dynamic summary/icon in app" 2017-08-02 21:40:02 +00:00
Fan Zhang
dadfd50325 Misc change to support loading dynamic summary/icon in app
- Add ThreadUtils.postOnBackground helper method
- Don't fallback to app.icon if tile's metadata contains icon uri
- Deprecate TITLE_RES_ID in favor of TITLE metadata

Bug: 63758074
Test: robotests
Change-Id: Ie60fb4677cdb12c3ff313ffdfdb4a4f4960fac0f
2017-08-02 21:38:49 +00:00
Tadashi G. Takaoka
a90de50092 Merge "Add test for InputMethodSubtypePreference" 2017-08-02 01:36:33 +00:00
Sundeep Ghuman
3991d758d9 Merge "Fix broken robotests." into oc-dr1-dev am: a048e3c03f am: dbb97833c6
am: 4150fbacc8

Change-Id: I5098e205386b3f25e8bb573115fdec14654d9bdd
2017-08-01 23:26:39 +00:00
Sundeep Ghuman
4150fbacc8 Merge "Fix broken robotests." into oc-dr1-dev am: a048e3c03f
am: dbb97833c6

Change-Id: I46bbc7f6d9d4f4238a2d528abc88d2a87fd25f74
2017-08-01 23:15:30 +00:00
Sundeep Ghuman
8bf1f86606 Merge "Fix broken robotests." into oc-dr1-dev
am: a048e3c03f

Change-Id: If07fc6d27b94cd515f2b205ab2cd77bd84302942
2017-08-01 22:47:07 +00:00
Peter Qiu
280581b105 SettingsLib: wifi: add support for tracking carrier Wi-Fi APs
Added carrier network info AccessPoint to indicate if a given
AP is associated with a cellular carrier.

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

Change-Id: I10e44b5e18099c7052a973ea24809e75bb2ba9ea
2017-08-01 13:53:05 -07:00
Tony Mantler
bf2ba86544 Merge changes from topics 'SystemPropPoker', 'DevSettingsPrefsFile'
* changes:
  Refactor SystemPropPoker
  Remove development settings prefs file
2017-08-01 16:12:19 +00:00
Tadashi G. Takaoka
6504675ccc Add test for InputMethodSubtypePreference
Check that InputMethodSubtypePrefernce#compareTo(Preference,Collator)
complies with Comparable contracts.

Fixes: 29571417
Test: Pass SettingsLibTest. Install SettingsLibTest.apk and run test.
  $ adb shell am instrument -w \
      -e class com.android.settingslib.inputmethod.InputMethodSubtypePreferenceTest \
      com.android.settingslib/android.support.test.runner.AndroidJUnitRunner
Change-Id: I96038a7b548469ee34a6f78c75c894f40cd4f338
2017-08-01 17:17:47 +09:00
Sundeep Ghuman
370660915d Fix broken robotests.
In ag/2580164 AccessPoint.java made a reference to WifiTracker, which
in term references WifiNetworkScoreCache. Since the Robolectric in the
platform still has not been updated to support API 26 (Android O), this
caused the test to break.

By definining the class in the test package, the test can be fixed until
proper Android O support is added to the robolectric prebuilts in the
platform code.

Bug: 64217019
Test: make -j40 RunSettingsLibRoboTests
Change-Id: I6cfd5c17d1aba98d43cca4828058493960a7ff79
2017-07-31 18:46:45 -07:00
Eric Schwarzenbach
8a8ff2907f Merge "Add individual ScanResult speeds to verbose logging." into oc-mr1-dev am: 402e44173d
am: 617c761251

Change-Id: I55b16ee31e7e9434d95377f9e66ceac282fd3f0d
2017-08-01 01:21:36 +00:00
Eric Schwarzenbach
0b8700f842 Add individual ScanResult speeds to verbose logging.
Moves the individual ScanResult summary string generation out of
getVisibilityStatus into its own method `verboseScanResultSummary`,
to reduce duplication and to enable testing the per-ScanResult speed labeling.

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

Change-Id: I9583d142a7d50314017154703df4e1ce69fc68aa
2017-07-31 15:46:29 -07:00
Tony Mantler
a263ee6a0e Refactor SystemPropPoker
Bug: 62442606
Test: SystemPropPokerTest
Change-Id: I67d6e16ec4d637d94b3adcf240ea6b5a45438ad9
2017-07-31 15:42:46 -07:00
Tony Mantler
4ca9ebd5d3 Remove development settings prefs file
Move DevelopmentSettingsEnabler to SettingsLib
Fix typo in SettingsLibRobolectricTestRunner

Bug: 64159590
Test: DevelopmentSettingsEnablerTest
Change-Id: I8a2a3407ff10c5db0417d13e735bae5dca1ff5b5
2017-07-31 15:11:25 -07:00
Sundeep Ghuman
db2eabbbab Fix race condition / test flakiness.
The potential for a race condition exists in WifiTrackerTest,
which intermittently manifests in APCT. By waiting for all handlers
to be idle before asserting our test verification, we can fix this
flaky test. Also added more verification steps to test code to more
precisely indicate where a test may be failing.

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

Change-Id: I597fd7dc29e7f3b0d13c8cdebfa208326a64f507
2017-07-28 15:19:41 -07:00
TreeHugger Robot
3b8ce7c6d7 Merge "Sort APs by Speed label value instead of ranking score." into oc-mr1-dev 2017-07-26 03:41:27 +00:00
Sundeep Ghuman
2fd9ad068a Merge "Merge "Do not evict scan results in cold start." into oc-dr1-dev am: d68b6dc56b am: f5b7da9b32" into oc-mr1-dev-plus-aosp
am: c8d5463923

Change-Id: Ia3e0d750ab8f7541700b2a99b3b10bea2b826565
2017-07-25 23:47:18 +00:00
Sundeep Ghuman
f5b7da9b32 Merge "Do not evict scan results in cold start." into oc-dr1-dev
am: d68b6dc56b

Change-Id: If442689c6a05ad261a846a5252d9a0256520508e
2017-07-25 23:05:11 +00:00
TreeHugger Robot
d68b6dc56b Merge "Do not evict scan results in cold start." into oc-dr1-dev 2017-07-25 22:41:39 +00:00
Sundeep Ghuman
4205874ec7 Do not evict scan results in cold start.
When starting WifiTracker, show whatever results are available from
platform until new scan results come in. This allows us to show the best
available results from the previous location scan. Once we have resumed
scanning and new scan results come in, the previous logic of evicting
scan results older than 15 seconds applies.

Also prevent unnecessary onConnectedChanged callbacks from being fired,
which may unnecessarily cause UI reloading bars to appear by performing
unnecessary work.

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

Change-Id: I3db9d98425b3d2fc66fa0757807a318d0c7456ee
2017-07-24 13:15:23 -07:00