Commit Graph

64 Commits

Author SHA1 Message Date
Edgar Wang
609d900f4d Remove the Summary of Backup in System Settings
Fix: 182357397
Test: manual and robotest
Change-Id: Ic6b08cfd23947af82fd1e9075dd5f698168127ac
2021-05-04 02:28:13 +00:00
Edgar Wang
bd0dd5d886 Rearrange System settings
- Fork system_dashboard_fragment_v2 for dev.
- Reorder the preference
- Remove summary

Bug: 174965365
Test: manual & robotest
Change-Id: Icc994f3b2e38ad54958deb5c9f80b6cd085029f0
2021-01-29 12:10:58 +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
Tobias Thierer
246f1fbc90 Merge "Fix malformed OWNERS." am: b460d47489 am: 7a8b3a140e am: dfba9408c0 am: 8977bd2b81
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1495947

Change-Id: I437a81f4fda887fd89cf22b1b16cb8d942f0275e
2020-11-11 22:26:26 +00:00
Tobias Thierer
6b3df1be9e Fix malformed OWNERS.
Per go/android-owners, include directions should be of the form
[gerrit_project_name]:[absolute_path_to_included_file].

Exempt-From-Owner-Approval: Only editing OWNERS file that ought
to be owned by ourselves, anyway.

Bug: 159055442
Test: Treehugger
Change-Id: I9130985b484349264f1fc42c320e93b2bc672a59
2020-11-11 20:45:53 +00:00
Tobias Thierer
efd5a23b73 backup settings: Update OWNERS.
Refer to platform OWNERS + bug component.

Bug: 159055442
Test: Treehugger
Change-Id: I2fdbf98a8326285ef41482cc207ed9aa94e9a0f4
Merged-In: I2fdbf98a8326285ef41482cc207ed9aa94e9a0f4
2020-10-31 01:23:27 +00:00
Tobias Thierer
05783b4e6d backup settings: Update OWNERS.
Refer to platform OWNERS + bug component.

Bug: 159055442
Test: Treehugger
Change-Id: I2fdbf98a8326285ef41482cc207ed9aa94e9a0f4
(cherry picked from commit bfe97711c99ee6654e3cc3c94bc504d3d2f49ec4)
2020-10-31 01:22:46 +00:00
Edgar Wang
c2e4513fb6 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: robotest & manual
Change-Id: I36829e0055437dab79d9e5339ac002a87a4b874f
2020-08-04 18:12:48 +08:00
Al Sutton
44dd1aa26e Update OWNERS to reflect current team
Test: CI verifies email addresses
Change-Id: I3da2759a28e715667ce594aea15508522bdd72c6
2020-07-31 11:54:57 +01:00
Yanting Yang
b7e1ececea Fix breadcrumb of search results provided by Settings
1. Settings Search need Settings to provide custom site map pairs to
build up full breadcrumb for the search results from below pages.
- PowerUsageAdvanced
- RecentLocationRequestSeeAllFragment
- UsbDetailsFragment
- UserBackupSettingsActivity

2. Update the screen title of Backup raw index data from Settings to
Backup to display correct breadcrumb in Settings Search.

Bug: 147851992
Bug: 151206664
Fixes: 152368059
Test: visual and robotests
Change-Id: Iaebab8d549bba6be7623708f9833349654e7f2a7
2020-04-10 20:56:39 +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
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
Raff Tsai
1f30b1cd67 Merge similar BaseSearchIndexProvider code together
Bug: 135053028
Test: robolectric, check search_index.db contains the same items
Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
2019-09-12 11:09:09 +08:00
Al Sutton
1fef77dd90 Add alsutton@ to OWNERS for backup settings
Bug: 140479949
Test: build/make/tools/checkowners.py -c -v
packages/apps/Settings/src/com/android/settings/backup/OWNERS
Change-Id: I373aa0521feb0da8c4c5d98a7199ea9ca848123a
2019-09-10 14:45:56 +01:00
Sunny Goyal
ae788a1631 Restoring pinned shortcuts to original state after restore
Creating an no-op backup agent in settings. This ensures that
we get onRestoreFinished callback after restore is finished where we
can update all pinned shortcuts.

Bug: 110016648
Test: Verified backup->clear-data->restore path on device
Change-Id: Id14d0792d60ba08d97078a31a81d2b63ab8ce109
2019-04-30 10:25:40 -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
TreeHugger Robot
67c9f40278 Merge "Add a flashlight handler activity to support indexability." 2019-04-03 20:48:23 +00:00
Fan Zhang
03dd39c92a Add a flashlight handler activity to support indexability.
Fixes: 128465925
Fixes: 123711093
Test: reindex
Change-Id: Ie082e65ee070f6143c4c65db3f70615b16af0e52
2019-04-03 12:16:33 -07: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
Annie Meng
ae53699277 Use new dataManagementLabel AIDL in Backup Settings
1) Uses new AIDL method getDataManagementLabelForUser
2) Changes data management label type from String to CharSequence

Bug: 113856654
Test: atest $(find \
packages/apps/Settings/tests/robotests/src/com/android/settings/backup \
-name '*Test.java')

Change-Id: I2325527c67878467b96fb93de50faafe153fdb21
2019-03-20 12:12:50 +00:00
TreeHugger Robot
dc7683b3a4 Merge "Update OWNERS for backup settings" 2019-03-19 11:48:40 +00:00
Annie Meng
66ac958993 Update OWNERS for backup settings
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: Ib98d9c9ef2b538b7d620e1361d0e48d263635449
2019-03-18 17:18:39 +00: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
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
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08: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
Fan Zhang
9ce4a1fcde Use searchable="false" to suppress nonIndexables.
When possible, remove or simplify getNonIndexable() logic in fragments,
and use searchable="false" in xml to suppress index.

Change-Id: I5bdf5bc7d5494a64cdd9e230a51321a4b210af69
Fixes: 112608186
Test: robotest and manual search
2018-08-17 09:21:05 -07:00
Fan Zhang
a79c377fbc Declare "searchable" attribute for preferences.
Now we can easily mark a preference nonIndexable in xml instead of
adding key into searchIndexProvider.

Bug: 112608186
Test: robotests
Change-Id: I0ff16d44bb7b6ad148d3d35f09ca0da0163f73f4
2018-08-16 09:06:39 -07:00
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08: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
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
Doris Ling
ba62229b3c Add resource for Backup summary.
- currently, the backup summary is using the accessibility summary
resource. In Spanish, the summary needs to be gender specific. Create
its own resource string so that it can be translated into correct
gender.

Change-Id: Iae14d7d3fc342264c5c8bff6bdfca0849bb4ba93
Fixes: 78477107
Test: make RunSettingsRoboTests
2018-05-16 16:10:21 -07:00
Matthew Fritze
f87a1f3f41 Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 08:36:59 -07:00
Fan Zhang
16de45d8ec Fix NPE during unit test
As of ag/3932176 the slice indexer now queries getSummary() for each
controller. So we need to create all necessary objects before
getSummary(). In this case, the PSCD object.

Change-Id: I0162996be37d740f1e450880bf4698acd94ca0ad
Fixes: 78897071
Test: atest
2018-04-30 15:17:22 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
sunnyshao
15ec2cf8ef Modified the PrivacySettings and add PreferenceControllers
- Changed the PrivacySettings to DashboardFragment.
- Added the new five related PreferenceControllers and related codes
- Modified the privacy_settings.xml
- Removed the PrivacySettingsTest test by design changed
- Moved the PrivacySettings.java from root directory to backup

Test: manual
Test: make RunSettingsRoboTests
Change-Id: Ic88e2e58a11d024d2394f75c3db5b46fe2d86dba
2018-04-18 18:02:53 -07:00
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
Bernardo Rufino
368b5a6b2c Catch SecurityException from enabling backup activity
Cases where the activity is already enabled and the account is an unicorn
account.

Test: Opened activity from backup settings w/ unicorn account, verified
      no crash
Bug: 74199770
Change-Id: I7dc30d22b186ff19cf7c40fda0363ff1288224d1
2018-03-07 08:49:31 +00:00
Fan Zhang
04f1423bfa Remove custom updateState() if it's just setting summary
Change-Id: I6311d67d6ba11961a6814b91dcd8e37a2e17df40
Fixes: 73950519
Test: rerun robotests
2018-02-28 15:22:09 -08:00
Fan Zhang
906572b127 Change PreferenceController#getSummary return type.
Return CharSequence instead of String.

All user visible string should be modeled as CharSequence.

Bug: 73950519
Test: robotest
Change-Id: I30befef0c33f94351d4a2774e283bd1ed804aa8b
2018-02-27 22:30:12 -08:00
Fan Zhang
f7843adabd More renaming in DashboardFragment
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936

Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
2018-02-23 16:56:30 -08:00
Fan Zhang
f11c885766 Pre-fixup for nav up button
- Remove SettingsDrawerActivity.EXTRA_SHOW_MENU and force up nav button
  to always show. The button doesn't do anything yet. It just finishes
  current activity.
- Remove dead code about suggestions

Change-Id: I61fa9fefbaa9bced841a05969544b1c824c564ce
Bug: 72337421
Test: rebuild
2018-02-07 10:27:18 -08:00
Matthew Fritze
c69f73f4d1 Support getDynamicSummary in BasePreferenceController
Adds dynamic summary getter in relevant BasePreferenceControllers.
Preferece controllers that don't have dynamic summaries or which
are not yet BasePreferenceControllers are not changed right now.

Change-Id: I435ccab7758d90515583fd8ca10a9b1ef0c858b9
Fixes: 71514936
Test: robotests
2018-01-04 13:58:01 -08:00
Matthew Fritze
7d2b4f5fc7 Add PrefController in XML support
Add the ability to define a Preference Controller
in xml using the 'controller' tag.

This is useful for two reasons:
- It allows the controllers to be instantiated via
reflection for Slices and Dashboard fragment
- Removes the requirement that controllers be defined manually
in Fragments

In order to be instantiable, they must have a unified construction
following either:

  ClassName(Context)
  ClassName(Context, String)

Also added a robotest that verifies that all controllers defined
in XML follow the constructor schema, and extend
BasePreferenceController.

Test: robotests
Bug: 67996923
Change-Id: I304b35dc666daebecf0c9e286696f3f2a510704a
2017-12-12 14:21:12 -08:00
jackqdyulei
5f21c6913b Add OWNERS for package backup
Bug: 65294119
Test: Manual
Change-Id: I804b50a38c877da80b5ef3251e16029259014152
2017-09-07 13:51:26 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00