Commit Graph

489 Commits

Author SHA1 Message Date
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
Chandan Nath
4d626f63ec [Multi-user] Show Backup only if Backup is activated
This almost reverts the change to SettingsActivity#doUpdateTilesList in ag/6140694
except that instead of setting enabled to true, we set it to whether
backup is activated for this user.

Bug: 124114084

Test: 1a) Set up secondary user
1b) See that there is no Backup option in Settings Homepage - System
1c) adb shell bmgr --user 10 activate true
1d) Backup option is now present
1e) adb shell bmgr --user 10 activate false
1f) Backup option isnt there again

Change-Id: I3f17aabee92bedc91386444c2f0aede696d0fd13
2019-03-12 11:01:26 +00:00
Fan Zhang
4df9bfaa3e Remove feature flag for contextual home.
Fixes: 118444000
Test: rebuild
Change-Id: I4b42e22bd93c2d79bacbd40b28912b4e6808325a
2019-02-22 15:40:49 -08:00
TreeHugger Robot
d89332b8c8 Merge "Add referrer when launching search intent." 2019-01-30 18:57:28 +00:00
Chandan Nath
e0dde6a6cd Merge "[Multi-user] Change Backup Settings page to support multi-user." 2019-01-30 14:03:38 +00:00
Fan Zhang
beedd3abe5 Add referrer when launching search intent.
Bug: 123294739
Test: robotests
Change-Id: I600abf1d764e828d52f3b8d35ad24cdc94dfba01
2019-01-29 14:10:05 -08:00
Chandan Nath
0bfef63812 [Multi-user] Change Backup Settings page to support multi-user.
With multi-user backup, backup will be available or secondary users and profiles too.

1. When there are profile users, this CL changes UI flow A to B
A. Settings Homepage -> System -> Google Backup Settings for primary user
to
B. Settings Homepage -> System -> Profile Select Dialog -> Google Backup Settings for chosen profile.
Change done as per https://g3doc.corp.google.com/company/teams/apps-android-settings/howto/ia.md?cl=head
2. Functionality remains the same when there are no profiles (BackupSettingsHelper, BackupSettingsContentProvider)
3.  Also, enabled Backup Settings for secondary users. (Previously, backup settings were only shown for
system user).(SettingsGateway)

Bug: 121198738

Test: 1) System -> Backup -> shows Profile Select Dialog -> Backup page for selected profile
2) On secondary user without profile, System -> Backup (with summary) -> Backup page for secondary user.

Change-Id: I6e21279978a5dfc6eca6f5a34bbfc15a34eac68b
2019-01-29 00:45:55 +00:00
Fan Zhang
39d9d7ce8b Clean up switchToFragment call.
This will make logging where search is launched from slightly easier.

Bug: 123294739
Test: manual
Change-Id: I62a804cdf6b8a5fa8ae68dcf9e2b56cc8358afb7
2019-01-23 16:43:55 -08:00
Fan Zhang
e994d4665d Fix crash when dynamic_homepage flag is off.
This partially rolls back ag/5650901. We should revert this change when
dynamic_homepage flag is permanently on.

Change-Id: I5e340421d04bc20c77dd30395fd8522693807954
Fixes: 118444000
Test: manual
2018-12-04 13:05:47 -08:00
Fan Zhang
8e14ca0058 Remove obsolete logic in SettingsActivity.
mIsShowingDashboard is always false, it used to be true when we are
displaying homepage, but now homepage is hosted in a entirely different
activity.

so all related logic can now be removed.

Test: robotests

Misc clean up: remove unused colors

Test: rebuild, color-lint
Change-Id: I1e1628c1e9606c2b7dc40ef3c21d4ed1391a8c03
2018-11-29 11:37:00 -08:00
Fan Zhang
9864a70f12 Misc clean up.
- Remove unused SubSetingLauncher parameters: hide_drawer, is_shortcut

Test: robotests
Change-Id: Ic0e6c3aa2c1679010e7ca8356662899f0df7e272
2018-11-27 12:37:57 -08:00
Fan Zhang
0c7c59f1b9 Make android.settings.SETTINGS intent go into homepage.
Change-Id: Ib7453a79a473410c44bdcf06019446cedd34f837
Fixes: 117281845
Test: robotests
2018-10-28 15:59:24 -07:00
Fan Zhang
130c477044 Remove DashboardSummary and all related classes.
- Condition is already supported in PersonalSettingsFragment
- Suggestion is already supported in PersonalSettingsFragment
- Static/dynamic tiles are supported in TopLevelSettings

Change-Id: I51882e3bd0919ad95109baefac683d98667c11e3
Fixes: 110405144
Test: robotests
2018-10-25 11:27:47 -07:00
Fan Zhang
615f18e987 Fix nav-up button in main settings activity.
It should be a non-clickable search icon, not back button. Apparently
the init code must be executed after setActionBar.

Change-Id: Ibbc8aefeebc44562c6105cb51e6f6447a9705ff9
Fixes: 117797520
Test: manual
2018-10-17 16:27:41 -07:00
Fan Zhang
3181e1aceb Change search fab to search bar.
- Remove search fab from layout xml
- Change RelativeLayout to CoordinatorLayout so we can use prebuilt
  scrolling behavior
- Minor update to theme so search bar background works in dark mode for
  the homepage activity.

Change-Id: If7408c12684be65137e04ae3bb4137204c2d77e0
Fixes: 117508596
Test: robotests, visual
2018-10-10 16:29:22 -07:00
Fan Zhang
6632529ba1 Remove DeviceIndex feature/service.
Change-Id: I8444101669aef013183842c2d13cf3960c756398
Fixes: 112587202
Test: rerun all tests
2018-10-08 13:47:07 -07:00
Fan Zhang
d9e1871fde Don't persist device index job across reboot
Change-Id: I9bd25c7f266dded730918ec517e842c2b6ee9b1a
Fixes: 115930605
Test: manual
2018-09-19 16:08:56 -07:00
Fan Zhang
44be9131b1 Open personal settings tab when launching homepage
Change-Id: I341e1a128fda7db8f953f9a0800050cc007554c5
Fixes: 114441682
Test: manual/robotest
2018-09-07 13:44:21 -07:00
Fan Zhang
21526c1f80 Launch the new TopLevelSettings for all settings tab.
The new TopLevelSettings page uses a standard DashboardFragment to host
all top level settings. It's easier to maintain than DashboardSummary.

It does not support conditional cards or suggestion cards. We will use
PersonalSettingsFragment to host these as contextual cards going
forward.

Bug: 110405144
Test: visual
Change-Id: I2ab2d3556e870e86ebc18f9876336c4a3a361897
2018-09-06 18:04:05 -07:00
Christine Franks
be2370db13 Remove demo restrictions
These are now available as user restrictions.

Bug: 113298946
Test: make RunSettingsRoboTests -j100
Change-Id: I637083c8edcf43b99cebbf5a7dfd60afee441ade
2018-08-27 18:45:24 -07:00
Fan Zhang
3506b74659 Get Tile#intent through getter
Bug: 77600770
Test: robotests
Change-Id: I17d3556f833e6a9610fe34f382534bd90bb0499f
2018-08-07 14:50:18 -07:00
Fan Zhang
60243e6873 Remove custom tintable check.
Make a bunch keys private in tile and DashboardCategory
Bug: 77600770
Test: robotests
Change-Id: I4693e6bb71bd50cc664f578c7f8e25e67da20b67
2018-08-03 16:38:36 -07:00
Doris Ling
882bef3962 Disable changing lock when device is not provisioned.
When the device is not yet provisioned and settings is launched:
- disable the entry point for changing device lock
- remove the search panel from settings home page
- remove the search menu

Bug: 110034419
Test: make RunSettingsRoboTests
Change-Id: Ieb7eb0e8699229ec0824ccc19d7b958ac44965a2
2018-08-01 10:18:01 -07:00
Fan Zhang
af32e726e6 Allow activity to delegate onActivityResult to fragments
Change-Id: Iac388f1726269239313d666f3123f28348e0c90a
Fixes: 111531567
Test: rototests
2018-07-17 10:59:02 -07:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -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
Sunny Goyal
3c84675db7 Using icon resource instead of icon bitmap in task description
Bug: 110739775
Test: Verfied that the icon is displayed correctly if icon-shape override is applied in laucher
Change-Id: Ice7e15a982479960b2644defa33dbdb036c6bd42
2018-07-03 11:41:53 -07:00
tmfang
d97fba5f0f Fork SettingsDrawerActivity in Settings.
Settings app uses fragment classes from android framework,
which is deprecated as of P.
We need to switch to use fragment and associated classes to androidx.

Because Settings didn't support drawer feature since Android O,
we rename SettingsDrawerActivity to SettingsBaseActivity.

Before we migrate to fragment of androix,
we need to let SettingsBaseActivity extend FragmentActivity.

Test: make RunSettingsRoboTests
Bug: 110259478
Change-Id: Ifbf53f75f042da1618da16cf7837b70d298a9a14
2018-06-28 13:38:16 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Fan Zhang
cd21cb8def Remove DataSummaryUsageLegacy.
Change-Id: I8da039530cafe547008b434b6016add5f9383e94
Fixes: 109943959
Test: robotest/atest
2018-06-11 11:05:54 -07:00
Gilbert Lee
0b4722f088 delete DeviceInfoSettings and activity, pref xml
Fixes: 78653510
Test: Manual

Change-Id: I13379f3f7812ceedffc0e9647db15e6358a3dc17
2018-05-20 16:17:43 +08: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
Christine Franks
986d02f03c Remove demo-specific Developer Options logic
Bug: 78654980
Test: make RunSettingsRoboTests

Change-Id: Ia0f3c10a6c73b3067a9f476af6e982e3ca60a46b
2018-05-08 19:50:49 +00:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00