Commit Graph

234 Commits

Author SHA1 Message Date
Fan Zhang
75bee9bf98 App header cleanup
- Refactor the entity header layout to use LinearLayout and add id to
  content area
- Remove now unused AppHeader class
- Make entire icon+text area clickable and link to app info page
  Refactor the binding logic from bindButton to its own method.
- Remove unused MultiLinePreference

Fix: 62705377
Test: make RunSettingsRoboTests

Change-Id: I6db554695410e71b669f6fdba29d98fedc3364b9
2017-07-06 13:23:38 -07:00
jackqdyulei
3fb054f3d3 Display anomaly in battery usage page
This cl adds a new parameter, mAnomalies, for
AdvancedPowerUsageDetail.

If it is null, fragment will start AnomalyLoader to detect anomaly.
If not null, just display the anomaly.

Bug: 36925180
Test: RunSettingsRoboTests

Change-Id: I572bc5954c1cdb210d18b6dbe1ab9dba25c0a61f
2017-06-15 10:44:34 -07:00
jackqdyulei
210110f4ed Restart loader in onResume
We need to refresh batterystatsHelper in onResume, so we need to
call restartLoader instead of initLoader

Bug: 62237848
Test: RunSettingsRoboTests
Change-Id: I6f7e1b57b945c92d34587ca24db192600e7f797f
2017-06-01 15:57:08 -07:00
Fan Zhang
a45f3d2f33 Add method to disable "disable" button in installed app UI
OEMs can now force grey out the "disable" button for important apps on
device.

Change-Id: Ic075a07ad12592bd60238c7b1c9ab84932c8db3c
Fix: 38250742
Test: make RunSettingsRoboTests
2017-05-31 11:53:29 -07:00
jackqdyulei
2a95a63466 Make "Battery usage" accessible at any time
Before this cl, user could go to "Battery usage" page only if
related app has battery usage. This cl breaks this rule so we
could open "Battery usage" without battery data.

Bug: 38497822
Test: RunSettingsRoboTests
Change-Id: Ic53c33b7dcbac82de58f31cf96e0bd8fa54e53ea
2017-05-23 13:30:15 -07:00
Lei Yu
6784e41977 Merge "Use BatteryStatsLoader in InstalledAppDetails" into oc-dev am: 37f6b7f751
am: 996adfeb29

Change-Id: I11d0c39a68428637ce12aaffaa2a4f1e49bb716e
2017-05-23 06:23:31 +00:00
jackqdyulei
013d3f6342 Use BatteryStatsLoader in InstalledAppDetails
InstalledAppDetails uses AsyncTask to update foreground mBatteryStatsHelper
in background thread, which is dangerous. This cl make
InstalledAppDetails use BatteryStatsLoader to update batteryStatsHelper
and only assign it once in UI thread.

Bug: 38497555
Test: RunSettingsRoboTests
Change-Id: I3078b60a2dae36995ae5f925b4d49e36e79bddfd
2017-05-22 17:39:19 -07:00
Fan Zhang
841d1d5aab Show shadow when entity header starts scrolling.
- Add a controller to manage add/remove onScrollChangedListener to
  recyclerviews.
- When recyclerview on each screen is scrolled to top, set actionbar
  elevation to 0, otherwise set it to non-zero.
- When screen is moved to background, detach the listener.
- Use the controller in entity header.

Change-Id: Iecf194d885098c98c392810f62893ae9189f3936
Fix: 37670670
Test: make RunSettingsRoboTests
2017-05-22 17:16:24 -07:00
Fan Zhang
d7414259d0 Move entity header controller out of application package.
Bug: 37669238
Test: rerun robotests
Change-Id: I54eb30f28fa0a88a6f0b97b53f9f1408320b5ce0
2017-05-18 16:36:32 -07:00
Fan Zhang
f5bd885a1d Clean up settings_entity_header layout.
update layout view IDs, and controller variable names to be more
generic.

Fix: 36734470
Bug: 37669238
Test: make RunSettingsRoboTests
Change-Id: Ib80827ae3eae6d01a600068b4a8a44b239c32511
2017-05-18 16:35:27 -07:00
Fan Zhang
2ed0f99989 Rename app_details to entity_header
Bug: 37669238
Test: rerun robotests
Change-Id: Iab2cdf83d8b35ce3d45b0c413cad8614d44d5ed3
2017-05-17 18:17:20 -07:00
Fan Zhang
8e0754e84c Correctly report whether the current app is default home.
Change-Id: I79c374228e82c91667d7b5a0dcc19fa1216e57c4
Fix: 38065524
Test: make RunSettingsRoboTests
2017-05-15 10:17:37 -07:00
Doris Ling
93be46ce5e Refresh the App Info option menu after unintalling app updates.
When we are done uninstalling app updates, invalidate the options menu
so that it will be rebuilt and the correct available menu items will be
shown.

Change-Id: I485fe9ff129ac0b2d75094c3b899bf6553e54c74
Fix: 36407258
Test: make RunSettingsRoboTests
2017-04-26 16:35:38 -07:00
Fan Zhang
f6126e7a00 Fix ANR in installed app details.
InstalledAppDetails tries to refreshUi whenever something about a
package changes. It does not need to refresh when the changing package
is different from what's being displayed.

Change-Id: Ib45289c39ee402cf8974bf52c881f44d225b8be5
Fix: 37424866
Test: make RunSettingsRoboTests
2017-04-24 21:51:32 -07:00
Fan Zhang
dcc0af50c6 Remove deep link to app store from app header.
The link doesn't actually work and uses wrong icon. There is a working
version at the app info screen already.

Change-Id: I16890bd66e095c3185e12d604d8daba5036ab24c
Fix: 37544209
Test: robotests
2017-04-20 13:45:23 -07:00
Fan Zhang
be6fab0135 Update action bar style in app header UI.
- Update background color of actionbar
- Remove elevation of actionbar so it appears to be the same entity as
  app header.
- Add a shadow below app header view. We can't set elevation on app
  header unfortunately because that will add shadow all round the view,
  but we only want shadow below it.
- Updated app icon size/text size per to match UI spec.

Change-Id: I63d7fa42b859a008fa662aaf19848cd40529c2ff
Fix: 37207527
Fix: 37079248
Test: visual && make RunSettingsRoboTests
2017-04-17 09:30:40 -07:00
TreeHugger Robot
0f34680fe0 Merge "Instant apps show supported links not open default" into oc-dev 2017-04-14 00:41:01 +00:00
Jesse Evans
edc5099e89 Instant apps show supported links not open default
On the app info page, instant apps show only the supported links
dialog rather than Open by default which opens in a secondary page
where the user can control things that aren't relevant to instant
apps.
Test: make RunSettingsRoboTests
Bug: 36497697
Change-Id: If4eba7c11c5490cbda1ef617002121fe108c4085
2017-04-13 15:17:41 -07:00
TreeHugger Robot
28371d9c9e Merge "Instant apps should not say App Installed by" into oc-dev 2017-04-13 19:36:53 +00:00
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
Jesse Evans
de4e056449 Instant apps should not say App Installed by
Changes the text on the app installer details to say
"More info on {App Store Name}".

Test: make RunSettingsRoboTests
Bug: 36512295
Change-Id: I8629f840e9f4e5ce12ba91e9cb9def0db0471162
2017-04-12 07:02:19 -07:00
Lei Yu
bde7097fb9 Merge "Remove PowerUsageDetail.java" into oc-dev 2017-04-07 01:34:37 +00:00
TreeHugger Robot
418e5bffda Merge "Fix crash when opening battery page" into oc-dev 2017-04-05 22:45:46 +00:00
Daniel Nishi
4c52af621a Merge "Lower case the first letter of storage type." into oc-dev 2017-04-05 22:06:55 +00:00
jackqdyulei
ae01ef5906 Remove PowerUsageDetail.java
Now we use AdvancedPowerUsageDetail instead.

This cl also:
1. Remove PowerUsageDetail in SearchIndexableResources since we
don't want to index PowerUsageDetail
2. Add AdvancedPowerUsageDetail in SettingsGateway

Bug: 36992358
Test: Build
Change-Id: I598bb159aa2b5a4889071ae9a17d29554e6afe11
2017-04-05 14:20:06 -07:00
jackqdyulei
cdbc114376 Fix crash when opening battery page
The settings crashes when opening battery usage detail page from
installed app page. Main reason is that it trying to open obsolete
page. This cl directs it to open AdvancedPowerUsageDetail instead.

Following cl will make InstalledAppDetail show calibrated percentage,
which is trakced in b/36816681

Bug: 36792973
Test: RunSettingsRoboTests
Change-Id: Ie63e64e543ed3b28974ffdda8b42c97e7749a0f7
(cherry picked from commit fac713318c)
2017-04-05 14:12:26 -07:00
Jesse Evans
5c9f7a88b4 Adds the Clear App dialog for Instant Apps
Adds a confirmation dialog for the user when tapping clear app.

From this dialog the user can either cancel, or confirm they
want to clear the app.

Test: make RunSettingsRoboTests

Bug: 36536695
Change-Id: Idffcf5ef318578ae2e075ea2cbb35323d41acade
2017-04-04 08:30:38 -07:00
Jesse Evans
15c7f5fda4 Removes summary text from Instant Apps details
Test: Robolectric test to ensure header item is GONE.

Bug: 36512295
Change-Id: I020e90d6521c853e67ae600e5786445a8469a934
(cherry picked from commit 14a258443f)
2017-03-31 02:27:53 +00:00
Daniel Nishi
45c42b2c70 Lower case the first letter of storage type.
In the app details, the first letter of the storage type was
capitalized, causing an odd string of "X used in Internal storage."

Change-Id: Ibcac54259403f6d0f39df8fa2d3af10304a46057
Merged-In: I2b4f23ea1799dc1730fdab596e4a87a0cb673c68
Fixes: 36001265
Test: Settings robotest
2017-03-30 13:31:57 -07:00
TreeHugger Robot
f85ebb24bb Merge "Changes to installed app details screen for instant apps" 2017-03-28 01:22:47 +00:00
Antony Sargent
09955c3865 Changes to installed app details screen for instant apps
Bug: 35098444
Test: make RunSettingsRoboTests

This implements the following changes to the app details screen:

-Suppresses the "Uninstall" and "Force Stop" buttons
-Adds "Install app" and "Clear app" buttons
-Adds a mechanism for showing a link to the store's app details
 page that can be different from the default for installed apps.

Change-Id: Icea83f7d1fde62d4101cb0c8a6d03849f6c56bca
2017-03-27 14:34:56 -07:00
jackqdyulei
ddba966700 Revamp the battery usage details page.
This cl adds AdvancedPowerUsageDetail to show the usage details page.
The AdvancedPowerUsageDetail contains all the needed ui components:
1. App Header
2. Two buttons
3. Usage breakdown preference category
4. Power management preference category

This cl also adds preference controller for two buttons but the
detail implementation will be added in the following cl.

Following cl will also remove previous detail page.

Bug: 35810915
Test: RunSettingsRoboTests
Change-Id: I17f95d1288762094671c0f148fa73367e51f175e
2017-03-24 20:58:44 -07:00
Winson Chung
217d0e9d23 Update picture-in-picture settings to match mocks.
- Removing switches in top-level picture-in-picture settings, adding
  details screen for each app which contains the switch and some
  additional information.

Bug: 35957404
Test: make -j40 RunSettingsRoboTests
Change-Id: Ib22df8a52ab857e071ec43dd3e5d1f5282db35cb
2017-03-20 17:19:30 +00:00
Fan Zhang
c49ab99007 Add misc logging:
- Button clicks in app detail page:
  uninstall/disable/clear data/clear cache
- More logging in search:
  log inline search result click, and its metadata such as
  name/value/rank.

Fix: 32652772
Fix: 32798201
Test: make RunSettingsRoboTests
Change-Id: I90cef7c9ea9ea69ea9cf083013a38417097f8594
2017-03-13 16:30:55 -07:00
TreeHugger Robot
dde06062f4 Merge "Move the action buttons in installed app detail page in the preference xml." 2017-03-08 00:30:14 +00:00
Doris Ling
cb22870aa1 Move the action buttons in installed app detail page in the preference xml.
- instead of dynamically creating the preferences for the action
buttons, add the actions items to the installed app details xml.
- rename the reference as it is no longer a footer.

Change-Id: I41b99f50bcc4916384555b5d9470ac937ff1d2ac
Fix: 36001501
Test: make RunSettingsRoboTests
2017-03-07 14:52:02 -08:00
Fan Zhang
1f81d10dc5 Fix a crash when opening uninstalled app detail page
Change-Id: I417e7eb6f9c857ace4e8047b226abe03a7c8248d
Fix: 36027848
Fix: 34392538
Test: make RunSettingsRoboTests
2017-03-07 13:24:31 -08:00
TreeHugger Robot
e0b65fce67 Merge "Remove code that check for dashboard feature." 2017-03-07 20:57:28 +00:00
Doris Ling
f2cf2aea37 Remove code that check for dashboard feature.
- remove DashboardFeatureProvider.isEnabled() and all relating code
and tests.

Bug: 35764802
Test: make RunSettingsRoboTests
Change-Id: If7796677abc8904b7436525836d50cdef38e37a4
2017-03-07 11:15:03 -08:00
Daniel Nishi
ad7aa871e7 Fast track the installed app details storage.
Change-Id: Ic96a7b4bea6d92a32669887dacbc1f4e54e25ea9
Fixes: 35805032
Test: Settings robotest
2017-03-06 13:55:00 -08:00
TreeHugger Robot
2f7d8bc086 Merge "Adding "Install Other Apps" in App Info page" 2017-03-04 00:39:22 +00:00
Suprabh Shukla
86d52db588 Adding "Install Other Apps" in App Info page
Added a preference link to manage external sources in the app info
screen just like other special access permissions.

Test: Manually checked that the link appears on apps once their app op
is set to allow or deny.
Also, added some basic robolectric unit tests:
make -j32 RunSettingsRoboTests

Bug: 35481942
Change-Id: If687778b7a64fb7d278508b78d06272253a98e3e
2017-03-03 14:46:16 -08:00
Roger Xue
df0477bbba Merge "move PermissionsSummaryHelper into SettingsLib to share with car settings Bug: 34679894 Test: make RunSettingsRoboTests -j128 Change-Id: I53a3f3d8d2a05b33d2cff52a06236dd7d31dbe63" 2017-03-03 17:06:59 +00:00
TreeHugger Robot
a9ee4e8649 Merge "Show uninstall for all users option menu in app info." 2017-03-03 04:19:07 +00:00
roger xue
42cce1e610 move PermissionsSummaryHelper into SettingsLib to share with car settings
Bug: 34679894
Test: make RunSettingsRoboTests -j128
Change-Id: I53a3f3d8d2a05b33d2cff52a06236dd7d31dbe63
2017-03-02 16:12:29 -08:00
Doris Ling
2508ed56ca Show uninstall for all users option menu in app info.
- when there is only 1 user installed the app, also check if it is
installed by the current user or by other user to determine whether or
not to show the uninstall for all button.

Change-Id: I1eecb13a7748c92159cb0626e2b6fe1ed6987d15
Fix: 34760157
Test: make RunSettingsRoboTests
2017-03-02 13:30:59 -08:00
Antony Sargent
d06aaa8fd0 New design for instant apps in app details header
Bug: 35098444
Test: make RunSettingsRoboTests

In the previous design for instant apps, some metadata about the app
such as developer title, maturity rating, etc. was going to be shown
in the app header. In the latest design, we instead are just showing
a little label that says "Instant app".

The two CL's for this topic work together to change this:

frameworks/base : adds code to work around the problem that
robolectric doesn't know about the new isInstantApp method of the
ApplicationInfo class, so we need to avoid calling it during tests.

pacakges/apps/Settings: removes the code that previously displayed
the instant app metadata, and instead just insert the "Instant app"
label.

Change-Id: I2cbc70bf4827c401e862c58ea4ca7f8f9ba1cf58
2017-02-28 14:30:05 -08:00
Fan Zhang
20c5812a65 Add logging to trace when force stop button is clicked
Bug: 35633637
Test: manual
Change-Id: If7bcf7a3265d1eb75b7f58337f4757dfcbb0ba2f
2017-02-21 17:49:12 -08:00
Fan Zhang
6786d8cd53 Mark only browser as default in app detail page
Change-Id: I8112d859ba788a1dc67c44b5e0de668c0fc13169
Fix: 35307728
Test: make RunSettingsRoboTests
2017-02-16 14:32:05 -08:00
TreeHugger Robot
0f28cbd21b Merge "Modify text in Apps & notifications settings." 2017-02-16 05:25:44 +00:00