Commit Graph

2843 Commits

Author SHA1 Message Date
Lei Yu
088393596e Merge changes from topics "anomaly_test_app_step_6", "anomaly_test_app_step_5" into oc-mr1-dev
* changes:
  Add functional test for wakelock anomaly detector
  Add functional test for bt anomaly detector
2017-08-28 17:35:59 +00:00
Jack He
19ba320263 Bluetooth: Only show devices when their names are resolved
* Add a developer menu option to allow name-less devices to be shown
  when a Bluetooth developer needs it, but hide it for non-developer
  users.
* Set BluetoothDevicePreference to invisible when CachedBluetoothDevice
  does not have a name besides MAC address and the above developer option
  is false.
* This affects BluetoothPairingDetail and DevicePickerFragment, but does
  not affect BluetoothSettings. BluetoothSettings will show all paired
  devices regardless whether an user friendly name exists.

Bug: 34685932
Test: pair Bluetooth device, send file over Bluetooth, unit tests
Change-Id: Idd7ad4b1671dfdcf3204efb50eddb6dae1065aa5
2017-08-25 16:27:30 -07:00
jackqdyulei
d8bfc74256 Add functional test for wakelock anomaly detector
Bug: 63815938
Test: runtest -x WakelockAnomalyTest
Change-Id: I4d10d5be8b38264f29c67c2c945fdbbd1090430d
2017-08-25 14:02:39 -07:00
jackqdyulei
e4298941b4 Add functional test for bt anomaly detector
This cl:
Set up the environment for functional test
1. Update Android.mk by adding instrumentation and libs
2. Update AndroidManifest.xml by adding runner

Add functional test for bt anomaly, with the following workflow
1. reset battery stats
2. pretend unplug and screen off
3. Start AnomalyTester app, set values and click start button
4. Wait its running
5. Check anomaly preference in battery main page
6. reset all parameters

Bug: 63815938
Test: runtest -x BluetoothAnomalyTest
Change-Id: Ief02a314d21f6c32d70729047a1d4bdce9ad9920
2017-08-25 13:45:16 -07:00
TreeHugger Robot
77bd8c3a73 Merge "Add battery indicator to bluetooth icon" into oc-mr1-dev 2017-08-25 18:25:03 +00:00
TreeHugger Robot
08fecc4143 Merge "Add wakelock action in testing app" into oc-mr1-dev 2017-08-25 03:35:46 +00:00
TreeHugger Robot
51c83353fe Merge "Fix jank in showing conditions and suggestions in cold start." into oc-mr1-dev 2017-08-25 03:34:34 +00:00
jackqdyulei
7661137981 Add battery indicator to bluetooth icon
This cl change util method in bluetooth package to return
drawable instead of resId.

If the bt device has battery level, then method return customized
layerDrawable, otherwise return a simple drawable created from
resId.

Bug: 63393322
Test: RunSettingsRoboTests

Change-Id: Ib21822eafda0e8570212ce5cb070478e4f4876a2
Merged-In: Ib21822eafda0e8570212ce5cb070478e4f4876a2
2017-08-24 16:53:01 -07:00
jackqdyulei
0cc62f860c Add wakelock action in testing app
This cl adds action to hold the wakelock for specific time. With
this action we could test whether wakelock detector is effective.

Bug: 2731722
Test: make -j40 AnomalyTester
Change-Id: I1d44c12363f126ea9b8fc44f4c135e46b898186c
2017-08-24 16:15:44 -07:00
jackqdyulei
9d78df0d30 Add bt anomaly action in testing app
This cl adds the action to start bluttooth unoptimized scanning.
With this action we could test whether bt anomaly detector is
effective.

Bug: 62602318
Test: make -j40 AnomalyTester
Change-Id: I7f41dbb07384fbf3c5a81e460a3629306bc33f59
2017-08-24 16:15:24 -07:00
Doris Ling
5b01294d84 Fix jank in showing conditions and suggestions in cold start.
When we first initialize the dashboard view, and register the condition
listener, it will trigger the condition changed callback immediately.
This results in unnecessary refresh of the dashboard header. Add check
to not do the refresh when we first initialize the view.

Change-Id: If7c69637463734c150b7f5eb7f3c042cf73837fa
Fixes: 64811475
Test: make RunSettingsRoboTests
2017-08-24 13:53:30 -07:00
TreeHugger Robot
efcc8be05c Merge "Move the Robolectric shadow config up." into oc-mr1-dev 2017-08-24 19:27:23 +00:00
Lei Yu
3949ed53a9 Merge "Add UI components for bluetooth anomaly" into oc-mr1-dev 2017-08-24 17:35:15 +00:00
Lei Yu
8cac6b07bc Merge "Set up anomaly test app in settings" into oc-mr1-dev 2017-08-24 17:34:56 +00:00
TreeHugger Robot
f83b94aa0c Merge "Extending SearchFeatureProvider API to provide timeout" into oc-mr1-dev 2017-08-24 04:11:48 +00:00
TreeHugger Robot
a78eeb2d61 Merge "Add a "Add Network" button to SavedAccessPointsWifiSettings" into oc-mr1-dev 2017-08-24 01:43:58 +00:00
jackqdyulei
693fe62fe0 Add UI components for bluetooth anomaly
Bug: 62602318
Test: make -j40 AnomalyTester
Change-Id: I4584e6ada784d8d87558a5b30cf55e2de33d443a
2017-08-23 17:37:18 -07:00
TreeHugger Robot
d94fbbc325 Merge "Fix null pointer exception when logging suggestions." into oc-mr1-dev 2017-08-24 00:36:43 +00:00
jackqdyulei
7e97d2d9a5 Set up anomaly test app in settings
This cl set up the basic android framework for anomly test app.
Anomaly test app has the similar architecture compared with
settings api tester.

1. Add Android.mk and AndroidManifest.xml
2. Add blank AnomalyActivity
3. Add related resource files.

Bug: 62602318
Test: make -j40 AnomalyTester
Change-Id: I1d59517c9c2d8d0b8e219e3a67dfae73ca5a968e
2017-08-23 17:35:26 -07:00
TreeHugger Robot
0e800978bf Merge "Set preference invisible when no anomaly" into oc-mr1-dev 2017-08-23 19:57:41 +00:00
TreeHugger Robot
d0066e3875 Merge "Update strings when shortString is true" into oc-mr1-dev 2017-08-23 19:38:40 +00:00
jackqdyulei
4242ee0dd4 Set preference invisible when no anomaly
In the previous code path, we will create an invisible anomaly preference
and update it to visible if it contains any anomaly. However, when
anomaly is dismissed we don't reset preference to invisible.

So, this cl adds code to set it to invisible explicitly when anomaly list
is empty.

Bug: 64617126
Test: RunSettingsRoboTests
Change-Id: Ie7a3498da91243f05f4c47fb1cc5f67b177d04b1
2017-08-23 10:09:19 -07:00
TreeHugger Robot
a097d68c4b Merge "Stop display "Cell network" item for tablet" into oc-mr1-dev 2017-08-23 01:42:42 +00:00
Soroosh Mariooryad
98fc9b139c Extending SearchFeatureProvider API to provide timeout
Bug: 38197948
Test: RunSettingsRoboTests

Change-Id: I5b04085ba93061dafe8977b42ebe5092bc9a9d09
2017-08-22 10:38:32 -07:00
Tony Mak
c74bbcd3b2 A separate entry for work profile CA cert
We mixed both primary and work profile CA certs into single entry
previously which is not aligned with the CTS requirement.
Separate them from now.

Test: m -j RoboSettingsTest
Test: Run related manual test in CtsVerifier

Bug: 64567417

Change-Id: Iaff2d9f25ef15b96c11727e7075bdae8e90ec8ce
2017-08-22 18:24:30 +01:00
Daniel Nishi
739b0eef10 Move the Robolectric shadow config up.
In my testing, this reduces the runtime of the Robolectric Settings test
suite on my Z840 workstation from 440 seconds to 402 seconds on average.
By avoiding having a method-level Robolectric shadow import, we avoid
going down a code path which needs to add more shadows later in the
Robolectric execution.

Bug: 64808827
Test: Settings robotests still pass
Change-Id: I7b40d73b30306ae3f9759281afbd7f7266579e24
2017-08-17 14:37:27 -07:00
Stephen Chen
dc1add0c61 Add a "Add Network" button to SavedAccessPointsWifiSettings
Bug: 36719359
Test: runtest --path
packages/apps/Settings/tests/unit/src/com/android/settings/wifi/SavedNetworkSettingsTest.java
Test: Open saved networks from WifiSettings. Ensure that exiting and
resuming the activity keeps the "Add Network" button on the bottom of
the network list. This is tested through the cases where networks are
forgotten/saved before resuming, and that pausing/resuming when the dialog
is open or closed does not affect the result.

Change-Id: Ib719a1f6b9468c0f8f44470eeed9144904672cf1
2017-08-17 14:00:30 -07:00
TreeHugger Robot
682ff5562c Merge "Import translations. DO NOT MERGE" into oc-mr1-dev 2017-08-17 15:33:39 +00:00
TreeHugger Robot
f51b4a580f Merge "Suppress some search results" into oc-mr1-dev 2017-08-17 01:20:42 +00:00
Doris Ling
97da51876b Fix null pointer exception when logging suggestions.
In monkey test, the suggestions list can become null. So, add check
for valid suggestions list before trying to iterate through the
suggestions.

Fixes: 64757618
Test: make RunSettingsRoboTests
Change-Id: Ib670808a4f222187b9cd53d7d939e71b5ce8dbae
2017-08-16 15:26:03 -07:00
Fan Zhang
83eaff5e4a Suppress some search results
Fixes: 62137086
Test: reindex search
Test: robotests
Change-Id: I12e873edade80e4c0007d10352fb037b3230c643
2017-08-16 22:25:29 +00:00
Antony Sargent
563c4a6557 Fix rotation bug in Bluetooth pairing PIN dialog
BluetoothPairingDialogFragment has code that makes the OK button on the
dialog disabled until the user has entered at least one character into
the PIN field. However it didn't properly handle the case where the user
had entered some text and then rotated the screen - because it always
marked the OK button as disabled during onShow even if it already had
some content. This CL fixes that by looking at the text content and only
disabling the OK button if the content is empty.

Bug: 36514895
Test: make RunSettingsRoboTests
Change-Id: I4e8e70089a862e67b20ff614bbaa64fc2b641fd4
2017-08-16 15:19:47 -07:00
jackqdyulei
ae4b79ee6d Update strings when shortString is true
After b/64124535, battery strings in settings page use shortString
version. This cl updates the charging string in this situation to
match the mock.

Note that no matter whether we use shorString, the chargingLabel
should remain the same.

Bug: 64752046
Test: RunSettingsRoboTests
Change-Id: I4395d4660e212688cd560ca0b124acbd9c099cc9
2017-08-16 14:42:35 -07:00
Bill Yi
cf96c9b13f Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Exempt-From-Owner-Approval: translation import

Bug: 64712476
Change-Id: If0ff6ff971291e101e464f028e79fc18afa5b6a7
2017-08-15 21:53:30 -07:00
Ajay Nadathur
719d80e6e0 Merge "Update strings for skip fingerprint setup" into oc-mr1-dev 2017-08-11 17:12:26 +00:00
TreeHugger Robot
14450c5669 Merge "Clean up AssistGesturePreferenceController" into oc-mr1-dev 2017-08-11 03:01:33 +00:00
Kevin Chyn
bd947c7ba9 Clean up AssistGesturePreferenceController
The preference controller shouldn't be shared between the
"Assist Gesture" parent setting, and the child setting within

Fixes: 64318213

Test: manual test of settings && make -j RunSettingsRoboTests
Change-Id: I2d2437e2036881a08977924dc1386aa1fab67070
2017-08-11 00:58:09 +00:00
Ajay Nadathur
58c2da2d9e Update strings for skip fingerprint setup
bug: 64092225
Test: Manually tested and verified updated strings used
Change-Id: I813f72abb8cb9fd2ba9ec952c0926ecd2f670ed0
2017-08-11 00:42:30 +00:00
jackqdyulei
28284a52e6 Stop display "Cell network" item for tablet
If device doesn't support MOBILE_DATA, then stop show
"Mobile network standby" in battery advanced page.

Bug: 63252393
Test: RunSettingsRoboTests
Change-Id: Icaf5c0c781c96fa1d4df999c6769c27a84c27446
2017-08-10 13:33:25 -07:00
Antony Sargent
8cd8519eab Merge "Stay discoverable in Bluetooth settings and pairing pages" into oc-dr1-dev
am: 49cd8f2327

Change-Id: I4b8989fd95405bfeb7ada518b0ce2f76dec5cdb3
2017-08-10 07:25:53 +00:00
TreeHugger Robot
49cd8f2327 Merge "Stay discoverable in Bluetooth settings and pairing pages" into oc-dr1-dev 2017-08-10 07:23:29 +00:00
Antony Sargent
c86440538f Stay discoverable in Bluetooth settings and pairing pages
There are two problems with the Bluetooth settings and pairing pages
that are fixed by this CL:

(1) We advertise on the page that the local device is visible to other
devices, but that only lasts for the length of the default timeout (120
seconds) for the local adapter being in discoverable mode.

(2) Both the BluetoothSettings and BluetoothPairingDetail fragments
enter discoverable mode in their onStart handler and exit it in their
onStop handler. Unfortunately when doing a fragment navigation the
onStart and onStop events interleave in a non-intuitive manner. When you
go from BluetoothSettings to BluetoothPairingDetail, we see the onStop
event for BluetoothSettings *after* the onStart event for
BluetoothPairingDetail, and similarly when going back from
BluetoothSettings to BluetoothPairingDetail. What this means in practice
is that if you go to the BluetoothSettings page, the device will be
discoverable, but once you navigate to BluetoothPairingDetail or back
again you won't be discoverable again until you go somewhere else or end
the settings activity.

This CL adds a new object called AlwaysDiscoverable which can be used to
start and stop a mode of "always being discoverable". While started, it
will listen for changes to the discoverable state, and return to
discoverable mode. This fixes (1) by returning to discoverable mode
whenever the normal timeout expires, and (2) similary by returning to
discoverable mode when we accidentally exit it due to the onStop/onStart
mismatch.

A better fix for (2) would be to avoid the "glitch" of briefly exiting
discoverable mode only to re-enter it, but the implementation of that is
a little more complicated so that's being left as future work in order
to keep this CL as small as possible.

Bug: 64130265
Test: make RunSettingsRoboTests
Change-Id: I559dd8187263ea6a0008be1a8abdfffac97cb87a
2017-08-09 22:10:40 -07:00
TreeHugger Robot
7074e25a0e Merge "Log preference change as Integer instead of Long." into oc-mr1-dev 2017-08-10 03:41:07 +00:00
TreeHugger Robot
db56114b34 Merge "Initialize the volume seekbar preference max and progress." into oc-mr1-dev 2017-08-10 01:41:45 +00:00
Doris Ling
9dbd807ea1 Log preference change as Integer instead of Long.
Change-Id: I3dc93a4b8a5aa7f03bef05d39bd4504ed205334f
Fix: 64485529
Test: make RunSettingsRoboTests
2017-08-09 17:36:02 -07:00
TreeHugger Robot
5b820431d3 Merge "Delete DynamicindexableContentMonitor & all refs to it" into oc-mr1-dev 2017-08-10 00:28:03 +00:00
Fan Zhang
e3535d9998 Delete DynamicindexableContentMonitor & all refs to it
Convert input device search into a search query loader

And remove old logic from DynamicIndexableContentMonitor

Change-Id: If652b1ea7c8add9185bbd025055e14925d3a8eec
Bug: 64310452
Bug: 63831980
Test: robotests
2017-08-09 17:27:02 -07:00
Daniel Nishi
8bbc28a95b Merge "Expose the notification-swipe controls." into oc-dr1-dev
am: c075f8943e

Change-Id: I479a411c032df7426d89838a668f4303c4d67a54
2017-08-09 22:37:34 +00:00
Justin Klaassen
a22c8345fa DO NOT MERGE - Ask device owner for master clear in demo mode
Bug: 62712426
Test: make RunSettingsRoboTests -j19
Change-Id: I29f92ff1062590f2c5eb7713e5969da7870fc582
2017-08-09 15:37:01 -07:00
Doris Ling
b7490bea28 Initialize the volume seekbar preference max and progress.
When the media stream is set, initialize the preference max and progress
with the streams current value. Otherwise, when we initialize the seekbar
volumizer, it will first set the seekbar max to 0 and progress to 0,
then update with the correct value, which will result in the jank that
is seen when the sound settings are displayed.

Change-Id: I515c97bbc6ec38bbe92755e3d7cb53bb13ac52d0
Fix: 34035654
Test: make RunSettingsRoboTests
2017-08-09 13:56:13 -07:00