Commit Graph

19 Commits

Author SHA1 Message Date
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
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
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
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
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
472526e53f Don't save a rule without a name.
Bug: 28282339
Change-Id: Ie0a66f980c920354d172be4f0b91584338efce69
2016-04-20 16:08:30 -04:00
Julia Reynolds
1d33d59be2 Api review: AutomaticZenRule
Bug: 27364144
Change-Id: Ic0ea5d4958711cf5216e87ad8054460ad4246856
2016-02-26 18:38:50 -05: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
John Spurlock
7b4d1e2cb8 Settings: Add zen rule name warning text.
Bug: 21307309
Change-Id: Id08e3bdebb9a87dc474f2551f17268d655c8b4ea
2015-06-04 11:37:36 -04:00
John Spurlock
c5bab237f5 Settings: Enable "ok" dialog button for no-op changes to existing zen rules.
Bug: 21307309
Change-Id: Ic7a9cc124e26340e93a08da45c9f1a0043beee76
2015-06-04 10:44:45 -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
33bf636e72 Settings: Use new EventInfo.ANY_CALENDAR constant.
Bug: 20064962
Change-Id: I08a8c5feb61bfd440fc6a297d97de4abba5b19b3
2015-05-08 17:37:23 -04: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
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
c96a5dcbfc Settings: External automatic rule settings.
- Add external automatic rule settings page with the common
   settings for all rules (enabled, name, zen mode).
 - Pull common rule-instance settings into settings base class, share
   with existing schedule rule settings.
 - New page not searchable since it is at the rule-instance level.
 - Obtain external rule information from existing conditions provider
   metadata.  Includes rule type caption, sub-configuration activity,
   and default condition id.
 - If external condition providers exist with the appropriate metadata,
   display the external rule types as options in the new rule dialog.
   (max of 3 external types)
 - Pull common managed service listing code out of common settings base
   class and into a more reusable helper class.

Bug: 20064962
Change-Id: Ibc13607490b7312a7d9f7f3bd61c3cfcf71a2794
2015-04-13 12:19:55 -04:00
John Spurlock
45fa140b8c Settings: An update on Downtime.
- Migrate settings to the new zen mode state model.
 - Remove downtime settings.
 - Add automatic rule management page (add/remove)
 - Bind new automatic schedule rules to detail editor.
 - Clean up a few found miscapitalized string captions.
 - Migrate zen switch to report the shared summary string.

Bug: 20064962
Change-Id: Ia561e7f77c90c962729240b4d51ba1915297f64a
2015-04-09 20:56:16 -04:00