Commit Graph

35 Commits

Author SHA1 Message Date
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
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -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
Fan Zhang
4560ab7a35 Add a few pages to search index.
- Data saver
- A few special permission access pages
   - Picture-in-picture
   - Premium sms
   - do not disturb access
- And a unrelated cleanup: move EmptyTextFragment from
  notification/ to widget/

Bug: 70720645
Test: robotests
Change-Id: I6a87f712bf81f9fd32fa9a3826fba851ca748409
2018-07-10 17:02:09 -07:00
Yanting_Yang
db435e256d Migrate UnrestrictedDataAccess to DashboardFragment
- UnrestrictedDataAccessPreferenceController

Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.datausage
      make RunSettingsRoboTests -j ROBOTEST_FILTER=CodeInspectionTest
      atest UniquePreferenceTest

Change-Id: I71abd837ef51e4e9e0a2ee46791d704245c9b3ab
2018-05-14 21:18:38 -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
Julia Reynolds
bf3e2243ef Allow extras to be passed to app info subscreens
And pass though some extras through to notification settings.

This enables us to highlight appropriate preferences on the
subscreens while still funneling users through the app info
screen.

Test: make RunSettingsRoboTests
Bug: 72764587
Change-Id: I0197b595fe4bf3504588d9dd2985dd20de73c640
2018-02-15 15:33:23 -05:00
Doris Ling
ce55d7c6a1 Remove app info page v1 related codes.
- change to use AppInfoDashboardFragment completely
- remove InstalledAppDetails and the corresponding tests

Change-Id: I8cbdf71cadc8b5743929abbafe91185e5e39b6b2
Fixes: 69384089
Test: make RunSettingsRoboTests
2018-01-29 17:14:32 -08:00
Sudheer Shanka
b8b2e51e8d Add policy transparency for metered data related settings.
With API Dpm.setMeteredDataDisabled, admins can restrict some
packages from accessing metered data and when admin does restrict
packages, user settings to enable usage of mobile data in background or
allow unrestricted access during data saver mode are not relevant. Add
policy transparency to these settings so that user knows that admin
disabled them.

Bug: 63700027
Test: make RunSettingsRoboTests
Test: manual
Change-Id: I450f7a91356ed8fb33f464620c73fa9407a1ff83
2018-01-26 10:57:11 -08:00
Doris Ling
a0006d93bd Move AppInfoDashboardFragment into appinfo package.
- update all references to AppInfoDashboardFragment
- removed PackageUtil inner class and change the corresponding function
to be a simple method.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: Ief067e25a303ef16db20b2ca1d8840cb06eff5f9
2017-12-12 16:58:17 -08:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
Doris Ling
529e207986 Create version 2 of InstalledAppDetails
- this is the first step for converting InstalledAppDetails into
DashboardFragment
- add a feature flag to determine whether to show the new installed app
detail page.
- decouple the fragment from AppInfoBase: extends from
SettingsPreferenceFragment directly and copy all codes from
AppInfoBase.

Bug: 69384089
Test: make RunSettingsRoboTests
Change-Id: If1ab5b216620eaba1d6bde20e65e7a602931fd94
2017-11-17 15:37:34 -08:00
Doris Ling
4a01283309 Remove the feature flag for using new title.
- remove all code that check for the feature flag, and use the new logic
by default.

Change-Id: I7fbe60da84c1c0f35e7241402a71d2bc4cd300e6
Fixes: 64564191
Test: make RunSettingsRoboTests
2017-11-13 17:58:13 -08:00
Doris Ling
024668a2c5 Remove duplicate preferences in Accessibility settings.
- addPreferencesFromResource() call has been added to
InstrumentedPreferenceFragment, and hence sub-class should not call it
again.

Change-Id: Ia016d9d407ac3f838c962d1ced585647382a051a
Fixes: 68820835
Test: make RunSettingsRoboTests
2017-11-02 18:12:27 -07:00
Fan Zhang
1c3a4de93d Switch to use small icon for most app related pages
- Renamed AppProgressPreference to AppPreference to handle most app
  related prefs
- Add ed AppSwitchPreference - the same layout as AppPreference except
  it's a SwitchPreference
- Use above 2 prefs in most app related pages.
  - Everything under special access pages
  - Recent app list in App & notifications
  - App data usage detail page
  - Default app picker pages

Bug: 65182905
Test: robotests
Change-Id: I96c980ba1db49e36dabe25b5eade1197215aad11
2017-10-30 12:20:49 -07: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
Tony Mantler
76cbd4b3b2 Make ApplicationsState.Session lifecycle-aware
Bug: 66682989
Test: RunSettingsRoboTests
Change-Id: Idf56788fcae22639b7bf604a8c73cd5f0ff2da16
2017-09-22 11:23:17 -07: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
Fan Zhang
13566f29a5 Fix crash when changing data restriction for non-app UID.
Change-Id: Ie622e8e22bade33050865fe4135534b27995d523
Fixes: 31708057
Test: make RunSettingsRoboTests
2016-09-23 15:14:18 -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
Felipe Leme
f8265a8f1e Merge "Defined help page for Data Saver." into nyc-dev 2016-05-20 21:27:57 +00:00
Jason Monk
fd41b42487 Protect against monkey crash
When rebuild comes in after context is no longer valid

Change-Id: Ib64e93372bff4c6b0e1232ac257f3df0e9d0be0a
Fixes: 28875397
2016-05-20 14:15:10 -04:00
Felipe Leme
cf2c0b1b97 Defined help page for Data Saver.
BUG: 28865521
Change-Id: I07930232312df2775ecee5beacee6921f7245847
2016-05-20 09:08:28 -07:00
Felipe Leme
85c63f348f Listen to INetworkPolicyManager events and update UI accordingly.
BUG: 27481520

Change-Id: I09c4c586188d754ddd3ac3dcb3903217842ea0a5
2016-04-20 09:17:14 -07:00
Felipe Leme
11b06ca8bf Fixed AccessPreference listener.
When an app is blacklisted, its switch toggle is disabled, but previous
the onClick() method was still being called, which would launch the data
usage screen but also call setIsWhitelist().

BUG: 27481520
Change-Id: Id8df3d65eee286d1aecb4ae2a0417d6932d91441
2016-04-19 10:05:08 -07:00
Felipe Leme
c2ef27faf4 Handle blacklisted apps on Data Saver whitelist.
When user blacklists an app for background data access, the
"Unrestricted data access" list should not display the whitelist toggle
option, but rather explain background access is turned off and offer the
option to open the app's data usage screen to turn it back on.

It still does not handle changed received by DataSaverBackend, so the UI
will be stale when the user removes a blacklist and navigates back to
the list.

BUG: 27481520

Change-Id: I9d0fa9f0180a69ce9bd1417921bf89ec3ba31f01
2016-04-18 13:14:01 -07:00
Felipe Leme
0628e33bf2 Add metrics for Data Saver actions.
BUG: 28166693
Change-Id: Ie435db66183ef645467ffa6cc7537d54d35cab31
2016-04-14 16:14:55 -07:00
Jason Monk
9a6349a4d5 Guard against empty extraInfo
Change-Id: Iff297637edd3ebf5b6d26bc1dc51e9c17393e24f
Fixes: 27999693
2016-04-12 16:03:39 -04:00
Jason Monk
f38fb38f26 Switch to whitelist for animations
Disable animations for all SettingsPreferenceFragments, unless they
explicitly ask for them before creating their preference screens.

Turn it on for all fragments using the cached removal currently.

Bug: 27713314
Change-Id: I1bc14e7aeb3ee5b8ddb4f3547f472305cd312edf
2016-03-18 15:16:12 -04:00
Jason Monk
3e19fc5600 Move temporary metrics constants to proto
Change-Id: I8fb3ac22df7bdc52039dd640f7696ebd32281f0b
2016-03-08 14:18:30 -05:00
Jason Monk
a8b0366a02 Data saver fixes
- Correct summary for number of apps with unrestricted
 - Show system option on unrestricted access page
 - general betterness

Bug: 26796370
Bug: 27378294
Bug: 27122309
Change-Id: Ia57b56a25175182cb1a5a1231c20dc3c71cc3427
2016-03-01 10:44:16 -05:00
Jason Monk
764f45db91 Add data saver to settings
Bug: 22817899

Change-Id: Ic3055aa6a5baae1653db350313366f180c049cc7
2016-01-25 15:24:29 -05:00