Commit Graph

1261 Commits

Author SHA1 Message Date
jackqdyulei
7f4c5fc1f4 Move bunch of battery methods to BatteryUtils.java
This cl moves following methods to BatteryUtils:
1. shouldHideSipper
2. removeHiddenBatterySippers
3. calculateBatteryPercent

As a result, we could use these methods in battery page as well
as app info page.

This cl also move bunch of tests to new file and add test for
method calculateBatteryPercent

Bug: 36816681
Test: RunSettingsRoboTests
Change-Id: Ic32700fe9741fbb96363db4af2d4fccb3ee8e317
2017-04-12 10:10:51 -07:00
Daniel Nishi
06470b68e0 Don't crash in SecondaryUserController.
If icons were fetched before displayPreference() is called, it can
cause a NPE. This adds a null check to ensure that it never
attempts to set an icon without both the icon and preference being
non-null.

Change-Id: Ib4269428e64545c9e255f7e3292fb6c046c1f307
Fixes: 37248158
Test: Settings Robotest
2017-04-12 09:33:32 -07:00
Tony Mak
007dc1abe6 Show RingtonePickerActivity in work user instead
Test: make RunSettingsRoboTests
Test: Try to import custom ringtone in work profile, no crash observed
Test: Set the custom ringtone as default. Tested both work gmail and
      calendar can play that ringtone.
Test: Try to import the peresonal ringtone, it is still working.

Bug: 37197930
Change-Id: I2b662247d7e70b59bae08e082e9682d74d797484
2017-04-12 15:12:44 +01:00
TreeHugger Robot
44cfdcc9a7 Merge "Remove hotspot receiver from manifest." into oc-dev 2017-04-12 08:20:06 +00:00
TreeHugger Robot
52cf25d03d Merge "Wi-Fi network details page fixes." into oc-dev 2017-04-12 04:40:11 +00:00
Suprabh Shukla
3fa963b28e Merge "Renaming intent action for unknown sources" into oc-dev 2017-04-12 04:32:51 +00:00
TreeHugger Robot
375c22d031 Merge "Fake the cache size to be 0 bytes when cleared." into oc-dev 2017-04-12 01:25:21 +00:00
TreeHugger Robot
d70abb53ee Merge "Don't show vpn info box when we don't have anything useful" into oc-dev 2017-04-11 23:35:39 +00:00
TreeHugger Robot
fd29aada6b Merge "Revert "Revert "Convert BT preference to use TwoTargetPreference""" into oc-dev 2017-04-11 23:35:13 +00:00
Amin Shaikh
399e1a5810 Wi-Fi network details page fixes.
- Fix NPE in WifiDetailPreferenceController#setIpText
- Add MAC address preference in the details section
- Set subnet mask and gateway preferences
- Do not show IP information preferences if no information is available
- Fix string capitalization errors
- Only show IPv4 DNS servers under "Network details" section

Bug: 36483230
Bug: 37096448
Bug: 36482499
Bug: 37165860
Test: m RunSettingsRoboTests
Change-Id: I0e3f0ccfc4a8d802b51ed6b3be81c75e384dd06f
2017-04-11 16:25:53 -07:00
Christopher Tate
65cb0d6488 Use bg appop ALLOWED, not DEFAULT
DEFAULT is not actually the right thing; it's a subtlety used for
other things that have compound state.  ALLOWED is the proper
outright "let this thing run free" state for this appop.

Also, set the appop only for the target package, not for the
entire uid.

Bug 37226920
Bug 37242946
Test: make RunSettingsRoboTests

Change-Id: I8c0a995b9519f980685e8573da946dcc93ac4e7c
2017-04-11 14:07:00 -07:00
Doris Ling
f94401b06d Remove hotspot receiver from manifest.
The hotspot receiver if used to cancel any tethering alarm set when wifi
ap state changes. Removing it from the manifest, and only register the
receiver when we schedule the tethering alarm.

Change-Id: I97c3be6e2a374949208bbdd4ac5ccc2fabf0291a
Fix: 35968322
Test: make RunSettingsRoboTests
2017-04-11 12:03:54 -07:00
Fan Zhang
b0509b48c6 Don't show vpn info box when we don't have anything useful
Change-Id: I12a71b38486cab8a6a188c299e90a7674926dc98
Fix: 36068109
Test: make RunSettingsRoboTests -j40
2017-04-11 12:02:29 -07:00
Stephen Chen
2c4b42c0b7 Update "Open networks available" toggle to instead open notification channel preferences.
Bug: 36526438
Test: make ROBOTEST_FILTER=NotifyOpenNetworkPreferenceControllerTest RunSettingsRoboTests -j40
Change-Id: Idde3949856d050e62abff2c75a7b7db475a94d99
2017-04-11 11:54:51 -07:00
Daniel Nishi
1359d4fe0e Fake the cache size to be 0 bytes when cleared.
The fast track storage calculation returns a non-zero answer after
the storage has been cleared. The simplest workaround here is to
fake the size as 0 bytes in the view after cache clearing.

It will not be zero if the user exits and comes back, but this
should be fine.

MARK IT ZERO!

Change-Id: Ia012c2cf2842040d5eac3d4a72539ec7dcfb9570
Fixes: 34965659
Test: Settings Robotest
(cherry picked from commit bf1f8e9ca7)
2017-04-11 18:23:55 +00:00
Hyunyoung Song
9234a34a80 Merge "Add shadow to AdaptiveIconDrawables using View level shadow" into oc-dev 2017-04-11 18:11:49 +00:00
Fan Zhang
00d8ff5d6e Revert "Revert "Convert BT preference to use TwoTargetPreference""
This reverts commit 457c3cbec2.

Revert with fix/test.
The fix is that we removed DevicePickerFragment#initDevicePreference(),
which incorrectly set a useless widget on preference, and removes the
gear icon from preference, preventing bind() call to go through

Change-Id: Ia70cdb51d13cca6035a4e7fe8008d195f7f00c6e
Fix: 36511169
Test: runtest --path tests/app/src/com/android/settings/bluetooth/DevicePickerActivityTest.java
2017-04-11 09:45:27 -07:00
TreeHugger Robot
e4c73c24bc Merge "Remove Night Light suggestion. DO NOT MERGE" into oc-dev 2017-04-11 01:24:09 +00:00
TreeHugger Robot
f84c8d3480 Merge "Reindex on OTA and locale change" into oc-dev 2017-04-10 23:54:55 +00:00
Sean Stout
40067bee4d Remove Night Light suggestion. DO NOT MERGE
Test: make ROBOTEST_FILTER=SettingsSuggestionsTest RunSettingsRoboTests
Bug: 37207263
Change-Id: Ieeb660abdcbe07cb66f1ae3b6e86d8fd27a26478
2017-04-10 16:22:01 -07:00
Hyunyoung Song
ebc17237c3 Add shadow to AdaptiveIconDrawables using View level shadow
Test: $ make RunSettingsRoboTests -j40
RunSettingsRoboTests: ......
RunSettingsRoboTests: Time: 151.394
RunSettingsRoboTests:
RunSettingsRoboTests: OK (1355 tests)
RunSettingsRoboTests:

Bug: 36088922

Change-Id: I5b5651d2305ab65e1358609a4110e248dee9eab2
2017-04-10 14:43:02 -07:00
Matthew Fritze
a0d03178d0 Reindex on OTA and locale change
When the user gets an OTA or changes language, settings
will clear the database and reindex it.

Test: make RunSettingsRoboTests
Change-Id: I379ece86b2d41d673bbbffbcf947774f3ccd4cb9
Fixes: 36859162
2017-04-10 14:28:39 -07:00
Daniel Nishi
b1c336de5f Merge "Add user icon to the other user preferences." into oc-dev 2017-04-10 17:27:25 +00:00
Lei Yu
27dc9b69ac Merge "Add log for BatteryUtils" into oc-dev 2017-04-10 17:06:45 +00:00
Daniel Nishi
fe33c58a18 Add user icon to the other user preferences.
This icon is loaded in the background to avoid doing IO on
the main thread. Once we know there are more users and also
have the icon loaded, we add the category to the view.

Fixes: 36252572
Test: Robotest

Change-Id: Ib50287bb7ed323f22fbe407b56be1bf2fe98f121
2017-04-07 14:57:07 -07:00
TreeHugger Robot
a258e424a2 Merge "Add summary text to Lock screen preferences." into oc-dev 2017-04-07 20:03:36 +00:00
Daniel Nishi
7badf46542 Merge "Update the automatic storage management preferences." into oc-dev 2017-04-07 19:38:27 +00:00
jackqdyulei
5d2918a675 Add log for BatteryUtils
This cl add logs to get more data for app usage time.

Also refactor BatteryUtils to singleton pattern because we need
to extract package name from uid.

Bug: 36909166
Test: RunSettingsRoboTests
Change-Id: I6ede354035c46e46cb856b7cf57bd1b7ccbd6d4f
2017-04-07 11:18:39 -07:00
Doris Ling
cee83e4bbf Add summary text to Lock screen preferences.
Each time we refresh the security preference page, get the current
summary text from "On the lock screen" and populate to Lock screen
preferences summary.

Bug: 36540633
Test: make RunSettingsRoboTests
Change-Id: I317e3892b35b30981b62f7b7aee9cfdacd04a3ed
2017-04-07 11:11:45 -07:00
Lei Yu
abde170529 Merge "Remove misc data in battery main page." into oc-dev 2017-04-07 17:37:18 +00:00
Filip Pavlis
f023f50787 Merge "Omit using ctor of PreferenceViewHolder in tests." into oc-dev 2017-04-07 10:31:45 +00:00
TreeHugger Robot
43146c4972 Merge "Add test to verify no crash on selecting brightness level." into oc-dev 2017-04-07 02:28:47 +00:00
TreeHugger Robot
e94ba3b55f Merge "Update USb preference controller to use the new summary texts." into oc-dev 2017-04-07 02:27:55 +00:00
TreeHugger Robot
b9a54bae08 Merge "Update summary text for Trust agent." into oc-dev 2017-04-07 02:09:36 +00:00
Suprabh Shukla
aa9fe03dfa Renaming intent action for unknown sources
Renaming action MANAGE_EXTERNAL_SOURCES to MANAGE_UNKNOWN_APP_SOURCES to
be clearer about its purpose

Test: adb shell am instrument -w -e class \
com.android.settings.applications.ExternalSourcesSettingsTest \
com.android.settings.tests/android.support.test.runner.AndroidJUnitRunner

cts-tradefed run singleCommand cts -m ExternalSources

Bug: 35812498
Change-Id: Ic6db5b3446c1890a358f5b5225d38409d1bd2c7c
2017-04-06 18:05:32 -07:00
Doris Ling
2db8c867d1 Update summary text for Trust agent.
Update the summary text to show the number of active trust agent.

Bug: 36540633
Test: make RunSettingsRoboTests
Change-Id: I6627564a8356022c89694c84cfd47e875a0916b1
2017-04-06 17:29:12 -07:00
Doris Ling
d007ff9395 Add subtext to Default apps.
Retrieve the default Sms app, default Browser app, and default Phone app
and append the label together to form the summary text for Default apps
settings.

Bug: 36376411
Test: make RunSettingsRoboTests
Change-Id: I8ccf71dde43bba04c4bc4a900c9a181513e7710b
2017-04-07 00:10:39 +00:00
Daniel Nishi
c660755348 Merge "Re-add the option to migrate data back." into oc-dev 2017-04-06 22:49:24 +00:00
Doris Ling
de03809396 Add test to verify no crash on selecting brightness level.
Add UI test to launch Settings->Display->Brightness level and Settings
app does not crash.

Change-Id: I526f44961bd0efbcacde334affbe2b7a93da0ce3
Fix: 36647069
Test: make SettingsTests
2017-04-06 15:10:29 -07:00
jackqdyulei
ab5ca9f5cd Remove misc data in battery main page.
The removed types are:
1. DrainType.UNACCOUNTED
2. DrainType.OVERCOUNTED

This cl removes the above types in PowerUsageSummary and
PowerUsageAdvanced

Bug: 36874846
Test: RunSettingsRoboTests
Change-Id: I1807c44a2c0a9c2fa124cdef962a6411ae6830ca
2017-04-06 15:09:57 -07:00
TreeHugger Robot
bac9b527e7 Merge "Fix crash when clicking item in Battery screen" into oc-dev 2017-04-06 21:50:07 +00:00
Daniel Nishi
f6b12274f1 Re-add the option to migrate data back.
Currently, users can use an SD card or USB drive and adopt it as
internal storage using existing flows. They can manage this drive
perfectly fine using the old storage screen, which is still around.

One functionality that was lost was the ability to migrate data from
the adopted drive back to the private internal storage. This appeared
in a dropdown in the old storage settings.

By duplicating the code to create just that specific menu item and its
click behavior, we can restore this functionality to the new storage
view.

Change-Id: Id0e01c560e7249acccfe86c5da44466dd58fe5d4
Merged-In: I4b8c06912d2c0b2c5be5bce8b217d45accf34d4b
Fixes: 35926028
Test: Settings Robotest
2017-04-06 13:57:00 -07:00
Daniel Nishi
f588f7678d Add a movies & tv apps category to storage settings.
Change-Id: I055e93d2a151195b90a5fd64f4fddebbbcffef59
Merged-In: Idfabe83739272b19cbef4b13a82339170f8f97b3
Fixes: 36223441
Test: Settings Robotest
2017-04-06 13:36:12 -07:00
Doris Ling
ad69c46712 Merge "Add summary text to Display->Brightness level." into oc-dev 2017-04-06 20:03:24 +00:00
jackqdyulei
fefdd5d47f Fix crash when clicking item in Battery screen
"last full charge/Screen usage since full charge" goes crash when
clicking on it. This is because The default behaviour for
PowerGaugePreference is to start detail page and the above two items
are PowerGaugePreference.

This cl set these two items as non-selectable.

Bug: 37080048
Test: make -j40 SettingsTest
Change-Id: Ide4e151dcd0b44fb795a5753c91f2197b2a24a56
2017-04-06 12:52:50 -07:00
Doris Ling
4bbfdb13e7 Merge "Update summary for Connected devices->Printing." into oc-dev 2017-04-06 18:35:53 +00:00
Doris Ling
28e35fcf05 Merge "Update Wifi off summary text." into oc-dev 2017-04-06 17:04:45 +00:00
Christine Franks
c50403c606 Prevent apps from displaying over Settings
Specifically, the DrawOverlayDetails fragment only.

Bug: 36070413
Test: make RunSettingsRoboTests -j100
Change-Id: I0069f0cacf8c963c8c6878dc89a32b205983a568
2017-04-05 17:55:24 -07:00
TreeHugger Robot
418e5bffda Merge "Fix crash when opening battery page" into oc-dev 2017-04-05 22:45:46 +00:00
TreeHugger Robot
f297e843e9 Merge "Ui changes in battery main page" into oc-dev 2017-04-05 22:13:01 +00:00