Commit Graph

104 Commits

Author SHA1 Message Date
Arc Wang
e1aeacad6a Fix NullPointerException at ManageApplications$ApplicationsAdapter.access
mApplications may be null and should check if it's null before accessing.

Bug: 217872983
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=ManageApplicationsTest
Change-Id: I97a26e26478eb239370cdef8c44342cd7aeb71ee
2022-03-09 17:52:34 +08:00
Edgar Wang
fa5ab2e268 Replace SettingsSpinner with Spinner
Bug: 219610512
Test: manual
Change-Id: Ib8562a64299a6cb36f8225199f9432cb81e8e9f2
2022-02-17 02:16:27 +08:00
Jonathan Scott
c3dbc3ffbd Merge "Allow Device Management Role Holder to update Settings strings." 2022-01-31 19:10:30 +00:00
Yanting Yang
19bdc6ce67 Apply a new icon cache mechanism for memory improvement
- Avoid loading all app icons at once to decrease memory usage.
- Only load visible icons when entering the apps page.
- Reserve icon placeholder to alleviate icon loading flicker.
- Release icon cache when low memory or leaving apps page.

Bug: 187118427
Bug: 209898662
Test: manual check the smoothness and memory usage of apps pages.
Change-Id: Ifc3c2a73cc88d6e42739df4e8208445afa12e0ea
2022-01-27 17:20:58 +08:00
Jonathan Scott
e0d439472f Allow Device Management Role Holder to update Settings strings.
Test: manual
Bug: 188414370
Change-Id: I6e1a06619799a9e99382d791e72e2e4518f93cac
2022-01-25 19:03:24 +00:00
tom hsu
33f2096fea [Panlingual] Adds a filter of application for per apps locale change.
- Settings -> System -> app language -> app languages
   Use this filter to only show apps allowed to change the locale.
 - Settings -> Apps -> all apps -> any one of app -> language
   Use this filter to only show the language preference of app allowed to change the locale.
Bug: 210935436
Test: atest pass.
Test: local test.
Change-Id: I2f8a0815dae68392e11882ad9e1e4945492efdba
2022-01-19 09:06:50 +00:00
tom hsu
58244b1b74 [Panlingual] Implement entries of Panlingual in settings UI part.
- Path 1 : System -> Language & Input -> App Languages -> per app
 language
 - path 2 : System -> Apps -> App Info -> per app language
 Video: https://screencast.googleplex.com/cast/NjUyNTUzMDY0MTc5MzAyNHxjNTg2MzMwYS0yOA

Bug: 206854105
Test: local test pass
Test: atest pass

Change-Id: Ic06fa4f0c6ec68680eb828032b6e3f479b412dc4
2021-12-13 22:54:40 +08:00
Mill Chen
28bc1c04b9 Fix the background color of CollapsingToolbarLayout
The wrong background color of CollapsingToolbarLayout appears in some
pages like "All apps" page or "Password and accounts" page. This symptom
can be observed in these pages when the work profile is enabled and the
line count of title is 1.

This issue is caused by updating the title of the page many times. In
these pages that have the tab view, the structure of the page differs
from a general setting page. The title of the page is coming from
BaseActivity, ProfileSelectFragment, PersonalFragment and WorkFragment,
in which the page that has the issue has an empty string from
ProfileSelectFragment. That is causing the CollapsingTollbarLayout has
the different line count during the process of setting the title.

Since the pages that have the tab view are different from the general
pages in Settings, the title should be set separately for those pages.
Adding a method to get the title resource ID so the page extending from
ProfileSelectFragment can set its title.

Bug: 192914660
Test: visual test and manual test
1) Enable work profile
2) Navigate to All apps page
3) The page should have the correct background color in the
CollapsingToolbarLayout

Change-Id: I52ef9729f3cad56161ea3d87ba25429dfcdb26ef
2021-12-01 18:44:42 +08:00
Julia Reynolds
b106377155 Add ability to force rebuild list
So that you can change between filters that
have the same sort order.

Test: robotests, manually switch between notifications (off) to
notifications (all)
Fixes: 169943424

Change-Id: I62bbe90f30abada2ec342487a1fa420e451b3caf
2021-11-08 15:47:51 -05:00
Julia Reynolds
e41c89da2a Fix switch listener on app notif page
Test: RoboTests, manually change setting
Fixes: 193442605
Change-Id: Ie93469479e252811921a6451853b073dadb0d0a1
2021-07-14 10:31:30 -04:00
Arc Wang
e8de94a21d Fix 'No Apps' UI issues of ManageApplications
Fixes below UI issues

- "No Apps" may not show in fragments of profile tab.

  Fix it by using ConstraintLayout to specify alignments
  of each view and removing extra padding.

-- "No Apps" may flicker by moving position.

  The flicker is from unnecessary visibility changes.
  This change integrates empty view visibility
  control in LoadingViewController to simplify code
  and avoid unnecessary visibility changes.

Bug: 189390795
Bug: 183398721
Test: atest com.android.settings.deviceinfo
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo
      Manual visual, observe UI
        Settings -> Storage -> Games
        Settings -> Notifications -> App Settings
	Settings > Apps > Special app access > Media management apps
Change-Id: I634209c6f8466e2adae703226902190bbdf470b9
2021-06-28 11:33:10 +08:00
Arc Wang
0358562a9b Revert "Fix 'No Apps' UI issues of ManageApplications"
This reverts commit 4a97095e36.

Reason for revert: <It has abnormal scroll behavior when there is no profile tab>

Bug: 191945032
Bug: 191944934
Change-Id: Id6c71fbec4f490034bc07f6d8c9efabcb877d110
2021-06-24 08:25:44 +00:00
Arc Wang
4a97095e36 Fix 'No Apps' UI issues of ManageApplications
Fixes below UI issues

- "No Apps" may not show in fragments of profile tab.

  Fix it by using ConstraintLayout to specify alignments
  of each view and removing extra padding.

-- "No Apps" may flicker by moving position.

  The flicker is from unnecessary visibility changes.
  This change integrates empty view visibility
  control in LoadingViewController to simplify code
  and avoid unnecessary visibility changes.

Bug: 189390795
Bug: 183398721
Test: atest com.android.settings.deviceinfo
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo
      Manual visual, observe UI
        Settings -> Storage -> Games
        Settings -> Notifications -> App Settings
	Settings > Apps > Special app access > Media management apps
Change-Id: I9a2500f2fd1dd073ab88f26187541964719523d0
2021-06-22 11:04:24 +08:00
Tsung-Mao Fang
c9ffe47342 Collapse app bar while doing search in app page
Prior to this cl, user can see a large space on app bar
while user is doing search on app bar.

In this cl, we enforce to collapse the tool bar in
search case, and we don't allow user can scroll app bar as well.

Fix: 187016306
Test: Play around the search behavior in app page.
Change-Id: I25ba3ef24949cc43989fec4a80f75a24a8d92c07
2021-06-17 20:10:33 +08:00
Yanting Yang
467c7e81ea Left aligned the dropdown list of ManageApplications
Based on the Android S design, left aligned the dropdown list of
ManageApplications, e.g., All apps, App notifications

Bug: 178774987
Test: visual
Change-Id: I04143798475d20319980396d6bd755193ae2b1f0
2021-06-10 20:18:51 +08:00
Yanting Yang
90a9714cc0 Deprecate silky flag for official release
- Turn on the collapsing toolbar by default.
- Remove the silky flag from All apps page.
- Ignore tests of ChooseLockGenericTest and trace it on b/179136903.
- Remove silky flag.

Fixes: 183670633
Bug: 179136903
Test: robotests & visual
Change-Id: Iee2a9e7ccaebd1624f995af4fd45446142e5f500
2021-06-02 15:18:33 +00:00
Yanting Yang
863d2e50e7 Remove silky flag for searching and help menu
Bug: 183670633
Test: robotests
Change-Id: Ia62936e9f48a111ab36d74b852ec04090e42039a
2021-06-02 16:49:27 +08:00
Tsung-Mao Fang
a51c9988c5 Fix talkback doesn't speak subtext info
In the original design, we only set title description for
view holder, this is wrong. It causes talkback can't
speak subtext info.

Currently, we set the title content description in the title
view directly, so talkback can say the title and subtext now
when talkback focus on an app view.

Test: Talkback speaks full information for an app entry
Fix: 177873163
Change-Id: I94996d596a85cc2813ed1b10cdd4ed2bee62f4a9
2021-05-20 13:45:38 +00:00
Arc Wang
e64f01ccfc Cleanup Storage Settings
There is AOSP built in file browser for image/video/audio
file category, this change cleanup APP based category
for image/video/audio.

Bug: 183078080
Test: atest com.android.settings.deviceinfo
      atest com.android.settings.deviceinfo.storage
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.deviceinfo.storage
Change-Id: I925fc9296b8c2df5bd793668f66a12beb7744469
2021-05-04 22:21:53 +08:00
Arc Wang
4cd89bb082 Storage Settings Apps category shows image/video/audio APPs
There is AOSP built in file browser for image/video/audio
file category, all APPs except games should be included in
Apps category.

- Shows image/video/audio APPs in APPs category.
- Count Image/Video/Audio APPs storage size to Apps storage size.
- Remove APP size & cache size for Images/Videos/Audios category.

Bug: 170918505
Test: atest StorageAsyncLoaderTest.java
Change-Id: I07e0a3a66a13f36b9e0cbde289d8ba90df4ae295
2021-05-03 20:17:58 +08:00
Yanting Yang
5cfdd0750e Rename the screen title of all apps
Also update the title of App info entry on Apps page when there is no
recently opened apps.

Bug: 178774987
Test: robotests & visual
Change-Id: I1cd7ffc1a34c9fa65c93d9507bc45dfedc78f549
2021-03-24 17:52:07 +08:00
Ivan Chiang
d01c81e483 Add Media Management Apps activity in Special App Access
Add a settings page to control the permission MANAGE_MEDIA in Special
App Access. Apps can launch it by ACTION_REQUEST_MANAGE_MEDIA.

Test: m -j RunSettingsRoboTests ROBOTEST_FILTER=MediaManagementAppsDetailsTest
Test: m -j RunSettingsRoboTests
Test: manual
Bug: 181112025
Change-Id: Id7587cf179b8c5adbfd6477ca9c2d4a20a9852bb
2021-03-17 14:36:20 +08:00
Suprabh Shukla
c8b9240535 Adding alarms and reminders activity
Adding a settings screen to control the permission SCHEDULE_EXACT_ALARM.
Apps can start this by starting a newly introduced API intent
REQUEST_SCHEDULE_EXACT_ALARM.

Test: make -j RunSettingsRoboTests
Manually by UI inspection:
Settings -> Apps -> Special App access -> Alarms and Reminders
or by running:
adb shell am start -a android.settings.REQUEST_SCHEDULE_EXACT_ALARM

Bug: 171306433
Bug: 171305516
Change-Id: I1293d38fc50a22b2af46f80ab24f676ed632f964
2021-02-23 22:32:24 -08:00
Mill Chen
d072e8501a Restructure app info page
When the collapsing toolbar is applied in the Settings app, some pages
they used manage_applications_apps will have the collapsing toolbar not
work properly. This was caused by using multiple CoordinatorLayout and
AppBarLayout in these pages.

Bug: 177375909
Test: visual verified
Change-Id: Ibfeeab9cf907a23d18ee1ec2c450c523316cfc92
2021-02-04 18:53:44 +08:00
Arc Wang
c6ee2244a7 Merge "Fix battery optimization display problems" 2021-01-25 03:12:11 +00:00
Mill Chen
3d7a3189a7 Remove help icon from the toolbar of App info page
On Android S, the help menu will be removed from the toolbar in all
setting pages. This is using a feature flag to turn on/off the help
menu. Then, it should be entirely removed when the collapsing toolbar
feature rolled out.

Bug: 177274632
Test: visual verified
Change-Id: I5aceb9f0a99ecee948272ee584bbebdcce7b7943
2021-01-15 13:44:32 +08:00
Arc Wang
f81d22ef28 Fix battery optimization display problems
Root cause:
RequestIgnoreBatteryOptimizations adds package in
PowerWhitelistManager#addToWhitelist for intent
Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS.

Settings UI uses PowerAllowlistBackend to check if
an APP is in power allow list. Each UI component should
PowerAllowlistBackend#refreshList() or UI will get
a stale result.

Solution:
This change fixes below display problems by refreshing
allow list from DeviceIdleController service.

1. Battery optimization summary in Battery usage details.
2. Battery optimization list.

BYPASS_INCLUSIVE_LANGUAGE_REASON=I need the object name
to describe the root cause.

Bug: 171064162
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BatteryOptimizationPreferenceControllerTest
      manual
      Switch battery optimazion of a APP and observer the UI display.
Change-Id: I75b269eec5d1b904dcaa71948798f169d4e4ddfa
2020-11-24 16:28:04 +08:00
Edgar Wang
f480c1c3fc Update language to comply with Android's inclusive language guidance
Refactor PowerWhitelistBackend to PowerAllowlistBackend
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: robotest & manual
Change-Id: I3d56e6dac1515b49a89f59c34edf403ecb891420
2020-08-04 15:47:57 +08:00
Julia Reynolds
2d91b744cf Add 'all apps' to notification filters
Test: atest
Fixes: 141138853
Change-Id: If77e8186ddbfc754e7bb1a3d8541840f09db38d9
2020-07-29 11:25:15 -04:00
Yanting Yang
6b457d882c Improve scrolling performance for App Info page
Root cause:
App info page will load application icon and content description in
onBindViewHolder(), it will query PackageManager and UserManager many
times in scrolling. Actually these actions will become time consuming if
there is a large app list.

Solution:
To relieve the janky scrolling, cache the icon and content description
if it has been loaded once.

Bug: 156527207
Test: manual test and robotests

Change-Id: I997179834511f86b3155c7d54989a873ac8e2559
2020-05-21 19:09:39 +08:00
Tsung-Mao Fang
e8ffbb21a1 Talkback speaks "work" for work profile app
Set a content description for each app entity.
If app is a work profile, then talkback says "work" app name.

Test: Rebuilt rom and talkback speaks correct description.
Bug: 127602715
Change-Id: I1952b77a18a884a887d912fb7edc44a12be70ad4
2020-05-07 19:39:41 +08:00
atrost
a84c219c30 Mark CHANGE_RESTRICT_SAW_INTENT as logging only
Test: m, flash
Test: adb shell dumpsys platform compat - the change is marked loggingOnly
Bug: 148009004
Change-Id: Ia04e8ef624a69feac7c68c858b48457385b9818a
2020-03-12 12:26:56 +00:00
Raff Tsai
50a0aafdfe Fix Battery optimization page broken
- mCompositeFilter is not changed after toggling filter, so the
list items are not changing. Fixed by changing mCompositeFilter
after toggle is changed.
- Because mSession.rebuild returns null, removes some dead code.

Fixes: 149362024
Test: 1. Settings > App & notifications > Special app access >
         Battery optimization
      2. Toggle Not optimized and All apps
      3. App list should change after step 2

Change-Id: Ifd5c7b0f1d809ae7a49d62b39e34fa899700326c
2020-02-14 10:45:14 +08:00
Raff Tsai
a2e77a0e85 Fix no action in Settings storage
- Pass wrong user id in view holder

Fixes: 149028747
Test: 1. Add new user, and change th new user
      2. Take a camera shot under the new user
      3. go to Settings -> Storage -> photo & video -> Image
      4. Should open file brower

Change-Id: I0af532748ec19f62897911b1bb6ece9b21b844c3
2020-02-12 13:20:19 +08:00
Tsung-Mao Fang
323347afcc Use system-api lib to get badged, shadowed icons
In order to prevent DoS attack from icon size, we're using
a system lib to help convert any loaded drawable into a flattened
bitmap with an appropriate size.

Test: Open recent app screen and then no crash
Change-Id: Ie148890fbbbf71f42863a8fe727a90615158b8c1
Fix: 33646131
2020-02-06 15:02:56 +08:00
Mathew Inwood
5800245d1b Fix broken links in @ChangeId javadoc.
We will soon have javadoc generated from the doc comments on all
@ChangeId annotated constants. Since the link target referred to
here is a @hide constant, it cannot be resolved as part of DAC doc
generation. Replace it with {@code} specifying the constants value
instead.

Bug: 144927670
Test: In follow up CLs
Change-Id: I9947e722dca228705190e8f2c49e47104c04dea6
2020-01-17 11:22:52 +00:00
Raff Tsai
4536fae5b7 Fix work tab app doesn't launch correct user intent
- Pass user.getIndentifier() to intent

Fixes: 147357696
Test: 1. go to Settings -> Storage -> Music&Audio
      2. switch to work tab
      3. tab "Audio files"
      4. should display work profile files

Change-Id: I0d2883c45eb7b883adbaf034c0a49c5e52ba82f6
2020-01-11 09:16:24 +08:00
shafik
430b94bbc1 Add settings UI for MANAGE_EXTERNAL_STORAGE
Adds a Special App Access setting for the app-op
OP_MANAGE_EXTERNAL_STORAGE. All apps requesting the corresponding
permission will be displayed in the settings page. Toggling the
preference switch for an app will grant/revoke the app-op.

All of the external references to the permission, app-op and their
corresponding activities and logic use the name "Manage External
Storage". All of the external displays and strings use the name "All
files access"

Test: * Install app with uses-permission MANAGE_EXTERNAL_STORAGE
      * Observe it appearing the All files access page
      * Toggle the switch and observe the change in
        'adb shell dumpsys appops'
Bug: 146425146

Change-Id: If5c9c5daa3616a3310c090283acfda933bf9df26
2020-01-08 09:24:25 +00:00
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