Commit Graph

25 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
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
Irina Dumitrescu
127fa65575 Disable notification settings access from work apps.
Fixes: 79241388
Test: the following command does not open the notification settings in
work profile user:
$ adb shell am start --user $USER -W -a android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS
Moreover, triggering the notifications from a sample app results in the
new toast being displayed.

Change-Id: I0a330a9cf22c813aea7600557660868263817e1e
2018-07-18 14:37:18 +01:00
Fan Zhang
176ccd0c35 Clean up: fix incorrect @VisibleForTesting imports
Test: rebuild and robotests
Change-Id: I33d7ee1c0622c01f592920baaf01d44ad19d9a13
2018-07-13 13:08:53 -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
Fan Zhang
af1552251f Add some pages to search index.
* Notification access page
* VR Listener page
* Feature flags in dev options
* QS Tile developer options
* User dictionary
* Billing cycle
* Some accessibilty pages

Bug: 70720645
Test: robotests
Change-Id: I4f7d3d65b2803cebf178ac345a79721232df707c
2018-07-11 16:39:29 -07: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
Doris Ling
03a3b518de Update preference screen title.
- Add missing title to preference screen xml so that they will be used to
set the activity title when the fragment is launched.
- Also updated some incorrect preference screen titles.
- Overrides getTitle() in preference fragments that do not use the
preference screen xml.

Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Id72d5ddf18f0962bc484de8bbd847a2e55d6371e
2017-10-25 11:02:07 -07:00
Julia Reynolds
559bd3651e Disable managed services special access screens...
... on low ram devices.

- Remove them from the 'Special app access' screen
- Display an error message if an app intents directly to
them

Bug: 35219985
Test: visual, and runtest --path ManagedAccessSettingsLowRamTest.java,
when the device is in low ram mode and when it's not.
Change-Id: Ied919cb248ae56683a00e3492c4737dfd00449ac
2017-06-23 15:44:43 -04:00
Julia Reynolds
ee4b6ba6ae Migrate from setting to NotificationManager.
Test: manual; changing settings and confirming with bugreport
Change-Id: I1595fc3ceca8cd31d5bece52dff75aebe29d2ae3
2017-06-14 11:34:47 -04:00
Fyodor Kupolov
2328946b58 Tron metrics for special permissions
Added tron metrics for the following special permissions:
Battery optimisation
 - APP_SPECIAL_PERMISSION_BATTERY_ALLOW
 - APP_SPECIAL_PERMISSION_BATTERY_DENY
Device administrators
 - APP_SPECIAL_PERMISSION_ADMIN_ALLOW (when checked)
 - APP_SPECIAL_PERMISSION_ADMIN_DENY (when unchecked)
Do not disturb access
 - APP_SPECIAL_PERMISSION_DND_ALLOW
 - APP_SPECIAL_PERMISSION_DND_DENY
Daw over other apps
 - APP_SPECIAL_PERMISSION_APPDRAW_ALLOW
 - APP_SPECIAL_PERMISSION_APPDRAW_DENY
VR helper services
 - APP_SPECIAL_PERMISSION_VRHELPER_ALLOW
 - APP_SPECIAL_PERMISSION_VRHELPER_DENY
Modify system settings
 - APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_ALLOW
 - APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_DENY
Notification access
 - APP_SPECIAL_PERMISSION_NOTIVIEW_ALLOW
 - APP_SPECIAL_PERMISSION_NOTIVIEW_DENY
Premium SMS access
 - APP_SPECIAL_PERMISSION_PREMIUM_SMS_ALWAYS_ALLOW
 - APP_SPECIAL_PERMISSION_PREMIUM_SMS_ASK
 - APP_SPECIAL_PERMISSION_PREMIUM_SMS_DENY
Unrestricted data access
 - APP_SPECIAL_PERMISSION_UNL_DATA_ALLOW
 - APP_SPECIAL_PERMISSION_UNL_DATA_DENY
Usage access
 - APP_SPECIAL_PERMISSION_USAGE_VIEW_ALLOW
 - APP_SPECIAL_PERMISSION_USAGE_VIEW_DENY

Test: Manual + make RunSettingsRoboTests
Bug: 31008660
Change-Id: Id977e2c9f5aa811a2b0af036372b72c684621435
2017-01-18 10:54:19 -08: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
Julia Reynolds
6e99b3ee4e Fix settings crash when disabling listener.
Bug: 32092445
Test: manual
Change-Id: Iaa26e755381ba202cccf6d518dacb86eae4c6d10
2016-10-11 17:22:44 -04:00
Fan Zhang
1e516287bd Add visibility metrics to dialogs.
Bug: 30681529
Test: adb logcat -b events | egrep "(sysui_|notification_)"
Change-Id: I199d2e1b2cb8588a562b46bb8128d8ece24952f0
2016-09-19 17:34:12 -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
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
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
John Spurlock
b8099f542c Settings: Migrate notification access screens to switch prefs.
Bug: 20916418
Change-Id: I729bc3a6f853f15780f12e7d7c9f337447e399c4
2015-05-11 11:47:21 -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
c9afadb04b Add condition provider access to settings.
Pull NotificationAccessSettings out into a reusable base class
and reuse all of it for a new condition providers settings page.

As with notification listeners, the entire section is hidden if
no apps provide conditions.

Change-Id: Ib5273f3362e392d99647347c23a514e4590f7ac9
2014-04-29 20:21:08 -04:00
John Spurlock
4a35051565 App-level notification configuration settings page.
New sub-page off of notification settings to ban/unban
apps and navigate to an app's notification configuration
activity (if configured).

Centralized all notification settings artifacts under a new
settings subpackage.

Bug: 13935172
Change-Id: I53b75c02f0091900734d17dc9217035d0df9b466
2014-04-21 12:19:14 -04:00