Commit Graph

1557 Commits

Author SHA1 Message Date
jackqdyulei
01e690e377 Only use PROCESS_STATE_TOP as foreground time.
There are some miscalculations in state FOREGROUND_SERVICE and
FOREGROUND, so we move them out of the foreground time for now.

We will fix it after O and may add them back later.

Bug: 37000096
Test: RunSettingsRoboTests
Change-Id: Ic3f2f7fa69e8a213895c601630d1cca94fd32220
2017-05-05 10:23:09 -07:00
Fan Zhang
daad10b428 Change the logic for showing "App info" vs "show more"
Fix: 33265548
Test: robotests

The old logic shows "show more" when there is any recent app, new logic
first checks if there is any displayable recent app. Otherwise go back
to display "app info".

Change-Id: I485725eaa025b9e2cfffc5e9e1923aa771bb0e12
2017-05-05 09:39:24 -07:00
TreeHugger Robot
910f69c62a Merge "Add ability to speak to provider for enhanced estimate" 2017-05-05 04:50:14 +00:00
TreeHugger Robot
78a3f9a748 Merge "Fix randomly showing anomaly icon" 2017-05-05 03:13:58 +00:00
Salvador Martinez
126c032afa Add ability to speak to provider for enhanced estimate
Added code that checks if the provider for the enhanced battery
drain estimate is available. If it is available we use that
value instead of the one computed by BatteryStats.

Test: Robotests
Bug: 37753227
Change-Id: I7eae01b56f85d33eafc42ee0f18bb752779581b2
2017-05-04 20:05:53 -07:00
TreeHugger Robot
161e356de4 Merge "Limit the summary text for App info->Permissions to one line." 2017-05-05 02:22:50 +00:00
TreeHugger Robot
81586b5681 Merge "Add impl for force stop action" 2017-05-05 01:27:24 +00:00
jackqdyulei
3bd2420911 Fix randomly showing anomaly icon
Sometimes PowerGaugePreference will show anomaly icon when they
shouldn't. I think it is because PreferenceViewHolder has cache
about the previous data.

This cl fixes it by setting compound drawable as 0 when
showAnomalyIcon is false.

Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: I5ea0dc307aafcce386c84963e618d1213de5ec19
2017-05-04 18:08:31 -07:00
Doris Ling
e249c00a3c Limit the summary text for App info->Permissions to one line.
- the summary text is the list of permissions that the app has. It is
dynamic, and when the list is long, setting the summary will expand
the text view height and make the page launch looks janky. We cannot
pre-set the summary to certain line, since the permissions list for each
app is unknown beforehand. To avoid the jank, limit the summary to 1
line and truncate it if necessary.

Change-Id: I1acb1ac9f46c55808ce03626e53cf71502231ab2
Fix: 36413664
Test: make RunSettingsRoboTests
2017-05-04 23:20:32 +00:00
Daniel Sheng
7b9e3fdd08 Camera lift preference now saves correctly
Bug: 37751057
Test: manual + make RunSettingsRoboTests

Fixed issue where camera lift preference was saving the opposite value
of what it was supposed to. Added test to cover saving of value on
preference change.

Change-Id: I2d2c454eb478afb7f73519f9f05c9a9a1933938b
2017-05-04 15:14:39 -07:00
Daniel Nishi
8381755263 Fix Settings crash in Storage settings.
If you tap aggressively before the fragment has fully initialized, it
was possible to NPE. This null-checks to avoid this.

Change-Id: I3488245d230cf1e16b23e34614c8e6b43ea14ff1
Fixes: 37945253
Test: Robotest
2017-05-04 14:12:45 -07:00
jackqdyulei
66242d0e3d Add impl for force stop action
Also refactor the AnomalyAction so it could take source id as
a parameter, which represents the fragment that invokes it.

Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: Ib53865f92e1a6f1e9dcc1480c0c74fbcfb0226f4
2017-05-04 10:37:42 -07:00
jackqdyulei
3dbd77e5ae Add control for the anomaly detection
Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: Id71b1324f567e7aa9b51dc25247fff9151d4e108
2017-05-04 10:11:54 -07:00
Lei Yu
5a24c1b84c Merge "Add icon in PowerUsageAnomalyDetails" 2017-05-04 16:56:21 +00:00
Fan Zhang
6db910ab85 Merge "Skip "null" string when building advanced button summary" into oc-dev am: e4eb65c00e
am: d8b6244d82

Change-Id: I0ea1c236ee55c1bb784a39bc8a4990d47616397b
2017-05-04 16:20:46 +00:00
Fan Zhang
e4eb65c00e Merge "Skip "null" string when building advanced button summary" into oc-dev 2017-05-04 16:12:27 +00:00
Amin Shaikh
dec19d10c2 Show "Forget" button for ephemeral networks.
- Move forget button preference handling logic to
WifiDetailPreferenceController
- Remove unnecessary updateInfo call in onResume since
NETWORK_STATE_CHANGED_ACTION is a sticky broadcast
- Populate network state fields and set up initial wifi state
when the Preference is displayed instead of waiting for onResume

Bug: 37751816
Test: m RunSettingsRoboTests && manually tested on device
Change-Id: I509013c72a0d26fc9a3feca564d92a0ab8414d1e
2017-05-03 21:17:25 -07:00
Lorenzo Colitti
23671e84ba Merge "Add a "sign into network" button to the wifi details page." into oc-dev am: 33b0104cfc
am: fdd0f1e141

Change-Id: I528df44eb284ca162ba5daf937aa8a020d65bc4c
2017-05-04 02:15:09 +00:00
Lorenzo Colitti
33b0104cfc Merge "Add a "sign into network" button to the wifi details page." into oc-dev 2017-05-04 02:06:50 +00:00
Android Build Merger (Role)
b1726776c6 Merge "Merge "Update "Phone idle" subtext" into oc-dev am: 3a1d6db0e7 am: 85950d5ebd" 2017-05-04 01:28:52 +00:00
jackqdyulei
5c39601738 Merge "Update "Phone idle" subtext" into oc-dev am: 3a1d6db0e7
am: 85950d5ebd

Change-Id: I0d3d67b274242f72fa46c157c7cee883a476a2e2
2017-05-04 01:28:37 +00:00
Android Build Merger (Role)
6502eba7e0 Merge "Merge "Fix null pointer exception in wifi settings" into oc-dev am: eb6eb99a56 am: 11853a75e3" 2017-05-04 01:28:31 +00:00
TreeHugger Robot
6c4f768e0e Merge "Add anomaly icon for PowerGaugePreference" 2017-05-04 01:28:21 +00:00
Glen Kuhne
f791573f95 Merge "Fix null pointer exception in wifi settings" into oc-dev am: eb6eb99a56
am: 11853a75e3

Change-Id: I220e8f46313c3ede6a183c6485002f3b9e921df5
2017-05-04 01:28:07 +00:00
TreeHugger Robot
3a1d6db0e7 Merge "Update "Phone idle" subtext" into oc-dev 2017-05-04 01:11:24 +00:00
TreeHugger Robot
eb6eb99a56 Merge "Fix null pointer exception in wifi settings" into oc-dev 2017-05-04 01:04:50 +00:00
jackqdyulei
f80eaf73d9 Add icon in PowerUsageAnomalyDetails
Also add icon size in AnomalyPreference so it won't be too large.

Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: I124e99eba295d6600ffc73c05f73dd3c5c9de158
2017-05-03 17:02:18 -07:00
Jeremy Joslin
5231a159c7 Merge "Allow "None" to be selected as a Network rating provider." into oc-dev am: b8eb78b321
am: 91dd31d722

Change-Id: I800795ed106e38feba9682c6d1f5ae8179c87a11
2017-05-03 23:13:42 +00:00
jackqdyulei
4cb19e74b3 Add anomaly icon for PowerGaugePreference
When the app contains anomaly, we should show anomaly icon(triangle
alert).

This cl also extracts a new method refreshAppListGroup from refreshUi.
New method is used to only refresh appListGroup. Reason for this action:

1. Improve performance(partial refresh)
2. We init AnomalyLoader in refreshUi, invoke refreshUi in
onLoadFinish will create infinite loop.

Bug: 36924669
Test: RunSettingsRoboTests
Change-Id: If54c89349e21763ca714123ac6ae884bd0f6a377
2017-05-03 16:01:55 -07:00
TreeHugger Robot
b8eb78b321 Merge "Allow "None" to be selected as a Network rating provider." into oc-dev 2017-05-03 22:57:16 +00:00
Glen Kuhne
3c5bd235f3 Fix null pointer exception in wifi settings
Fixes a null pointer exception that can occur during setup wizard.

Bug: 37873425
Test: make RunSettingsRoboTests -j40 ROBOTEST_FILTER=WifiConfigControllerTest
Change-Id: I40de883fae6ccde13ad264f9b8b2d9da9745eb24
2017-05-03 15:53:16 -07:00
TreeHugger Robot
b45a9fe0a9 Merge "Add recent apps in app & notification" 2017-05-03 22:52:24 +00:00
jackqdyulei
995ca362c9 Update "Phone idle" subtext
Bug: 37897135
Test: RunSettingsRoboTests
Change-Id: I38a63ef9fdf574ba277ed889e7e070c36ae14b01
2017-05-03 15:27:50 -07:00
TreeHugger Robot
a2f6a7c2e2 Merge "Add title and summary for "High usage" pref." 2017-05-03 22:20:11 +00:00
Fan Zhang
540023608d Skip "null" string when building advanced button summary
- Also added help string to SoundSettings as a side fix.

Change-Id: Ia81a46c6e199b72b52ae1fa9d996c094193b506c
Fix: 37933524
Test: robotests
2017-05-03 15:05:22 -07:00
TreeHugger Robot
c43b09a22c Merge "Fix a typo in the launch intent for emergency info." 2017-05-03 22:01:32 +00:00
fanzhang172
ae2f2b5268 Add recent apps in app & notification
- Introduce a RecentAppsPreferenceControler, which queries
  UsageStatsManager and displays a list of recently used apps.

- Add a control flag for this feature, intially set to false.

- Make ManageApplications a static pref item instead of dynamic one.
  This makes the RecentAppController easier to control "See all"
  preference, which is backed by ManageApplications.

- Also adjust app_items.xml layout to make app item UI consistent with
  preference item.

Change-Id: I0b9e1784faed32b3055ebf96ef98b6a5e422de50
Fix: 33265548
Test: robotests
2017-05-03 14:09:43 -07:00
Daniel Nishi
c90502627b Merge "Always use GB as the unit in Storage Settings." into oc-dev am: 833927929e
am: f917c0aa24

Change-Id: I632e27fe03241818447998464e1bdbfe96f4c6e5
2017-05-03 18:09:27 +00:00
Daniel Nishi
1ec0f84f43 Merge "Don't overly hide the Files preference." into oc-dev am: 0c58fbd345
am: 169fd4693f

Change-Id: I5328da37f430703540cb067256984ebafbe4ff59
2017-05-03 18:09:00 +00:00
Daniel Nishi
833927929e Merge "Always use GB as the unit in Storage Settings." into oc-dev 2017-05-03 18:00:19 +00:00
Daniel Nishi
0c58fbd345 Merge "Don't overly hide the Files preference." into oc-dev 2017-05-03 17:59:08 +00:00
jackqdyulei
59bc0cc7e7 Add title and summary for "High usage" pref.
The logic for this pref lives in AnomalyPreferenceController.

Bug: 36924669
Test: RunSettingsRoboTest
Change-Id: Ib88d8e76e1af8a2270fcb671baf55e9f6564b96e
2017-05-03 10:48:13 -07:00
Maurice Lam
14d24c998e Merge "Include com.android.settings CodeInspectorTest" 2017-05-03 16:21:32 +00:00
Lorenzo Colitti
b6245156f6 Add a "sign into network" button to the wifi details page.
Bug: 36203355
Test: manually signed into captive portal
Test: make -j64 RunSettingsRoboTests
Change-Id: I3242ef30125ddfdaaac9b80ead4f8ac14ea6d364
2017-05-03 22:14:08 +09:00
Maurice Lam
b6da1d5b3f Include com.android.settings CodeInspectorTest
Don't ignore classes directly under the package com.android.settings
in CodeInspectorTest.

Test: cd tests/robotests && mma
Change-Id: I4a6b00231839729405dd96a270e2dcbfef3b73c4
2017-05-02 22:12:09 -07:00
jackqdyulei
4dd126845b Merge "Hide subtitle for wifi and bluetooth" into oc-dev am: 4b50e58a1d
am: 09adbd2f3b

Change-Id: I2d620d2fecf016434886ef67a5fa88128f722a6d
2017-05-03 02:31:43 +00:00
TreeHugger Robot
4b50e58a1d Merge "Hide subtitle for wifi and bluetooth" into oc-dev 2017-05-03 02:18:53 +00:00
Juan Lang
5eb496e714 Fix a typo in the launch intent for emergency info.
The EmergencyInfo app accepts either launch target for now. After this
is submitted, the misspelled one can be removed.

Test: Manually test that the Settings app still launches the
EmergencyInfo app. Reran unit tests.

Change-Id: I923468dbe9825e85b021f5ea64ee2877fd02f262
2017-05-02 17:33:10 -07:00
jackqdyulei
55a97a9ad4 Add abnormal app page for battery settings
1. Add abnormal app page
2. Add strings for abnormal app page
3. Change AnomalyPreferenceController to open abnormal app page,
when there are more than one anomaly.
4. Add AnomalyPreference, who stores a reference of anomaly.

Also rename AnomalyPreferenceController to
AnomalySummaryPreferenceController because this controller is not
used to handle AnomalyPreference.

Following cls will add summary and icon for each abnormal app.

Bug: 37681665
Test: RunSettingsRoboTests
Change-Id: I4266f906476ff8daccd962572c8cfa99f948080a
2017-05-02 15:59:22 -07:00
Daniel Nishi
f7fa542eb6 Don't overly hide the Files preference.
This occurred this because the files preference was initialized during
displayPreference(), but the volume used to initialize it was not being
set until after the displayPreference() call. In this case, the files
preference would hide itself and never come back.

This fixes this by double-checking the Files visibility status whenever
we set the volume.

Change-Id: I0b1a7a9566e9caece39ec58706fbca034ef4c1c2
Fixes: 37790776
Test: Settings robotest
2017-05-02 15:42:55 -07:00