Commit Graph

66 Commits

Author SHA1 Message Date
Bernardo Rufino
9e32620854 Report if app-specific SAW intent
Log using PlatformCompat framework if the app tried to deep-link into
the app-specific screen for managing SAW permission.

Bug: 146327570
Bug: 135920175
Test: 1. adb shell am start -a
android.settings.action.MANAGE_OVERLAY_PERMISSION -d package:com.foo.bar
      2. adb logcat -s -v color CompatibilityChangeReporter:*
      3. Verify compat change id reported 135920175 and state LOGGED

Change-Id: I1d6c571d524d70c11156aeea27a8800d2a0ba42b
2019-12-17 14:49:00 +00:00
Raff Tsai
1e5d8146b5 Change ProfileType definition
Bug: 141601408
Test: rebuild
Change-Id: Ia4d4fabe8a4daad4ce54c243748fa3c29bf944ba
2019-12-12 13:44:35 +08:00
Julia Reynolds
aceccce75c Reorganize notification Settings classes
The notification package was getting too big.

Test: make -j64 RunSettingsRoboTests
Fixes: 145224451
Change-Id: I25ba82f42f7a137d8adcce72dcf8089d0e018bdc
2019-11-27 10:02:13 -05:00
Raff Tsai
84327f6aa3 Add storage_summary_donut above ProfileSelectStorageFragment
- Modify ProfileSelectFragment to support add preference xml in the
top, and tabLayout below the preferences. Base preference layout is
dummy_preference_screen.xml which contains no preference.
ProfileSelectStorageFragment contains StorageSummaryDonutPreference
above the tabLayout.
- Make StorageSummaryDonutPreferenceController self workable without
StorageDashboardFragment dependence.
- Rename inactive_apps.xml to dummy_preference_screen.xml
- Move ShadowPrivateStorageInfo from LowStorageSliceTest

Bug: 141601408
Test: manual
Change-Id: Ide12840dc81bb104f328e230ecda5d35bba01d7a
2019-11-18 18:18:29 +08:00
Raff Tsai
afd494d335 Add personal/work tab for ManageApplications
- Add ProfileSelectManageApplications containing tabLayout
- Modify StorageItemPreferenceController to display only personal
or work profile data
- Add getTargetFragment in Utils to handle fragment selection

Bug: 141601408
Test: manual
Change-Id: Ie4db1ce2e77f60a82018e5a3e1f2fccb812502dc
2019-10-16 17:08:31 +08:00
Raff Tsai
129c98bba1 Remove summary loader in some fragments
- Summary Loader only works in injected items, but those fragments
are not injected to Settings UI. The SummaryLoader class them are
useless.

Bug: 141653158
Test: robolectric
Change-Id: I1ca0bf5a1f417b7fe86b28e96aff7d4aee2cf2d3
2019-10-01 10:02:26 +08:00
TreeHugger Robot
c0fbb533d2 Merge "Guard NPE when using search view" 2019-05-31 04:27:43 +00:00
tmfang
f841748be3 Guard NPE when using search view
Test: This crash pattern was observed from monkey test, I can't reproduce it.
So, just rebuild rom.
Fixes: 132819226

Change-Id: I0726524dcf8e1622d64f75c17b3600a7440b58c2
2019-05-31 10:47:30 +08:00
tmfang
ee4ca732ef Merge "Fix no apps shown on app info screen" into qt-dev am: 11e4847d61
am: 848ead645b

Change-Id: If3b73c2f521282f83f6e9aa53fcf671bb9bedadb
2019-05-24 01:17:19 -07:00
tmfang
71dea4743e Fix no apps shown on app info screen
If Settings app hasn't loaded apps list completely yet,
we can't filter result from list. Since there is nothing
can be filtered, we just need to show all apps.

Test: visual
Fixes: 131697606
Change-Id: I971c942b0fe5889206c40d855f8508acd42461a7
2019-05-24 14:30:42 +08:00
Colin Cross
807e861105 Use if instead of switch for resources
Converting to Soong will move some code from directly compiled
into the app to compiled into an Android library and then
shared between the app and the tests.  This will cause resource
IDs in the library to become non-final, which means they can
no longer be used in case statements.  Convert affect case
statements to if blocks.

Test: m RunSettingsRoboTests
Change-Id: I25742a374f06d3fa4decbfc0d223a350acc50881
2019-05-13 13:42:01 -07:00
Fan Zhang
0d69f08337 Remove animator on app list.
The animator causes a lot of jank. Removing it makes the UI feel faster
in general.

Fixes: 74127318
Test: visual
Change-Id: I79cbe8220fb05af84a394207dac2c8c9a93288be
2019-05-03 15:37:55 -07:00
Fan Zhang
270fd6c872 Misc bug fixes around search bar in app list UI.
- Turn off DEBUG log flag, it's spammy and is a potential PII risk.
- Save search bar expand state so it stays open during screen rotation.
- Introduce a intent extra so callers can deep link into this UI with
  search bar pre-expanded.

Fixes: 130422388
Test: robotest
Change-Id: Ib81080733707306de516c49340571c543e70874e
2019-04-12 13:50:54 -07:00
Hai Zhang
22f8d48df0 Remove old default apps code and use roles instead.
Default apps are moved into PermissionController.

Bug: 124452117
Bug: 124457823
Test: presubmit & manual
Change-Id: I5f68e5b77cd6163d093590185314270706d75391
2019-04-09 13:30:31 +08:00
Lei Yu
033fe6eec0 Init PowerWhitelistbackend to stop crash
Also update text to "unavailable" to reflect its current status.

Fixes: 129955147
Test: Manual
Change-Id: Ib80d68d6d2b6bc4ced4a72483859e675b7e7e61c
2019-04-04 13:44:45 -07:00
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