Commit Graph

472 Commits

Author SHA1 Message Date
Arc Wang
a63e9c625d [Large screen] Make slice deep linking to Settings show in 2-pane
- add a standalone home activity for slice deep link.
- add EXTRA_IS_FROM_SLICE to control the slice deep link flow.
- Intent#parseUri fails if the intent data schema is set.
  Add EXTRA_SETTINGS_LARGE_SCREEN_DEEP_LINK_INTENT_DATA to relay the
  data schema.

Bug: 201397123
Test: manual, robotest
      1.  Say 'Enable NFC'/'Enable Bluetooth'to Google assistant.
      2.  Click the the NFC/BT Slice.
Change-Id: Ia3216956328c32b2109cb2d70ad1105327661f26
2021-10-31 20:12:27 +08:00
TreeHugger Robot
541f0e447f Merge "Catch a resource not found exception" into sc-v2-dev 2021-10-19 07:26:40 +00:00
Arc Wang
499d8b26bd Merge "Improve scalability of Settings deep link API" into sc-v2-dev 2021-10-19 03:56:28 +00:00
Tsung-Mao Fang
78267b2f2f Catch a resource not found exception
Test: not see a crash
Bug: 198296421
Change-Id: I469a726a32d7bb2f6f81fc0dae27d5b1d1ac0933
2021-10-18 22:47:42 +08:00
Arc Wang
19052cb45e [Large Screen] Fix deep link 2 tasks bug
When launching a Settings deep link, it will close
Activity of the deep link and start both
DeepLinkHomepageActivity & the deep link.

Since 1st launched deep link page is finished,
should also remove its task.

Bug: 203385355
Test: manual
      1. Create a Settings shortcut on launcher.
      2. Click the shortcut.
      3. Move Activity of the shortcut to background.
Change-Id: I04b3243bf51f3940167e4dca6f5a32d9e3cf2841
2021-10-18 17:50:38 +08:00
Arc Wang
8b2dd65738 Improve scalability of Settings deep link API
Avoid using 'two pane' and 'large screen' because
they are implementation details exposure.

Bug: 201662312
Test: build pass
Change-Id: Id3555f734ff11e31d2f4db0479331c4f27e9e715
2021-10-12 21:31:54 +08:00
Jason Chiu
29a09e55ba Revert "Revert "Support highlightable Settings homepage menu for 2-pane""
This reverts commit 096c090b80.

Reason for revert: crash is fixed in this change

Bug: 202510128
Test: manual, build
Change-Id: Ifff8d58cfdcf43e123b11dee308665b2617cb4b3
2021-10-12 09:32:07 +00:00
Greg Kaiser
096c090b80 Revert "Support highlightable Settings homepage menu for 2-pane"
This reverts commit 9037ceabd3.

Reason for revert: Presumed cause of b/202510128

Change-Id: I0daaab95d9bc57229c0c8c916cbe3ada7aafb6fa
2021-10-08 14:29:06 +00:00
Jason Chiu
9037ceabd3 Support highlightable Settings homepage menu for 2-pane
1. Add a preference group adapter to perform highlighting
2. Add a class for mapping highlighable menu keys and preference keys
3. Add an API to determine if the screen is in split mode

Bug: 199017944
Test: manual, build
Change-Id: I8e3fe5fb96480a31ee0f3b3afb6ad78999d3d2bc
2021-10-08 12:52:52 +08:00
Arc Wang
3e8164647c [Large screen] Show full screen CreateShortcutActivity
Show full screen for CreateShortcutActivity because

-Launcher startActivityForResult for Intent.ACTION_CREATE_SHORTCUT and
 activity stack starts from launcher, CreateShortcutActivity will not
 follows SplitPaitRule registered by Settings.

- There is no CreateShortcutActivity entry point from Settings app UI.

Bug: 200916507
Test: manual
      Launcher menu ->  Widgets -> Settings -> select an item.
      Observe if it goes back go launcher.
Change-Id: I437ff9b82d5a4548e10aed7bd083fd01352433f4
2021-09-27 17:44:41 +08:00
Arc Wang
4dd3f11349 Fix not able to add Settings shortcut widget problem
After users select a shortcut item in CreateShortcutActivity,
launchers need to get result from CreateShortcutActivity.

For large screen devices, Settings deep link will start
DeepLinkHomepageActivity and then DeepLinkHomepageActivity
starts the deep link page. The CreateShortcutActivity result
deos not forward to launcher and there is no shortcut added.

This change uses Intent.FLAG_ACTIVITY_FORWARD_RESULT to
forward result from CreateShortcutActivity to launcher.

Bug: 200889769
Test: manual
      Long click launcher -> Widget -> Settings ->
      select an item and check if it adds a short on launcher.
Change-Id: Idd5fc642be5c1fb2f747316c3ddcd9b7f0b33852
2021-09-23 06:54:36 +00:00
Arc Wang
e4084028b3 Merge intent extra to deep link intent target for large screen devices
Sender of deep link intent may want to send intent extra data to the
deep link target Activity by merging intent extra.

Bug: 197048599
Bug: 197926040
Test: manual
      1. Click quick Setting 'Internet button'.
      2. Click the gear button of a connected Wi-Fi.
      3. Observe if the Wi-Fi detail page shows the connected Wi-Fi.
Change-Id: I32040ee21a747cae710df2e12a8f5b66aff086fa
2021-09-23 02:05:55 +00:00
Arc Wang
f6a8f6c8af Extends the criteria width of 2-pane mode
Follow UI spec, we extend criteria width from 600dp -> 720dp

Original code checks if there is only one Activity in
Activity stack to decide if it's a deep link intent,
it has problem at configurationChange.

This change checks if the intent is from Settings app
itself to decide if it's a deep link intent.

Bug: 197716926
Bug: 199808997
Test: Build apk and run on the device.
Change-Id: Ide8ef2ccffa87b9ee4fab41ab4f395b00def9bd6
2021-09-15 12:13:49 +08:00
Arc Wang
22ce392b91 2 panes deep link for large screen devices
This change supports deep link to Settings app internal pages
and external pages outside Settings app.

Apps need android.permission.ALLOW_TWO_PANES_DEEP_LINK_IN_SETTINGS
to send the intent of Settings#ACTION_SETTINGS_LARGE_SCREEN_DEEP_LINK.
Settings app will startActivity for the intent from
Settings#EXTRA_SETTINGS_LARGE_SCREEN_DEEP_LINK_INTENT_URI.

Bug: 197048599
Test: build pass
Change-Id: Idaf4a8be4603c1308f16fb4e378266c1e52acb40
2021-09-09 13:04:31 +08:00
Jason Chiu
c38978f3e1 Guard against the exceptions when launching a non-existing fragment
Test: robotest
Bug: 190371550
Change-Id: I2bb7d4bdb23756634526db7e272563a1587c9640
2021-06-30 18:33:59 +08:00
Jason Chiu
c713c3e8ea Support category changed mechanism in homepage
- Homepage cannot referesh UI whenever an injected component is changed
- Extract categories related codes to a mixin

Test: manual, robotest
Fixes: 179792445
Change-Id: I1c13c541ce07b9c36fe984a035623985b5603560
2021-06-18 16:00:29 +08:00
Yi-Ling Chuang
81226a2431 Refactor some transition codes.
- Make the transition logic simpler in SettingsBaseActivity.
- Remove the redundant transition code in SettingsActivity.

Bug: 177479937
Test: rebuild and click on pages.
Change-Id: I65cae59d4eae99e3b9c324c9b6ce89f2349aaf8b
2021-05-20 16:20:28 +08:00
Jan Tomljanovic
07bffff454 Launch SecurityHub fragment on SECURITY_SETTINGS intent when available.
Test: atest SettingsUnitTests
Test: adb shell am start -a android.settings.SECURITY_SETTINGS opens
SecurityHub screen (when SecurityHub enabled)
Test: assistant opens SecurityHub screen (when SecurityHub enabled) when
given instrucion to "open security settings"
Bug: 183930061

Change-Id: Ie8fcb2f2dce4cd0a2a84c6cd21a0a1c0b2b3665e
2021-04-29 17:38:52 +01:00
Stanley Wang
3b70c6c41a Fix the overlap issue of MainSwitch and list view.
This issue happen on Developer and Wi-Fi pages, so the problem
should be solved on SettingsActivity.

Fix: 181341927
Test: Run robotest and see the ui
Change-Id: I57722cfcbeb6390c88101d808429346045e57c92
2021-03-04 15:08:18 +08:00
Yi-Ling Chuang
c55901d2c0 Fix the transition of the up-button.
We've applied a new transition from Search to Settings, where if users
click on the up-button, the transition will not be applied. Hence, this
CL makes the up-button behave the same as the back key to address this.

- Also remove the transition target as it is not necessary.

Fixes: 177968777
Test: 1. Search "Gesture"
2. Click on "Gesture"
3. Tap the up-button and see the applied transition

Change-Id: I046424f244426750d98046703c05ae0a1d567c67
2021-01-29 15:40:36 +08:00
TreeHugger Robot
0cb063c9e4 Merge "Remove redundant toolbar from CollapsingToolbarLayout" 2021-01-15 10:21:38 +00:00
Mill Chen
7b163e2566 Remove redundant toolbar from CollapsingToolbarLayout
The new material library has been updated to be able to support
android.widget.Toolbar, so the redundant toolbar has to be removed.

Bug: 176882938
Test: visual verified
Change-Id: Ibada6b9d315c14d79e9f9f8015cbb5e00fbeea38
2021-01-15 14:43:30 +08:00
TreeHugger Robot
6987b78782 Merge "Redirect users from Search to Settings with transition." 2021-01-15 06:12:49 +00:00
Stanley Wang
b87ddba6cd Use SettingsLib's MainSwitchBar to replace SwitchBar in Settings.
To log Settings metrics, the MainSwitch extends MainSwitchBar and
replace the SwitchBar in SettingsActivity.

Bug: 175181773
Test: Run robotest and apply the widget in Settings and see the ui

Change-Id: I3add3702e9058ad9192b5172c7cf0e2ccfb55a70
2021-01-14 22:48:31 +08:00
Yi-Ling Chuang
2af2d0bf39 Redirect users from Search to Settings with transition.
Currently there is no transition while redirecting users from Settings
Search result to Settings. This CL gets Shared X-Axis transition applied
to make a better visual experience.

Bug: 177480699
Test: Click on a search result and see the transition.
Change-Id: Iad9b0c1168a939582e2648bc023c1321f9ec8049
2021-01-14 19:07:18 +08:00
Mill Chen
14cfd2f2ca Add CollapsingToolbarLayout for sub settings
Settings app is planning to make toolbar collapsible for next
Android release. This CL is to add a new layout for
CollapsingToolbarLayout in the Settings app and to update the theme
correspondly. This feature will be controlled by feature flag, which
makes Settings app compacitible with the existing layout.

Bug: 174451673
Test: manul test and visual verification
1) Enable the feature and open Settings app
2) Navigate to each sub page and check if toolbar is collapsible

Change-Id: Ibef524bbaa7ae3f0a43db7e40e599f42e009437f
2021-01-11 18:30:20 +08:00
Eric Sandness
b02952a5d3 Make Logic For Selecting Title Layout Consistent
Align the logic for selecting between the setup and non-setup versions
of the lock screen settings title layout, with the logic used in
ChooseLockGeneric.  This means using
WizardManagerHelper.isAnySetupWizard, rather than
WizardManagerHelper.isDeviceProvisioned.

Fixes: 151552453
Test: Manually verify screens in consumer setup, enterprise setup, and
Settings app

Change-Id: I75cd9e509320b9ef9b929dd592f16e8130d80a6e
2020-03-23 06:25:07 +00:00
Winson Chung
f07554fdb3 Updating call to set icon on task description
Bug: 143363444
Test: Manual
Change-Id: If4c20dea99cce6c365f509885beb7b561b70495b
2020-02-19 17:13:53 -08:00
Raff Tsai
910ea66615 Navigate to personal/work tab based on intent extra
Bug: 141601408
Test: Settings->Storage, click work tab, click Other apps. It should
navigate to Apps storage page and focus on WORK tab.
Change-Id: Ida91b279e771a2c7c960ce83b8e13310c87112e8
2019-12-04 11:42:23 +08:00
Jason Chiu
bac5987c8e [Settings] Support pure switch of inline toggle of Settings Injection v2
Bug: 132808482
Test: robotest
Change-Id: Ib24614fb46fe990925edad721e3b7d5d032854fc
2019-11-19 18:24:13 +08:00
Raff Tsai
062baadf4e Merge "Add personal/work tab for ManageApplications" 2019-10-22 23:47:32 +00:00
Raff Tsai
c898775914 Hide search box if it is called in initial setup wizard
- Search box is hidden if user set intent extra isSetupFlow true

Fixes: 135717823
Test: search box is hidden in the following command
adb shell am start -a android.settings.SETTINGS --ez isSetupFlow true

Change-Id: Ia3d955c9390d6b0eef9391b9b35b6a483eb63d26
2019-10-18 02:08:38 +00: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
65866290ce Add tablayout for work/personal profile
- Add Tablayout in ProfileSelectFragment
- Add AccountWorkProfileDashboardFragment inherited from
ProfileSelectFragment
- Add ProfileFragmentBridge to convert AccountDashboardFragment
to AccountProfileSelectFragment
- Use flag settings_work_profile to guard the new fragment

Bug: 141601408
Test: Settings->developer options->feature flags->
turn settings_work_profile on/off, then go to settings->account
to see if UI is changed.

Change-Id: Ifb32c22cdeab69c51517664081cacf4a401c46a1
2019-10-15 18:01:08 +08:00
Raff Tsai
6db277ebb7 Remove summary provider
- use SummaryProvider to provide the summary of UserSettings
- use WifiDisplayPreferenceController to replace the summary loader
in WifiDisplaySettings
- use ConfigureNotificationPreferernceController to replace the
sumary load in ConfigureNotificationSettings

Fixes: 141653158
Test: robolectric
Change-Id: Id5f5ed645707caa0b25ecae5252174cbf017651c
2019-10-03 15:04:36 +08:00
Raff Tsai
54a5c444da Fix crash in getMetricsTag
SettingsIntelligence put a null in intent extra bundle, caused the
crash. Check the null before use it.

Fixes: 137351833
Test: make RunSettingsRoboTests
Change-Id: I9630760396c72bddf6a11314b869873c3b83b45a
2019-07-22 12:33:21 +08:00
Vinit Nayak
f7d423d106 Remove Settings from recents after app uninstall
SettingsActivity now calls finishAndRemoveTask
instead of only finish() to prevent blank
recent task from showing in overview.

Test: Visually inspected bug doesn't exist. Wrote
Roboelectric tests

Fixes: 129733119

Change-Id: I5b73c1b611e6eb52bb6665c215276efdc85c19b2
2019-07-11 16:09:49 -07:00
Fan Zhang
b4b7725937 Revert "Revert "Make subsettings display edge-to-edge""
This reverts commit 9e98b8cf0f.

We have to set clipToPadding false on scrollView to make it extend below
navbar. But the side effect is it stops clipping to padding. So it
overlaps with sibling views. In this case anything pinned on top of
screen (switchbar, pinned header for most UIs, and preview indicator for
font size page).

To fix them:
1. in preview pages, just revert back to clipTo*. Their UI doesn't scroll
   so it they don't need to special clip flag to begin with.
2. For pinned to top headers, we need to change the "z-order" by setting
   elevation and make sure background is not transparent.

Fixes: 132182711
Fixes: 132672399
Test: visually on normal screen, font size scree, wifi main setting UI,
      wifi data usage screen

Reason for revert: Rollforward with fix.

Change-Id: Ib6f7c4167b9a680a336f2a7310d82340094d3aac
2019-05-14 13:48:12 -07:00
Fan Zhang
9a51ede665 Merge "Revert "Make subsettings display edge-to-edge"" into qt-dev 2019-05-14 17:17:26 +00:00
Fan Zhang
9e98b8cf0f Revert "Make subsettings display edge-to-edge"
This reverts commit c2a85a374d.

Bug: 132672399
Bug: 132182711
Test: n/a

Reason for revert: b/132672399

Change-Id: Icb34ae5b16b7a32215fe2c1a5f0d0d028c91b2ca
2019-05-14 16:31:08 +00:00
Cn Chen
421a05a6a9 Merge "Font size page support light theme in deferred setup" into qt-dev 2019-05-14 07:18:03 +00:00
cnchen
3eee5cf02e Font size page support light theme in deferred setup
Bug:124470158
Test: atest & manually test
Change-Id: I41e1e98a9a64e516a294c4a94c8b5f335434078f
Merged-In: I41e1e98a9a64e516a294c4a94c8b5f335434078f
2019-05-14 14:01:14 +08:00
Fan Zhang
c2a85a374d Make subsettings display edge-to-edge
Fixes: 132182711
Test: visual
Change-Id: I3b0635cba359f74d463c2360323d80c5c9533228
2019-05-13 10:07:13 -07:00
Andrew Sapperstein
067332ca9e Merge "Move SIM_SUB_INFO_SETTINGS to NetworkDashboardActivity." into qt-dev 2019-04-26 20:27:01 +00:00
Andrew Sapperstein
c65ccd23b4 Move SIM_SUB_INFO_SETTINGS to NetworkDashboardActivity.
Remove the entry point for SimSettings and redirect any intents to the new UI.

Filed b/131324863 to track deleting the code.

Fixes: 128859223
Bug: 131324863
Test: adb shell am start -a com.android.settings.sim.SIM_SUB_INFO_SETTINGS
shows main connectivity screens

Change-Id: I4a4ed5c34d231eaab929a923c7fcbbfc1e0ed6f3
2019-04-26 12:01:42 -07:00
Chandan Nath
f94033dafc Always show backup settings (even if backup is deactivated).
Previously,
1) we showed backup settings for main users (including secondary non-profile users) only
when backup was activated
2) for profile users, we always showed backup settings.

However, this results in a nullpointer when opening Settings when backup is deactivated
for both main and profile user.
This CL fixes that nullpointer(and also changes existing functionality since keeping
existing functionality and fixing the nullpointer would be too large a code change)

For more details, see https://b.corp.google.com/issues/129843872#comment9 and
https://b.corp.google.com/issues/129843872#comment12


Bug: 129843872

Test: 1. atest -v UserBackupSettingsActivityTest
2. atest -v BackupInactivePreferenceControllerTest
3a) backup not active for main and profile user. shows "isn't active" for both
3b) backup active for main only. shows backup settings for main user and "isn't active" for profile.
3c) backup active for both. shows backup settings for both.
3d) backup active for profile only is not possible (as profile backup is only active when main
user backup is active). if we try to force set it, we get "isn't active" for both
3e) backup not active for secondary user. shows "isn't active"
3f) backup active for secondary user. shows backup settings.


Change-Id: Icb87a047068d29eda560c45dfa4ae02bc991b1af
2019-04-24 18:26:27 +00:00
Chandan Nath
826a91c56e If backup service is not available, remove Settings->Backup and Backup->"Backup is disabled by
admin" from search results.

"Backup -> Backup" still appears due to the PrivacySettingsActivity. On clicking that,
we get "Backup is disabled by admin" which is OK

Bug: 129743816

Test: 1. atest -v UserBackupSettingsActivityTest
2. atest -v BackupInactivePreferenceControllerTest
3. Create and switch to secondary user. Type "backup" in settings search. Note that only
"Backup->Backup" is shown and on clicking it, we get "Backup is disabled by admin"

Change-Id: Ic13e2d745c9511cbebe27aa4c6f5cd89b277fc37
2019-04-15 20:47:34 +01:00
Chandan Nath
e4f0c78bb3 Merge "Show "Backup service isn't active" if backup isnt active for work profile" 2019-04-02 14:20:41 +00:00
Chandan Nath
9071506902 Show "Backup service isn't active" if backup isnt active for work
profile

Bug: 127821779

Test: 1) Set up work profile.
2) adb shell bmgr --user 19 activate true
3) Settings -> System -> Backup -> Work -> Shows google backup settings
4) adb shell bmgr --user 19 activate false
5) Settings -> System -> Backup -> Work -> "Backup service isn't active"

Change-Id: Ifc16cf3e69fd9db87d519cbad68f0f8e9d8ef6f3
2019-04-02 12:18:45 +01:00
pastychang
fefc66853b Set attribute sucUsePartnerResource
Add the attribute for all pages apply gliflayout of setupdesign library.
In addition, set the value false to remove stencil theme customization for outside setupwizard flow.

Test: atest
Bug: 128961334
Bug: 128364683
Change-Id: If55e9bf97970a5cd08d8d426747c483d80565559
2019-03-26 09:00:49 +08:00