310 Commits

Author SHA1 Message Date
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
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
Fan Zhang
d30c05c293 Make a helper method to post work to ui thread.
Bug: 36131513
Bug: 63896139
Test: robotests
Change-Id: If7154f17926f86157816987221f449a48ae6fd4e
2017-07-21 17:05:09 -07:00
TreeHugger Robot
689359914d Merge "Fix suggestion crash if parser fails to parse dismiss rule" into oc-dr1-dev 2017-07-21 22:59:13 +00:00
Fan Zhang
7b77cf8938 Fix suggestion crash if parser fails to parse dismiss rule
We store a index value in shared pref to figure out when a suggestion
should be displayed next time. However the rule can change due to
various reasons. When the index and the rule itself go out of sync, we
should not crash.

Change-Id: Id3ea88b6d321434e20ac0cd3e2670524c237e24e
Bug: 63908636
Test: robotests
(cherry picked from commit 4d37a1a1e1ca902b8a65bce64fafa0eeea51a4dd)
2017-07-21 22:11:41 +00:00
Fan Zhang
15ea628204 Fix suggestion crash if parser fails to parse dismiss rule
We store a index value in shared pref to figure out when a suggestion
should be displayed next time. However the rule can change due to
various reasons. When the index and the rule itself go out of sync, we
should not crash.

Merged-In: Id3ea88b6d321434e20ac0cd3e2670524c237e24e
Change-Id: Ied4a0359f9bc22ee94ec79c0591d2671a9c31b86
Fix: 63908636
Test: robotests
2017-07-21 12:57:14 -07:00
Fan Zhang
4d37a1a1e1 Fix suggestion crash if parser fails to parse dismiss rule
We store a index value in shared pref to figure out when a suggestion
should be displayed next time. However the rule can change due to
various reasons. When the index and the rule itself go out of sync, we
should not crash.

Change-Id: Id3ea88b6d321434e20ac0cd3e2670524c237e24e
Bug: 63908636
Test: robotests
2017-07-21 12:53:00 -07:00
Glen Kuhne
a8b74c8c1e Merge "Don't set AccessPoint with WifiInfo.INVALID_RSSI" into oc-dr1-dev am: 860f185c66 am: 640f04ef38
am: d6d285ecca

Change-Id: I6c97db37a23d73fee9e8511d62702e4e0e900a13
2017-07-21 02:50:11 +00:00
Glen Kuhne
640f04ef38 Merge "Don't set AccessPoint with WifiInfo.INVALID_RSSI" into oc-dr1-dev
am: 860f185c66

Change-Id: I9069d51fa6214d9b78c04eea6ab6adebff13ca2e
2017-07-21 02:37:58 +00:00
TreeHugger Robot
860f185c66 Merge "Don't set AccessPoint with WifiInfo.INVALID_RSSI" into oc-dr1-dev 2017-07-21 02:30:17 +00:00