Commit Graph

2767 Commits

Author SHA1 Message Date
Alex Kulesza
4a121ecfae Fixing bug in UsageGraph rendering.
The calculateLocalPaths() method of UsageGraph converts a set of paths
in (milliseconds, percent) coordinates into the actual pixel values that
will be used for drawing. For the most part this is a one to one
process, but not always: input points that are too closely spaced to
draw accurately are skipped. The last point in the path, however, is
never skipped, in order to ensure that the graph ends at the correct
location.

The previous implementation of this method had a bug: the y-coordinates
of points that were skipped would be stored indefinitely (in the local
variable pendingYLoc) and then added back at the very end of the path
(under the condition i == mPaths.size() - 1 && pendingYLoc !=
PATH_DELIM). Under the right conditions, this led to the strange uptick
at the end of the graph seen in the associated bug.

This CL fixes the problem and attempts to make the logic slightly
clearer. It also adds tests, one of which (_similarPointMiddle) fails
for the previous code.

In more detail, previously pendingXLoc was used to hold the last x
coordinate seen, while pendingYLoc was used to hold the last *skipped* y
coordinate, or PATH_DELIM otherwise. The difference between these was
somewhat subtle and hard to understand from a quick read of the code,
and there was a bug: pendingYLoc never got reset to PATH_DELIM even if
later points were added. In this CL I have removed the pendingLoc
variables in favor of a single lx/ly pair, which always holds the local
coordinates of the most recent point, and I added an explicit boolean
skippedLastPoint to track whether the point (lx, ly) has already been
added or was skipped.

Bug: 64065296
Test: make RunSettingsRoboTests
Change-Id: I45ccffea1280d851bfae5143c2e84d188e133731
2017-07-31 11:12:17 -04:00
jackqdyulei
d6cb4a1738 Add shadow and wrapper classes
These classes are used for accessibility service. Also
add a new Availablity type.

Bug: 62022517
Test: Build
Change-Id: Ia2ff72dd04fd99b17809822907746c2411cecb62
2017-07-28 16:12:47 -07:00
Fan Zhang
4f04c68dd1 Remove DND and all gesture suggestions from Settings
Change-Id: I2f59c426132ca907e556b8bb2fbc869f4e830768
Fix: 64156274
Test: robotests
2017-07-28 14:39:48 -07:00
jackqdyulei
51872ed345 Use package from sipper if default is null
The BatteryEntry need a background thread to update the
package name and icon. However in InstalledAppDetails we
don't have this thread and it is unnecessary because we
already has the package name.

This cl:
1. Use the mPackageName from InstalledAppDetails directly in
BatteryEntry
2. Double check the defaultPackageName in AdvancedPowerUsageDetail,
use packageName from sipper if default is null

This cl is cherry picked from oc-dr to fix the test breakage.

Bug: 64127162
Test: RunSettingsRoboTests

Change-Id: I5d21afca17f177817976758c28ed86b3a10e95eb
2017-07-28 14:16:38 -07:00
Lei Yu
90db9083ad Merge "Turn off some anomaly detectors by default" into oc-dr1-dev
am: f940431d32

Change-Id: I1d3672b40a0de6dfe481295134a5cb9eeea91b89
2017-07-28 20:49:48 +00:00
Lei Yu
f940431d32 Merge "Turn off some anomaly detectors by default" into oc-dr1-dev 2017-07-28 20:39:57 +00:00
jackqdyulei
c27d74d08e Create wrapper and shadow for AccessibilityManager
This is for testing, because robolectric doesn't recognize new
API.

Bug: 62022517
Test: Build
Change-Id: I1c150d86366305eacf3245bbabdf3d3e26124c77
2017-07-28 13:12:15 -07:00
Fan Zhang
ae0dbe3e13 Merge "Query search result intent before launching to avoid crash" into oc-dr1-dev
am: 9f93faf7ae

Change-Id: I596f52f4db123c3df485a1a194966771706650db
2017-07-28 19:29:44 +00:00
TreeHugger Robot
9f93faf7ae Merge "Query search result intent before launching to avoid crash" into oc-dr1-dev 2017-07-28 19:21:45 +00:00
Doris Ling
51fb9ad956 Merge "Fix null pointer exception when updating action bar shadow." into oc-mr1-dev 2017-07-28 17:03:49 +00:00
jackqdyulei
5a3be2874e Turn off some anomaly detectors by default
1. Wakeup alarm detector
   Because we cannot distinguish it between foreground and background
2. Bluetooth unoptimized scanning detector
   There is a bug in framework that may undercount the scanning time

Bug: 63390581
Bug: 63964363
Test: RunSettingsRoboTests
Change-Id: Ia762f580462823e8eddccbeb12dec3876b0ef47a
2017-07-28 09:39:32 -07:00
Fan Zhang
add4b5c413 Query search result intent before launching to avoid crash
If intent cannot launch, log error.

Change-Id: Ib6f37da467749be1ef09e6665dcab122e71a52d3
Fix: 64065678
Test: robotests
2017-07-28 00:52:04 +00:00
jackqdyulei
c50495ba06 Add ResultPayload for Allow notification dots
Bug: 62022517
Test: robotests
Change-Id: I86caa1c8604ae8eff27574ca45b5e9f3f6830f8f
Merged-In: I86caa1c8604ae8eff27574ca45b5e9f3f6830f8f
2017-07-27 16:53:40 -07:00
TreeHugger Robot
70f0013e43 Merge "Limit the suggestions to be shown to 5." into oc-dr1-dev 2017-07-27 23:41:35 +00:00
TreeHugger Robot
1f34a5cf46 Merge "Limit the suggestions to be shown to 5." into oc-mr1-dev 2017-07-27 21:14:43 +00:00
Doris Ling
2798c24deb Limit the suggestions to be shown to 5.
- when creating the dashboard data, pass the sublist of suggestions to
cap the total number of suggestions to be shown to 5.
- if user swipe away the suggestion, it will only remove the suggestion
from the suggestion adapater, and will not trigger rebuilding the whole
UI.

Change-Id: I3bbc08bb67c411ff5671a837efa40da0ac885983
Merged-In: I1efabeb2a805c670007c631d3ccb0fdfbde7b55a
Fix: 64072051
Test: make RunSettingsRoboTests
2017-07-27 12:50:47 -07:00
jackqdyulei
8541d8905a Merge "Don't update the header when toggle menu" into oc-dr1-dev
am: 4ab4966e7a

Change-Id: I3a814981c648d9b777d2fbf5a2d243864aaaee3c
2017-07-27 18:21:16 +00:00
TreeHugger Robot
4ab4966e7a Merge "Don't update the header when toggle menu" into oc-dr1-dev 2017-07-27 18:15:55 +00:00
Doris Ling
d53a3128e8 Fix null pointer exception when updating action bar shadow.
Check for valid activity when trying to access the action bar as the
activity can become null when in monkey test.

Change-Id: I684d873b9eabb9d8461e99bb4385d411a48c0c52
Fix: 64084651
Test: make RunSettingsRoboTests
2017-07-27 11:14:44 -07:00
TreeHugger Robot
ea7c30265c Merge "Add ResultPayload for Allow notification dots" into oc-mr1-dev 2017-07-27 17:53:54 +00:00
Doris Ling
4940539479 Limit the suggestions to be shown to 5.
- when creating the dashboard data, pass the sublist of suggestions to
cap the total number of suggestions to be shown to 5.
- if user swipe away the suggestion, it will only remove the suggestion
from the suggestion adapater, and will not trigger rebuilding the whole
UI.

Bug: 64072051
Change-Id: I1efabeb2a805c670007c631d3ccb0fdfbde7b55a
Fix: 63309218
Test: make RunSettingsRoboTests
2017-07-27 10:45:30 -07:00
TreeHugger Robot
3bd56d970d Merge "Add ambient notifications as inline setting." into oc-dr1-dev 2017-07-27 05:37:49 +00:00
Andrew Sapperstein
1ee62c16a3 Merge "Fix more config_headlineFontFamily-induced test breakages" into oc-dr1-dev
am: 7b445d59ef

Change-Id: Ibe7f73e37c446d908e8b69b2a3789c7b22f34509
2017-07-27 01:21:05 +00:00
Jeff Davidson
a0b8472c4d Remove eSIM reset checkbox and always perform the reset.
Due to substantial risk in landing the "retain profiles" flow that
would otherwise occur if the user elected not to wipe eSIM profiles
during a factory reset, we no longer expose this option to users
through the UI. Instead, we show affected users messaging indicating
that their eSIM will be wiped unconditionally.

The underlying plumbing is retained to keep the change small and to
make it easier to revert back to a checkbox when the rest of the
platform supports it.

Change-Id: Ida7df14d81ffc4cb6b4b414928d3ce7e5c78594b
Fixes: 64081853
Test: TreeHugger
2017-07-27 01:05:02 +00:00
jackqdyulei
aa5618fd82 Add ResultPayload for Allow notification dots
Bug: 62022517
Test: robotests
Change-Id: I86caa1c8604ae8eff27574ca45b5e9f3f6830f8f
2017-07-26 17:55:11 -07:00
TreeHugger Robot
8e13218ec8 Merge "Fix gestures summary text when there is no sensor for assit." into oc-mr1-dev 2017-07-27 00:50:10 +00:00
Andrew Sapperstein
b3cf0a0923 Fix more config_headlineFontFamily-induced test breakages
Change-Id: Ic8a68a77e7ef8a3fd422e53e39d2fee74324c355
Fixes: 64024743
Test: robotests
2017-07-26 17:41:48 -07:00
Eric Schwarzenbach
bc1cf7e260 Make only the "Add Network" WifiDialog fullscreen.
Fixes an issue where other instances of WifiDialog were being launched
fullscreen. Creates static methods for creating fullscreen and modal
WifiDialogs to make the style more explicit.

Bug: 63889135
Test: make -j40 RunSettingsRoboTests
Change-Id: I2200b5d7f817b9f69a6abb73bf2c04ea24556d19
2017-07-26 17:04:42 -07:00
TreeHugger Robot
5d7fab4f22 Merge "Add ambient notifications as inline setting." into oc-mr1-dev 2017-07-26 23:34:22 +00:00
jackqdyulei
bc86e4747f Don't update the header when toggle menu
If we only toggle the app type in battery settings, don't update
the header. Then it won't have flicker in battery header.

Bug: 64065456
Test: RunSettingsRoboTest
Change-Id: If1cfa745f723f808ad9c5fd921be797acd3199ba
2017-07-26 15:28:59 -07:00
Ajay Nadathur
044485b850 Merge "Use fingerprint icons during setupwizard flow" into oc-dr1-dev
am: f5ebc6f7ed

Change-Id: Ia91197e1d6ee74fd890887330da1eaeb932cd5cb
2017-07-26 22:02:33 +00:00
Fan Zhang
0d64577205 Fix search indexing for game controller "use vibrator"
Change-Id: I34848a58b5ac4cdf58c7dd5f40677b78e764f2dc
Fix: 64035933
Test: robotests
2017-07-26 21:51:57 +00:00
Ajay Nadathur
f5ebc6f7ed Merge "Use fingerprint icons during setupwizard flow" into oc-dr1-dev 2017-07-26 21:42:12 +00:00
Andrew Sapperstein
50ca1968e6 Add ambient notifications as inline setting.
Bug: 62022517
Test: robotest and manual
Change-Id: I7e3faf56a1c8282017a2e84d88e7b0b788a7bfb6
Merged-In: If245f541ec3c8a1627d082b97bba9b325438cfeb
2017-07-26 20:20:19 +00:00
Andrew Sapperstein
e8e65a367b Add ambient notifications as inline setting.
Bug: 62022517
Test: robotest and manual
Change-Id: If245f541ec3c8a1627d082b97bba9b325438cfeb
2017-07-26 20:19:19 +00:00
Doris Ling
9042f822a6 Fix gestures summary text when there is no sensor for assit.
Should exit the summary handling if sensor is not available.

Change-Id: I5918fa5ac614db48fc2c41e1de555d1ba6928bd4
Fix: 64039312
Test: make RunSettingsRoboTests
2017-07-26 11:07:19 -07:00
Antony Sargent
1e69f27a41 Merge "Allow open password dialog for wrong-password wifi access points" into oc-dr1-dev
am: 9fb7a3b8b4

Change-Id: Ic44e0cf3972085439a603e25374d46447ebe7a8f
2017-07-26 16:18:50 +00:00
TreeHugger Robot
9fb7a3b8b4 Merge "Allow open password dialog for wrong-password wifi access points" into oc-dr1-dev 2017-07-26 10:53:30 +00:00
Antony Sargent
c00fedc639 Allow open password dialog for wrong-password wifi access points
When we're failing to connect to a wifi access point due to an incorrect
password, we want to allow an intent from a notification to open up the
wifi settings page and bring up the dialog for entering a different
password. We already have code in settings to do this for not-yet-saved
access points, so this CL just changes it slightly to also allow it for
saved access points.

Unfortunately WifiSettings can't be tested with Robolectric due to it
not supporting PreferenceScreen, so this adds a test to
WifiSettingsUiTest. There were some existing test failures in that file
which I've fixed while I was in there:

-The TestAccessPointBuilder class wasn't being found at runtime because
 it was getting stripped out at build time due to not being used in
 settings.

-The changingSecurityStateOnApShouldNotCauseMultipleListItems test was
 asserting that we don't end up with multiple entries for the same SSID
 in the access point list when changing the security state for the AP,
 but it was accidentally passing multiple AP's with the same name the
 first time.

Bug: 33245941
Test: runtest --path WifiSettingsUiTest.java
Change-Id: I16c9c8b0d8380a0e26f9b23df6a8d012af6a2476
Merged-In: I929ca6892242059df157c01d6e9ea30e8d1c5e78
2017-07-26 07:00:51 +00:00
Jack He
a65e3e6795 Merge "Bluetooth: reset mConnectionState when adapter is OFF" into oc-dr1-dev
am: 0c6f001c09

Change-Id: I2a161d403cf0c8e34a16b1ac9328135c40f7e50a
2017-07-26 06:34:30 +00:00
TreeHugger Robot
0c6f001c09 Merge "Bluetooth: reset mConnectionState when adapter is OFF" into oc-dr1-dev 2017-07-26 06:28:44 +00:00
TreeHugger Robot
4906a2a38a Merge "Disable Wallpaper setting when Wallpaper is disabled." into oc-dr1-dev 2017-07-26 06:11:07 +00:00
Doris Ling
0224a409a9 Merge "Disable Wallpaper setting when Wallpaper is disabled." into oc-mr1-dev 2017-07-26 04:14:07 +00:00
Christine Franks
a1f56b5faa Merge "Restrict changing wi-fi networks" into oc-dr1-dev
am: a7e10e0316

Change-Id: Ifcb15f741c4bcb72c32789870bc50027d2fc4cbb
2017-07-26 02:52:52 +00:00
Christine Franks
a7e10e0316 Merge "Restrict changing wi-fi networks" into oc-dr1-dev 2017-07-26 02:38:08 +00:00
TreeHugger Robot
0e9711ab92 Merge "Add divider line below "see all apps" preference" into oc-dr1-dev 2017-07-26 02:02:32 +00:00
TreeHugger Robot
5aca5f3aec Merge "Add default value to inline payloads" into oc-dr1-dev 2017-07-26 01:52:38 +00:00
Jack He
70f293ee50 Bluetooth: reset mConnectionState when adapter is OFF
* No device is connected when Bluetooth adapter is OFF
* BluetoothSummaryUpdater should reset its connection state tracker in
  order to display the correct summary message on ConnectedDevice
  preference
* Otherwise, "Connected to null" will be shown because no device is
  connected while BluetoothSummaryUpdater is still in CONNECTED state
* Removed unused imports from BluetoothSummaryUpdater
* Write additional unit test to verify the above behaviour
* Add additional logging when deviceName is null in CONNECTED state

Bug: 62492716
Test: Pair and connect to Bluetooth device, turning Bluetooth ON/OFF,
      unit tests
Change-Id: I30726636f5678d61d6052f5b8d211aa20f26f409
2017-07-26 00:31:55 +00:00
Doris Ling
3230d95f9c Disable Wallpaper setting when Wallpaper is disabled.
Check whether the wallpaper picker is enabled in
WallpaperPreferenceController.isAvailable() instead of always returning
true.

Change-Id: I85fb90ad783e5be008c9343a0804893604814bd1
Merged-In: Ie3a4a68b728ccab1a7aa50c0018a5153907c49b4
Merged-In: I1afba6639a2b94f9d57f546c220f417092f92387
Fix: 63939450
Test: make RunSettingsRoboTests
2017-07-25 16:40:30 -07:00
Andrew Sapperstein
b5696a9162 Merge "Fix robotests." into oc-dr1-dev 2017-07-25 23:37:37 +00:00