Commit Graph

51 Commits

Author SHA1 Message Date
jackqdyulei
8a61657c6d Disable "Battery dialog" for default apps
If it is default active app(i.e. Phone, SMS), disable battery
optimzation dialog so user can't optimize it.

Fixes: 118910079
Test: RunSettingsLibRoboTests
Change-Id: I7223913c1e6ef68d84adfc2c54d133661a529202
2019-04-01 16:55:04 -07:00
Salvador Martinez
66320c2c47 Add a help URI for each ManageApplications subclass
This just adds the ability to add help pages to each ManageApplications
subclass. We can remove any we don't end up needing later.

Test: robotests pass
Bug: 121442558
Change-Id: I7aac30aa081d93efaa473248cf259e45ae63870c
2019-03-26 11:27:03 -07:00
Fan Zhang
d3b848713d Remove reference to R.id.summary_container.
It's deleted in another CL.

Fixes: 123317946
Test: visual/robo
Change-Id: I7b461ba68e8b56946e4effc26850776881236ec7
2019-03-15 15:41:47 -07:00
Ng Zhi An
b97bdc38da Disable system alert window permissions on low ram devices
Bug: 63697002
Bug: 117832554
Test: adb am start-activity -a
android.settings.action.MANAGE_OVERLAY_PERMISSION
Change-Id: I44c64001cd07fd4934cdc55f455384cebd5c9cfb
2019-02-26 17:58:43 -08:00
tmfang
7fb266f30b Fix janky in App info screen
If a Recycle view inside in a NestedScrollView,
The times of calling recyclerView#onCreateViewHolder()
is requal to its data set.

When there are large set of apps need to be shown,
RecyclerView will need to take many time to call
onCreateViewHolder for each item.

So, it causes the screen is janky or freeze UI when page
is loading large data set.

For now, we get rid of NestedScrollView, just use RecycleView
and AppBarLayout to have same bahavior for spinner.

Fixes: 124384314
Fixes: 123036231
Fixes: 122964660
Fixes: 123088178

Test: 1. Select show system in App info screen. Observe whether there
is any janky.
2. Select show system in App info screen, and then change device
orientation. Observer whether there is any janky.
3. Go to Settings > Apps & notifications> Advanced > Special app access >
Select "battery optimization", and then Tap drop down and select "all
apps". Observe whether ther is any janky.

Change-Id: Icd65e91eec3b32476d80cc12e9c4baa71151306a
2019-02-18 17:52:03 +08:00
tmfang
465ffcd48d Remove empty space in Usage access
When there is no need to show filter component,
we don't need to set an extra padding top.

Test: robotest, visual
Change-Id: Ieaa65ed9785a06f0737aefaf102d0c857002bbdd
Fixes: 123037802
2019-01-29 20:02:49 +08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
tmfang
046c10ac30 Filter status is not retained in App info
Selected filter is not retained after device orientation changed.

In old design, we only update selected index one time when the
enabled filter(filterType) equals the previous selected filter.
After that, the selected index won't be changed again.

But we sort the filter options every time(Collections.sort) when
we add a new filter. Therefore, it makes all indexes of filters
option could be changed.

For example,
Old filter options => All apps, Personal, Work
Selected index = 1

Add "Intsalled app" option => All apps, Installed app, Personal, Work
Selected filter option becomes "Installed app" but not Personal.

Since we saved previous selected filter option before device
orientation changes, we can check again whether or not the selected
index is previous filter type when we enable any new filter.

Test: manual test, robotest
Fixes: 120798975

Change-Id: I35de186a6a1fae3bd863bd31a6ce3f76861dc896
2018-12-14 02:09:12 +00:00
Doris Ling
35c066c997 Add search to app info list.
- add a search option menu to the manage applications page.
- add a search filter to the app list adapter to remove any app whose
app name does not contain the search query.

Change-Id: Ie749daeef2cdc4a22fade45422ae90f44d00ceb2
Fixes: 119598311
Test: make RunSettingsRoboTests
2018-12-05 15:31:51 -08:00
Amin Shaikh
57eb049bec Delete Directory access Settings.
Bug: 111892460
Test: m RunSettingsRoboTests
Change-Id: I6ffa5a4b69fa7b3ee9d9a058fa075b60fbd2b0a3
2018-11-02 13:55:15 -04:00
tmfang
0d07dd19d0 Use custom drop-down filter widget
This CL is just a example how to use this SettingsSpinner.

Change-Id: Ie0d104ce5f3e4c6b852fe7c051253b1567c6c4cd
Fixes: 112706966
Test: robotests
2018-10-08 16:23:52 +08:00
Julia Reynolds
a4e51b5238 Add 'notificaton blocked' filter to notifications
Test: robotests
Change-Id: I5c0cd9a2f73b6a22d66df7669e944bbe1473539c
Fixes: 112576746
2018-09-25 09:05:10 -04:00
Julia Reynolds
56966ce8f5 Add checks before casting entry.extraInfo.
Test: make, flash
Change-Id: I1a9d6a51b1f236e711fdb49d9c2f795e7023cfce
Fixes: 113309404
2018-09-19 15:43:08 -04:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Doris Ling
8a5472f516 Fix cached app icon being used in app list.
- change to use the icon from IconDrawableFactory instead of from app
info when building the application list.

Fixes: 63978676
Test: manual, reinstall an app with updated icon and launch
settings->Apps & notifications->See all apps and check the app icon.

Change-Id: I99028ef97fb4fec8c90708b26caaddb7325c1ddb
2018-07-19 12:50:36 -07:00
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Beverly
b3ba0ac11f Enable and add logging to ManageApplications
Bug: 77541894
Test: n/a
Change-Id: Ia6a26c97aa4cb7d81987a291d4b568e89087959b
2018-06-22 16:34:05 -04:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Julia Reynolds
cb691873fd Handle usageevents for work profile apps
Test: robotests
Change-Id: Ifdc6e456d76614220b2052e6ca8a8f3676d0e2ee
Fixes: 79142791
2018-06-11 14:23:51 -04:00
Fan Zhang
7e395e1a00 Plumb context object to PowerWhitelistBackend.
Change-Id: Ice0d037625d47f1f668b00499a7f1ad2302cc0ba
Fixes: 76435804
Test: robotests
2018-05-29 22:32:22 +00:00
Suprabh Shukla
a8eb28f219 Merge "Unrestricting app when put on power whitelist" into pi-dev am: e70e27ccea
am: d47817ffcb

Change-Id: I488c11a04f7350c96c71ca70d1122c7de7b27833
2018-05-11 17:00:22 -07:00
Suprabh Shukla
0f447022cf Unrestricting app when put on power whitelist
Power whitelisting and background restrictions are opposing rules, so to
keep apps out of confusing states, unrestricting an app whenever it is
put on the power whitelist.

Test: atest RunSettingsRoboTests:HighPowerDetailTest

Bug: 77924141
Change-Id: I4952ac6c893bc7e98aa1b6ad3a86906fc299dea5
2018-05-11 14:00:28 -07:00
hjchangliao
e86eec0c07 Rename SubSettingLauncher.setTitle, add java doc
For make this method usage more clear,
setTitle(charSequence) rename as setTitleText,
add java doc: it is only for user generated string
setTitle(int) rename as setTitleRes.

Change-Id: I972cb6a8ff90873dfdc25c23f6dc3d68103c8e4e
Fixes: 78347436
Test: make RunSettingsRoboTests
2018-05-09 10:00:05 +08:00
HJ ChangLiao
5693be2863 Replace PackageManagerWrapper with PackageManager
Replace all SettingsLib/PackageManagerWrapper in Settings,
by PackageManager,
Remove ShadowPackageManagerWrapper.

Bug: 62067063
Test: make RunSettingsRoboTests
Change-Id: I6d1af55c13d80c1907b98b21e0207cc903cd9b1f
2018-04-24 15:12:31 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Beverly
0e90651dc2 Merge "Update mSortOrder when changed to frequent" into pi-dev am: 50fdc109ff
am: 5ad550aec4

Change-Id: Icb69b66036536d850072852238054e6a10103982
2018-04-11 14:28:16 -07:00
Beverly
50f641be29 Update mSortOrder when changed to frequent
Update mSortOrder so when the activity is resumed, the
apps are sorted how the user wants

Test: make ROBOTEST_FILTER=ManageApplicationsTest RunSettingsRoboTests
Change-Id: I422846aada29ee254996b2e94da27af7ed935a0b
Fixes: 77691626
2018-04-11 14:43:06 -04:00
Yvan Hsueh
2f81209d0f Retain the selected filter even after the device orientation change.
The selected filter should be retained displaying the list even after the device orientation change.
Bug: 36380176
Test: atest packages/apps/Settings/tests/uitests/src/com/android/settings/ui/AppsSettingsRetainFilterTests.java

Change-Id: I7830b525343ce597929771ad4db55a803f893432
2018-03-30 05:29:04 +00:00
Julia Reynolds
1cda00b12b Allow app lists to have a toggle
And make the notifications app list toggle block/unblock
notifications.

Test: make -j RunSettingsRoboTests
Change-Id: I7417b98fb1c66504897df515c4c84afad591764e
Fixes: 74318867
2018-03-27 18:46:02 -04:00
Fan Zhang
de052eb2b9 Fix text overlap issue when flinging in ManageApplication
The issue is we have a background handler to find app size and set to
summary asynchronously. When flinging quickly, the view being request to
update by the background handler could be scrolled off screen already.
This change forces onPackageSizeChanged update to only happen when it's
not scrolling.

Change-Id: Ia7ccab776c3c789c8d4c0b55104b48e257b9cebf
Fixes: 76176014
Test: manually fling
2018-03-26 11:34:16 -07:00
Julia Reynolds
ff9500d0f9 Add manage notifications screen
Test: make -j RunSettingsRoboTests
Bug: 74318867
Change-Id: I1c872c976677ee38f7d9d9523d18fc8ca03fa547

Add manage notifications screen

Test: make -j RunSettingsRoboTests
Bug: 74318867
Change-Id: Ia3626e9f69e8b91b1a2bba9ef549c775972e749a
2018-03-22 19:57:09 -04:00
Fan Zhang
0ced370427 Update pref fragment for "see all" in app & notification
Instead of launching intent, now to launches all app list as a
subsetting. This is more consistent with the other setting pages and
fixes a task affinity issue.

Change-Id: I0464a2b8f46d46f06bcf297c0f876ae12a7c490b
Fixes: 74205806
Test: robotests
2018-03-06 08:58:10 -08:00
xshu
3f04897a19 Adding Wifi setting to special_access settings
In the settings app, allow users to override app permission for
CHANGE_WIFI_STATE for every application that declared that permission.

Bug: 70562620
Test: compile, robotests

Manual test:
Flash build to device (walleye)
Download iPass from playstore
Open iPass and try connect to a wifi network; verify success
Open settings -> Apps & notifications -> Advanced -> Special app access
-> Wifi access
Select iPass from the list
Toggle the switch to off
Open iPass and try connect to a wifi network; verify failure

Change-Id: Ib2be4c83988a81ba7831d096c9b1980462e66903
2018-02-26 13:47:15 -08:00
Fan Zhang
7cf99f5f12 Migrate more settings to use SubSettingsLauncher
Bug: 73250851
Test: robotests
Change-Id: I08f6f380489646231d6d8ceb1488e2efb036bf69
2018-02-18 21:10:03 -08:00
Julia Reynolds
4f3b556388 Notification settings updates
- Footer preferences were too dim
- Fix text and target on recently sent apps
- Make 'behavior' a dialog
- reorder settings on apps page

Change-Id: Idf8056bc77ead89fe2025bbde3346861e23a3c8d
Fixes: 72652526
Fixes: 72651810
Fixes: 72652024
Bug: 72651953
Test: make RunSettingsRoboTests
2018-01-30 16:59:12 -05:00
Doris Ling
ce55d7c6a1 Remove app info page v1 related codes.
- change to use AppInfoDashboardFragment completely
- remove InstalledAppDetails and the corresponding tests

Change-Id: I8cbdf71cadc8b5743929abbafe91185e5e39b6b2
Fixes: 69384089
Test: make RunSettingsRoboTests
2018-01-29 17:14:32 -08:00
Felipe Leme
6042c0bd6c Renamed Storage Access to Directory Access.
Test: manual verification
Test: make RunSettingsRoboTests -j40

Bug: 63720392
Bug: 72135562

Change-Id: I31e63456994d7a9cd2a83a260930835a1052e793
2018-01-18 13:56:24 -08:00
TreeHugger Robot
a35adb12f0 Merge "Initial screens for Storage Access." 2018-01-16 19:14:58 +00:00
Felipe Leme
7a0ad2b30f Initial screens for Storage Access.
This new settings will be accessed through Apps -> Special Apps and it will let
users change the status of granted (or denied) Scoped Access Permissions.

This initial CL implements the landing activity that shows all packages and an
initial version of the detailed activity for a specific page, althouth the
detailed activity is not ready yet.

Test: manual verification
Test: export ROBOTEST_FILTER=com.android.settings.core.codeinspection.CodeInspectionTest && make RunSettingsRoboTests -j40
Bug: 63720392

Change-Id: Id0419c2c4aaaec365803218d6947e230e4776f13
2018-01-12 18:06:48 -08:00
Fan Zhang
4f389a7731 Tweak app notification page title and expand button cutoff
Change-Id: If9b93023ac9ab946b7c2b0dd65852948029da896
Fixes: 71813209
Test: visual
2018-01-12 15:00:09 -08:00
Tony Mantler
bf25160090 Move PowerWhitelistBackend to SettingsLib
Bug: 70716754
Test: RunSettingsRoboTests
Change-Id: I897ce3469bb2d72a0cbe96b16b8de1a565ba4e64
2017-12-15 12:58:34 -08:00
Doris Ling
a0006d93bd Move AppInfoDashboardFragment into appinfo package.
- update all references to AppInfoDashboardFragment
- removed PackageUtil inner class and change the corresponding function
to be a simple method.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: Ief067e25a303ef16db20b2ca1d8840cb06eff5f9
2017-12-12 16:58:17 -08:00
Doris Ling
765007b0bf Add controllers for default app shortcut preferences.
- add the default app shortcut preferences to the preference screen
xml instead of creating them dynamically in the fragment.
- add controller for each of the shortcut preference.
- move the corresponding shortcut detail settings into the appinfo
package.
- add individual preference screen xml for the shortcut detail settings
instead of using the shared screen template.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: I7bc0b3b727e87fb1a32a82291e64b8e290947671
2017-12-07 15:42:28 -08:00
Doris Ling
529e207986 Create version 2 of InstalledAppDetails
- this is the first step for converting InstalledAppDetails into
DashboardFragment
- add a feature flag to determine whether to show the new installed app
detail page.
- decouple the fragment from AppInfoBase: extends from
SettingsPreferenceFragment directly and copy all codes from
AppInfoBase.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: If1ab5b216620eaba1d6bde20e65e7a602931fd94
2017-11-17 15:37:34 -08:00
Doris Ling
4a01283309 Remove the feature flag for using new title.
- remove all code that check for the feature flag, and use the new logic
by default.

Change-Id: I7fbe60da84c1c0f35e7241402a71d2bc4cd300e6
Fixes: 64564191
Test: make RunSettingsRoboTests
2017-11-13 17:58:13 -08:00
Fan Zhang
974d2fe080 Update UI to use a smaller icon for ManageApplication page.
- Rewrite preference_app.xml to have a small icon
- Update ApplicationViewHolder to hide/show summary row dynamically
  - but only do this for notification settings - this UI has empty
    summary for most row. For other UI, just keep the empty summary row
    until summary comes in. If we also hide/show summary row there will
    be a height change animation which is janky.

Bug : 65182905
Fixes: 63582851
Test: robotests

Change-Id: Ice67324f08c67e014a018dfc51e00fe4449036dd
2017-10-30 12:20:49 -07:00
Doris Ling
03a3b518de Update preference screen title.
- Add missing title to preference screen xml so that they will be used to
set the activity title when the fragment is launched.
- Also updated some incorrect preference screen titles.
- Overrides getTitle() in preference fragments that do not use the
preference screen xml.

Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Id72d5ddf18f0962bc484de8bbd847a2e55d6371e
2017-10-25 11:02:07 -07:00
Fan Zhang
5d80fd2966 Fix a monkey crash: guard against position -1.
When handling onClick in ManageApplications, skip getAppEntry if
position is -1.

Change-Id: I565c42b2c9f742445e49fd4c2e7db539d0f6f8ad
Fixes: 67940121
Test: manual
2017-10-18 11:47:01 -07:00
Fan Zhang
78369d91bc Switch to recyclerview in ManageApplications
- Replace ListView with RecyclerView in layout
- Replace ApplicationAdapter's superclass to be RecyclerView.Adapter
- Change adapter interfaces (where necessary) to work with RecyclerView
- Replace fast scroll with Recycler's mechanism (all in xml)
- Removed section indexer (text bubble when fast scroll) because
  recyclerview doesn't support it.

Bug: 64804294
Test: robotests
Change-Id: I55b221836ce6abdeddf4568c8a8a5632cbddbd3b
2017-10-17 17:41:44 -07:00
Fan Zhang
bd56215962 Encapsulate AppFilter and its display label into 1 class
Bug: 64804294
Test: robotests
Change-Id: I2a752794ded4ccb8510adf37d41afa4514d8c4c0
2017-10-13 14:33:11 -07:00