Commit Graph

203 Commits

Author SHA1 Message Date
Fan Zhang
9834bd82da Update strings in special app access and dev options
- Change all yes/no or on/off strings in special app access to
  Allowed/Not allowed
- Remove some dead code in related files
- Add a toast string in DevelopmentSettingsDisabledActivity to prompt
  user enable dev options before use.
- Add search in SpecialAccessSettings

Change-Id: I8b2535e037a86e76bdbcd3fb6e1cf2e0347bedbf
Fix: 38290299
Fix: 37469224
Test: make RunSettingsRoboTests
2017-05-15 13:22:51 -07:00
Daniel Nishi
31de4c1766 Merge "Fix a bug where override filter was always on." into oc-dev am: 408fd90102
am: 7d50d9db12

Change-Id: Ie9e9b3978e7a2f52fdd63e203a740068188dc285
2017-05-04 17:38:31 +00:00
Daniel Nishi
bf1f93698e Fix a bug where override filter was always on.
Change-Id: I1df52f13d8e335362d2eec18c968227ed9ecf299
Fixes: 37952170
Test: Settings unit test
2017-05-03 17:31:21 -07:00
Daniel Nishi
cbeebe1b6c Merge "Filter on volume for category storage view." into oc-dev am: a41a190ac3
am: 854acc9e4b

Change-Id: I21c985df9ee34981b47c080756df5dc442f335b6
2017-05-02 17:09:37 +00:00
Daniel Nishi
5aeb6c4fab Filter on volume for category storage view.
The other storage view used a compound filter with a UUID filter and the
normal filter. The category filters were omitting the compound UUID
filter. This adds it.

Test: Settings unit test
Change-Id: Ic0118abf58dabbf430a81e1fbcefb7acfdef472c
Fixes: 37780836
2017-05-01 15:42:50 -07:00
Jesse Evans
b519b67684 Make instant apps appear above disabled apps am: b2d85af91e
am: f52bfd03ea

Change-Id: I1b58da2932103f9879d3eb84c7b55aea2b208509
2017-05-01 17:09:22 +00:00
Jesse Evans
b2d85af91e Make instant apps appear above disabled apps
Currently instant apps appear below disabled apps in the app filter
spinner, this is incorrect. This patch moves them above the disabled
apps filter option.

Test: make RunSettingsRoboTests
Bug: 37683262
Change-Id: Id65ae47baca4eac43a6a89375bdb718d5dbf7c56
2017-05-01 07:33:25 -07:00
Fan Zhang
d1c41a3064 Only show "reset app preference" actionbar menu in app info
Because it doesn't make sense to show it in other types of app
list view.

Change-Id: Ia4f84812a6f0acc434f770b026e5ed550714087a
Fix: 36110694
Test: robotests
2017-04-28 11:47:54 -07:00
Sunny Goyal
3b172d7b89 Using a common class for loading drawables and handling various badging
Test: make RunSettingsRoboTests -j31
Bug: 36591157

Change-Id: I4cb1d313920d5d8604fd79ff65b40e2dda180e2e
2017-04-18 21:34:13 +00:00
Daniel Nishi
c365a8735c Merge "Add a movies & tv apps category to storage settings." into oc-dev 2017-04-13 18:39:58 +00: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
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
Jesse Evans
804854cdfe Removes instant apps from certain screens
Removes instant apps from the Special Access screens, as well as
notifications.

Test: make RunSettingsRoboTests
Bug: 36515324
Change-Id: I5b2f0ee3219acd89e2cbdcefed4d9608450395c0
(cherry picked from commit 1c9b6092ee)
2017-04-04 08:34:57 -07:00
Bartosz Fabianowski
1fca17ce2e Device management info: Refer to current user, not primary user
The device management info page should show information about the
current user's policies, not the primary user's.

Bug: 32692748
Test: m RunSettingsRoboTests

Change-Id: I5d8afa7fae1c0f3a4da78b085365882827e6721b
(cherry picked from commit b836da263d)
2017-03-31 09:26:12 +00:00
Denis Kuznetsov
0c88ff4ed9 Update List of apps on device string,
remove "XX apps" string.

Bug: 32692748
Test: m RunSettingsRoboTests
Change-Id: I64f833497b5362f95cfc56a1057d97d9539ff029
2017-03-24 13:00:49 +01: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
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
Antony Sargent
5ac2e138b1 Merge "Fix app filter breakage caused by ag/1900403" 2017-02-27 16:55:36 +00:00
Antony Sargent
16e6eced00 Fix app filter breakage caused by ag/1900403
Bug: 35726115
Test: manual, run existing robo tests by make RunSettingsRoboTests

In ag/1900403 I renumbered the int constants in ManageApplications.java
to remove a gap in the sequence without realizing that the arrays
containing strings/filters based on these constants still contained
entries for the constant whose value was removed.

In this CL I've fixed that and reorganized the initialization code slightly
to make it easier to keep things in sync going forward.

Change-Id: I6d2db6499fb7eb080570bc757bde497fcd39fead
2017-02-24 16:05:30 -08:00
Doris Ling
b8642c7464 Fix issue with app info summary for diasbled app.
- also check the component enable state to determine whether an app is
really enabled or not.

Change-Id: I8075ec9253b9136c58fc206e10b10f77b1efe6c2
Fix: 35673125
Test: make RunSettingsRoboTests
2017-02-24 10:36:23 -08:00
Daniel Nishi
e3ac0cd6db Use the upstreamed StorageStatsSource wrapper.
This was upstreamed into SettingsLib when similar wrappers
started showing up in other projects. Settings, however, was
using the non-upstreamed version.

Change-Id: Iffadb75655165d3b64a25fd7b21e5b9765cb40be
Fixes: 35680800
Test: Settings Robotests still pass despite the data swap out.
2017-02-22 17:49:41 -08:00
Antony Sargent
4cf650b6b7 Merge "Add "Instant apps" filter to app listing" 2017-02-22 18:40:44 +00:00
Daniel Nishi
e0eb1a2e27 Add metric events triggers for new storage actions.
Bug: 35063738
Test: Settings Robotests
Change-Id: I435cb16c492d3777e735266c2d3a2b1930443acb
2017-02-16 13:43:03 -08:00
Daniel Nishi
ce82b66136 Merge "Fix a race condition where the extra view may not update timely." 2017-02-16 17:39:40 +00:00
Fan Zhang
c6ca314c0b Log source with visibility change
- Add a method in VisibilityLoggerMixin to log visible event using
  LogMaker, which allows logging additional FIELD_CONTEXT field.
- In Utils.startFragment, add current page's metricsCategory as an extra
  to next page.
- In next page's onResume(), extract the previous page's metricsCategory
  and send it to VisibilityLoggerMixin.visible()
- Update all caller with additional paramters

Change-Id: I8e1f2597fa465b7d3aa16fa1d21c052a3219694a
Fix: 35359289
Test: RunSettingsRoboTests
2017-02-15 17:17:19 -08:00
Antony Sargent
05e8dfde9d Add "Instant apps" filter to app listing
Bug: 35098444
Test: automated testing of ManageApplications is hard (b/34768986), so
testing is manual for now: install at least one instant app and then go to
Settings->Apps&Notifications->Apps and see if the filter lets you see
only instant apps.

In Settings->Apps&Notifications->Apps, the list of filters before this CL is:

 All | Enabled | Disabled

With this CL, the filter list becomes:

 All apps | Installed apps | Disabled apps | Instant apps

Change-Id: I65ffbfd7db99f45fc0310c7239bdfc0522c65e3a
2017-02-15 15:35:25 -08:00
Daniel Nishi
a412c30d90 Fix a race condition where the extra view may not update timely.
Previously, we queried for the extra view's stats during the rebuild.
The full rebuild can take an arduous amount of time. By moving the
background calculation outside of the rebuild code path, we can
load the stats in the background and update the view outside of the
app loading cycle.

Bug: 35144044
Test: Manual -- this was race condition-y, so I just tested several
times.

Change-Id: Id2f92e32c3b3f9c5d5cf4a7308cca38c2e52789c
2017-02-08 16:12:15 -08:00
Daniel Nishi
de9e642bff Don't show games and music apps in Other Apps.
Bug: 35143240
Test: SettingsLib Robotests
Change-Id: I0805de4f7e88206618cdbd4148752df8336204f6
2017-02-08 12:20:04 -08:00
TreeHugger Robot
b1934adfb7 Merge "Fix music crash regression: Part Deux." 2017-02-08 10:18:27 +00:00
Daniel Nishi
a4739b9f51 Fix music crash regression: Part Deux.
Bug: 34888282
Test: Manual as a result of 34768986
Change-Id: Icebcb49befed5cc39eef7707ca6d97c45ec958aa
2017-02-07 14:43:43 -08:00
Daniel Nishi
3dfbc46c0e Re-add the break statement that was accidentally removed.
This fixes the problem where the game fragment starts at the same
time as external sources.

Bug: 35056002
Test: b/34768986
Change-Id: Ie35decc627dc6bec493a8c1f1976dc11d460f5fe
2017-02-07 09:40:54 -08:00
Daniel Nishi
58543f1dd4 Don't crash in Music Storage Settings.
This crash occurs because the music files entry is active, but does
not have an AppEntry (because it is not an app.) ManageApplications
assumes all active elements have an AppEntry, which causes an NPE.

By adding in a null check, we can avoid this.

Bug: 34888282
Test: Manual -- because ManageApplications needs refactoring badly.
Change-Id: Ief0c202f6176d90e492e62e5930b940e5a28b95c
2017-02-01 14:19:28 -08:00
Daniel Nishi
31027dae93 Add a music apps view to the Storage Settings.
When you tap the Music & Audio preference, it takes you a
hybridized applications view. In this view, there also is
a line item which defines the amount of storage used by
audio files on the device. Using the new storage query, we
can add this information very quickly to the view.

Bug: 33199077
Test: Settings robo tests
Change-Id: If51cba0b3de20805543a39049367eb13613081e7
2017-01-25 11:56:02 -08:00
Daniel Nishi
c208eff2f8 Hook up the Games storage category preference to a games view.
This patch adds functionality for the soon-to-be-deprecated games
and the new app categorization.

Bug: 33199077
Test: settings robo
Change-Id: Iae055c6f1b4d1af3f51aba9897c140ae7aac41c9
2017-01-24 09:43:58 -08:00
Suprabh Shukla
57d92315a4 Adding Manage External Sources Settings
Added a settings fragment to manage external sources. It lists all
applications that have either requested REQUEST_INSTALL_PACKAGES or have
their app op changed from default.

Test: Will include in follow-up CL. Tracked in b/33792674

Bug: 31002700
Change-Id: Ibd2a1922be214b62aec4eefa45f7b9691256b205
2017-01-18 21:00:30 -08:00
Bartosz Fabianowski
13f569ebd6 Add number of enterprise-installed apps to Privacy Settings page
This CL adds information about the number of apps that were installed
by the admin to the Enterprise Privacy Settings page.

Test: make RunSettingsRoboTests
Bug: 32692748

Change-Id: Ib710a1249db6d285da962122fd3dfb35a43752a1
2017-01-13 22:20:51 +01:00
Daniel Nishi
b3d4de2ab7 Remove the app header from ManageApplications when used for storage.
This UI element is no longer in the mocks. It complicated the
implementation of the fragment because it was causing the wrong
apps to be selected on-tap.

This specific StorageUseActivity usage only happens when coming
from the Storage Settings UI, so we can freely remove it without
harming other uses of ManageApplications.

Bug: 34195303
Test: Manual -- it seemed a bit silly to add a test to ensure that
      a broken UI element was indeed missing.

Change-Id: I5396364c297026a33b54d1794d9ad2c5102f0d7f
2017-01-10 13:54:32 -08:00
Julia Reynolds
d6835a20fc Support showing notifications as badges.
And remove unneeded app level settings.

Change-Id: I88f506b0704195181d1748a3135f8ee0f39b774f
Test: manual for now. will add tests when have real mocks for the pages
2016-12-20 13:07:04 -05:00
Jaewoong Jung
b680966748 Merge "Makes app settings keep scroll position after unistalling apps." 2016-12-08 04:31:14 +00:00
Fan Zhang
2d0b344736 Add InstrumentFragment for non-PreferenceFragment types.
This allows app fragment use a less heavyweight fragment as super class
if they don't need PreferenceFragment. Using this class as base is
generally easier to set up robolectric tests too.

Bug: 33354536
Test: RunSettingsRoboTests
Change-Id: I91c4d242ea0333c76c8767c03c3f18dee6b6e104
2016-12-05 17:13:33 -08:00
Jaewoong Jung
a2674f7308 Makes app settings keep scroll position after unistalling apps.
Bug: 32195844
Test: Manual inspection after numerous tries to write one. Espresso
didn't work because the test scenario involves installing an app.
Robolectric didn't either because it doesn't fully emulate
ListView's scroll behavior.

Change-Id: Ia811198ddee6edf6d207a4e936d2e686b64bf02f
2016-11-30 13:59:00 -08:00
Bartosz Fabianowski
3d83300deb Extract counting of installed apps into helper class
This CL extracts the code that counts the number of installed apps
for a set of users from ManageApplications to a helper class,
InstalledAppCounter. The new helper is designed to be unit-testable
(PackageManager dependencies are injected via a new PackageManagerWrapper
abstraction) and customizable (the set of users for which to count is
specified by subclasses).

The CL adds a unit test for the InstalledAppCounter as well.

Test: make RunSettingsRoboTests
Bug: 32692748
Change-Id: Ie7fbd40d9dd998b27f1f9de227b6a187b5c9d315
2016-11-17 21:04:34 +01:00
Lei Yu
59f36994ba Merge "Remove hardcode for textcolor in spinner item." 2016-11-14 19:07:49 +00:00
jackqdyulei
0a209093d1 Remove hardcode for textcolor in spinner item.
Remove the "android:textcolor" because "Android:textAppearance"
will set the textcolor to "?attr/textColorPrimary".
Set adapter has same theme as spinner, so view inside adapter
can be inflatered correctly.

Bug: 32592245
Test: screenshot
Change-Id: If7a78ede0a029aa9fcd8f9b324a423d477c65ad7
2016-11-09 17:57:00 -08:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Fan Zhang
fdb833873a Use new app header in more screens.
- This covers app data usage settings, power usage details
- Addded helper method on AppHeaderController to build the header as
  Preference because every fragment needs to do this anyway.

Bug: 32442716
Test: RunSettingsRoboTests

Change-Id: I6d38321b867154f8fb5194b993d118bcdbbfedc9
2016-10-28 17:16:39 -07:00
Fan Zhang
606c74404b Hide gear icon in actionbar if new IA is enabled.
- The page that gear icon opens is moved to other places in new IA.

Bug: 31799948
Test: manual
Change-Id: I637d725425109d364951ac1c7515cc8bcd061cc5
2016-10-26 15:55:53 -07:00
Fan Zhang
4136d902bf Add app default UI to App & Notifications.
Bug: 31799948
Test: RunSettingsRoboTests
Change-Id: Icca4954f82af38316cc232b8879c0f7e7869ecb3
2016-10-21 19:59:24 -07:00
jackqdyulei
32b01bffdd Add "FILTER_NOT_HIDE" for all app filters. am: d785a8db78 am: 00ed827516
am: 15c14f0cc2

Change-Id: I2322d0d3e496013cfb02444b2224fab1eecb47b9
2016-10-07 15:02:47 +00:00