Commit Graph

56 Commits

Author SHA1 Message Date
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
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Julia Reynolds
ec84a9367f Link to the appropriate config activity for dnd rules
Test: atest, manual
Bug: 111474881
Change-Id: I0c1d7b14abe3cf65762167f3c412fa8f2be1d842
2018-12-14 14:41:48 -05:00
Beverly
48903ccefe Add edit and delete buttons to zen rules
Test: atest ZenModeScheduleRuleSettingsTest ZenModeEventRuleSettingsTest
Test: manual
Bug: 111475013
Fixes: 120787343
Fixes: 120758763
Change-Id: If81ce2972e6887fb2a85d4b7262e81b26162e19c
2018-12-11 13:56:05 -05:00
Beverly
6afe8365a9 Update Zen Automatic Rule Settings page
Test: atest ZenModeBackend
Test: make RunSettingsRoboTests
Bug: 111475013
Change-Id: I86cc2c35002cd3a74d21f080eaf6d0fc29fa6a17
2018-12-03 14:17:42 -05: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
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
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07: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
aed8994f6f Rename Indexable::getAllPreferenceControllers.
To getPreferenceControllers. "all" is redundant. Then internally, the
old getPreferenceControllers() is renamed to
createPreferenceControllers() to emphasize the controllers are created
from code (versus the ones created from xml).

Bug: 73668763
Test: robotest
Change-Id: Ifec46aefdc2a418031c8e152028b30bdcd396fc7
2018-02-23 16:37:28 -08:00
Tony Mantler
09d2d71760 Move ServiceListing to SettingsLib
Also tidy things up a bit

Bug: 70902607
Test: RunSettingsRoboTests
Change-Id: Id641beb601513bb4e34a098bf2729eb98954175d
2017-12-21 09:49:44 -08:00
Beverly
323522171d Updates to automatic rule pages in Settings
- Re-added metrics for zen behavior preference controllers
- Dialogs in zen mode settings are rotate-friendly
- Automatic rules are refreshed on update state
- User-created (and default) automatic rules are always priority only and user cannot change this
- Automatic rules redesigned to have headers

Test: make ROBOTEST_FILTER=ZenModeAutomaticRulesPreferenceControllerTest RunSettingsRoboTests -j40
Bug: 63077372
Fixes: 68324465
Fixes: 69057696
Change-Id: I163acef2715dd4e60bfc08207f0e22352c4c0e28
2017-12-06 10:14:08 -05:00
Fan Zhang
1ae1e17199 Fix indexing in cast and zen mode settings
- Fragment should either not implement serach provider or return a valid
  xml. Search provider with 0 resource is invalid.

Change-Id: Ie87c739bf72c926cecf48d271c6c2d72459787c4
Fixes: 69864274
Test: robotests
2017-11-28 17:50:15 -08:00
Beverly
495c646744 Code cleanup in Zen Mode Settings
Changes in response to code review from automerged commit ag/3171711

Test: make -j40 RunSettingsRoboTests
Bug: n/a
Change-Id: I5df3db4e8ff421ca9911c84ae3f621a0e3d08092
2017-11-17 11:05:34 -05:00
Beverly
a58e52a0be Added zen settings messages and calls preferences.
- Made ZenModeSettings and ZenModeBehaviorSettings a DashboardFragment
- Switches in ZenModeBehaviorSettings all have their own preference controllers
- Instead of a dropdown, messages & calls have their own pages & preference controllers
- Added basic turn on/off DND button in settings (dialog not yet implemented)

Bug: 63077372
Fixes: 69057767
Test: make -j40 RunSettingsRoboTests
Change-Id: I1c70f77053713f66f873ee578477f23cfd7985bb
2017-11-14 14:16:26 -05:00
Beverly
4359d4b9c9 Moved zenMode visual effects + automatic rule page
- Automatic zen rules have their own page like in N
- Minor string changes to page and add rule dialog
- Zen mode visual effects was moved into behavior settings

Bug: 63077372
Test: $ make SettingsUnitTests -j40
$ adb install -r ${OUT}/data/app/SettingsUnitTests/SettingsUnitTests.apk
$ adb shell am instrument -w com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner

Change-Id: I9635f8f7969b76d036bc06ec44705815e540777a
2017-10-27 09:49:04 -04:00
Julia Reynolds
e17590271f Move automatic rules to main DND settings page.
Change-Id: I32b103714d4864ab32e2c85d86106dc118f9c338
Fixes: 31050255
Test: manual
2017-03-27 15:57:39 -04:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Fan Zhang
aa71afe597 Use MetricsFeatureProvider for logging in Settings.
Bug: 31664539
Test: make RunSettingsRoboTests for regression
Test: adb logcat -b events | egrep "(sysui_|notification_)" for
      verifying log

Change-Id: Id944be7c4ff9911aebee481c2df485542f1318f0
2016-09-23 08:37:37 -07:00
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Julia Reynolds
83f35ba88d Notification listeners have full DND access.
Bug: 27976092
Change-Id: I9603d900d7cee5666ec3567b4f42fee6d93ae5f8
2016-04-13 16:55:31 -04:00
Julia Reynolds
2bcb0778c3 Rules without a configuration activity aren't clickable.
Bug: 27823109
Change-Id: Ifa2291627846e562f9a04ec1e85582833ab234de
2016-03-24 15:10:25 -07:00
Ruben Brunk
e1c98ca821 Add settings VR listener service.
Bug: 22855417
Bug: 26724891

- Adds a settings panel allowing users to toggle the
  enabled/disabled state of each VrListenerService
  component installed.
- If disabled, a VrListenerService will not be bound
  from the framework, even when requested by a VR
  application.

Change-Id: I606eb712c011d160b9fbdd3c0e8fd744c653ef07
2016-03-04 16:07:09 -08:00
Julia Reynolds
1d33d59be2 Api review: AutomaticZenRule
Bug: 27364144
Change-Id: Ic0ea5d4958711cf5216e87ad8054460ad4246856
2016-02-26 18:38:50 -05:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Sudheer Shanka
366d8809c8 Add policy disabled msg as empty views in zenmode related fragments.
Change-Id: I0d7489d2884ffd5c227a37a638d560bf033f5cd9
2016-01-25 21:10:24 +00:00
Julia Reynolds
0cca0f5c02 Obey rule instance limit.
Do not show a rule type in the 'Add rule' dialog if the number of
current instances of that rule equals the max number of instances 
allowed by that rule type.

Bug: 25563007
Change-Id: I18f2598c6d92aec93c27755bb6b04c460ee294d0
2016-01-15 15:21:41 +00:00
Julia Reynolds
2ba71ad15d Don't show orphaned rule instances in Settings.
Bug: 25472361
Change-Id: Ic9bec4872777b720aa786679cbc960a9ee51dbe1
2015-12-17 08:46:09 -05:00
Julia Reynolds
bebd2a482e Null check in onPostExecute.
Change-Id: I8bc8c0b062583b4b9c54152c516f160df4f645e7
2015-11-04 10:11:41 -05:00
Julia Reynolds
2714f2ba07 Permission changes for DND Add Rule page.
Don't whitelist CPs when visiting the Add Rule Page; update
the permission CPs are tracked by; don't show CPs in the add
rule dialog if the user hasn't whitelisted them.

Bug: 22977552
Change-Id: I8b363d7106de088e68b9659e3f0098848c6d3153
2015-10-30 11:32:05 -04:00
Julia Reynolds
0768ef68ca Temporarily reenable 3P condition providers.
This code will go away once there is a better way for a user to
approve 3P CPs.

Change-Id: I56a72d03a75c2c60f6f19f82f091d9a1c7f3f715
2015-10-28 09:55:04 -04:00
Julia Reynolds
35f8f6bcf3 Always show rule creation option.
Change-Id: I3508c15a0e9b727d7bc3dd63bd6482a623aaef5b
2015-10-27 15:29:24 +00:00
Julia Reynolds
8fe6efc8e1 Update sorting for rule types and instances.
Bug: 22977552
Change-Id: I671f45f156f8f3faa4ce55608dd1d61b9f07d16a
2015-10-16 11:43:54 -04:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Julia Reynolds
25cb8f0691 Use id-based zen rule APIs.
Also names no longer have to be unique.

Bug: 22977552
Change-Id: I8dbee85c15d12d5380345447047a0d49c903522e
2015-10-08 13:07:07 -04:00
Julia Reynolds
f7748e4ae1 Update zen rule type selection and view.
Separate rule type selection from naming, launch 3P UI for non-system rules.

Bug: 22977552
Change-Id: Ifbd82da2192c4aaf5f239a188a016d9e1af542d6
2015-09-30 16:00:19 -04:00
Julia Reynolds
7d8a9aead5 Use public APIs for modifying automatic zen rules.
Bug: 22977552
Change-Id: I544f1462ad77cdeb33ccff3c9de11ea37df5505d
2015-09-30 08:57:47 -04:00
Julia Reynolds
cf92ef10a5 Updates to automatic rule listing page for 3P rules.
Show the provider app icon and name; allow deletion from
listing page; remove the rule summary for consistency.

Bug: 22977552
Change-Id: Ib71832fa4ff64b7321ade39f9964ac52cee6c643
2015-09-21 11:30:02 -04:00
John Spurlock
bd352af3cf Settings: Migrate zen event conditions to use calendar name.
And make sure any existing calendar value always appears in the
picker, even before it exists in the calendar provider.

Bug: 17755700
Change-Id: I8aa298a0d5804c288e2596f18c2dc7318f752121
2015-05-28 22:20:44 -04:00
John Spurlock
fa76a652e4 Settings: Display corp profile calendars in event rule selection.
And sort the accounts by display name.

Bug: 21155107
Change-Id: I8789022535ba7c66d950f5ec6f93c40ffb8106d3
2015-05-26 12:55:56 -04:00
Chris Wren
46c8f759fd Merge "log more settings actions" into mnc-dev 2015-05-11 15:07:18 +00:00
Chris Wren
1b6ffba9e6 log more settings actions
airplane mode
  bluetooth
  cell data
  do not disturb

Bug: 20264417
Change-Id: I726033a126fba9f9dffc916806d636feea04033b
2015-05-08 18:48:24 -04:00
John Spurlock
33bf636e72 Settings: Use new EventInfo.ANY_CALENDAR constant.
Bug: 20064962
Change-Id: I08a8c5feb61bfd440fc6a297d97de4abba5b19b3
2015-05-08 17:37:23 -04:00
John Spurlock
42ae11d4d5 Merge "Settings: Remove zenswitch from DND settings page." into mnc-dev 2015-05-05 14:42:16 +00:00
John Spurlock
4b43b72054 Settings: Calendar event zen rule string updates.
- Remove Attendance option.
 - Use new reply value, tweak wording and summaries.

Bug: 20064962
Change-Id: I6977b494e54752fa87ea08df0ed085129a09a3d3
2015-05-05 10:12:26 -04:00
John Spurlock
beff087b3a Settings: Remove zenswitch from DND settings page.
- Remove the ability to view/modify zen mode/condition from
   the Settings app.

Bug: 20064962
Change-Id: I8757780e5e9ef578e05203577871b9f513997798
2015-05-05 07:32:31 -04:00
John Spurlock
f57bad7d5b Settings: Do not disturb automatic rule updates.
- Remove FAB for adding rules, move to last preference.
 - Add first-class event condition type and config sub-page.
 - Always show radio buttons when adding rules.
 - Add new data model for event rules.
 - Add stub condition provider for event rules (always false for now).
 - Add rule-type icons to rule preference rows.

Bug: 20064962
Change-Id: Id5acde371eb2e7d22b1f195459897614db5ba80a
2015-04-30 11:28:27 -04:00
John Spurlock
4f8d4f0d2b Settings: Ensure zen day-of-week formats use current locale.
Don't share SimpleDateFormat instances per-process, convert to
per-instance to ensure we're always using the current locale.

Updated version of:
  https://android-review.googlesource.com/#/c/147246/

Change-Id: Id464c35035c1de0a7894e5e19b57934f77df9769
2015-04-23 20:32:56 -04:00