Commit Graph

87 Commits

Author SHA1 Message Date
Yuri Lin
21539cd2be Link to app-provided configuration intent for app-owned rules.
If there is no valid intent, the automatic trigger preference is disabled.

Flag: android.app.modes_ui
Bug: 341961712
Test: manual (for Bedtime & Driving modes), ZenModeSetTriggerLinkPreferenceControllerTest

Change-Id: I673792effb3cfdcaaa7cf85adfb55a93b44dcc86
2024-07-01 14:50:35 +00:00
Hani Kazmi
206300962f Replace ECM AppOps call with service
A new ECM service was introcuded in changeId
I831391e4437b51b3312b5273a2360bd029a3d8ee.

We begin calling it, and update/cleanup method signatures to match.

Note: There are two feature flags:

1. enhancedConfirmationModeApisEnabled - read only, protects the
   mainline API.

2. extendEcmToAllSettings - runtime - gates calls to the above APIs.

We use both so we can ramp up in teamfood as needed.

Bug: 297372999
Test: Tested on device
Test: atest SpaPrivilegedLibTests
Test: atest com.android.settings.applications.specialaccess.notificationaccess
Test: atest com.android.settings.datausage
Test: atest PremiumSmsAccessTest
Test: atest RestrictedPreferenceHelperTest
Change-Id: I945ec51df5cd63de548a8ffdd1acc4f09f2301e5
2024-02-21 14:43:02 +00:00
Hani Kazmi
96ab2b9e25 Wired remaining SpecialAppAccess for ECM.
This change enables the remaining settings for ECM, and adds tests for
both this and previous ECM changes.

Bug: 297372999
Test: Tested on device
Test: atest SpaPrivilegedLibTests
Test: atest com.android.settings.applications.specialaccess.notificationaccess
Test: atest com.android.settings.datausage
Test: atest PremiumSmsAccessTest
Test: atest RestrictedPreferenceHelperTest
Change-Id: I73d39d765dba0c1a75111c37b29ccf1c85d2cdd8
2024-02-15 15:15:23 +00:00
Sunny Shao
076ed573eb Revert^2 "Nullability Annotations replacement"
This reverts commit 19d1d3d15d.

Reason for revert: revert it because this is not the root cause.

bug: 316867690
Change-Id: I0f168dbb64044aa720202af7b1040afd4f028c9c
2024-01-10 07:34:01 +00:00
Sunny Shao
19d1d3d15d Revert "Nullability Annotations replacement"
This reverts commit cf0501e4d7.

Reason for revert: b/317462033, it seems a flaky but revert it first.

Change-Id: Ie1d5e279cca6477fc17d8c27c1ecda8d7a6b2553
2023-12-29 02:28:24 +00:00
sunnyshao
cf0501e4d7 Nullability Annotations replacement
-- Replace the android.annotation.Nullable / android.annotation.NonNull
   with androidx.annotation.Nullable / androidx.annotation.NonNull

Bug: 316867690
Test: build pass
Change-Id: I0c1da55dfb09ece855151c47e0492d6f46538621
2023-12-20 08:50:09 +08:00
Chaohui Wang
9e72afdca4 New MobileDataEnabledFlow
To easily collect the mobile data enabled setting changes.

Bug: 308903704
Test: manual - on DataUsageList
Test: unit tests
Change-Id: I31327f59ac32c1a621e2853e64bd30d7d17e079c
2023-11-03 07:19:26 +08:00
Chaohui Wang
4ad7c3c2e6 Finish Mobile Settings if airplane mode is on
Fix: 298940648
Fix: 299256852
Fix: 295408616
Test: manual - on Mobile Settings then turn on airplane mode
Test: unit tests
Change-Id: Ifb4a287f7494ecb8b5040dbae7620fedfc316fdc
2023-11-01 18:05:42 +08:00
Chaohui Wang
15ca95a31b Migrate to TwoStatePreference
SwitchPreference and SwitchPreferenceCompat are both TwoStatePreference.

Using TwoStatePreference in Java will helps migration in the future.

Bug: 306771414
Test: manual - check Settings pages
Change-Id: I84e1d7b09451106797c2b23d127855c6976678ca
2023-10-23 09:28:57 +00:00
Evan Severson
5ba4065703 Make SensorToggleControllers lifecycle aware
We need to watch the lifecycle so that we can unregister callbacks and
not cause leaks.

This change also rewrites the SensorPrivacyManagerHelper. The previous
implmementation was using deprecated apis. It also had an issue where
if a callback was added it would not necessarily register alistener with
the callback with the service since that was only done when the value is
checked. Now we register a listener when the class is instantiated and
with the new API there will only be the 1.

Finally we impove the tests to have more coverage and test both
SensorToggleControllers and the SensorPRivacyManagerHelper class.

Test: Use profiler to verify no more leaks
      SensorToggleControllerTest, SensorPrivacyManagerHelperTest
Bug: 244280065
Change-Id: Ibf0bcee455444a104ca6800302907c3dc0de8f1f
2022-09-28 11:42:01 -07:00
Victor Chang
5aada33242 Merge "Reland "Don't use framework strings for formatting file sizes"" am: ba69fd0d3f am: d5ab7dc729
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2096605

Change-Id: I8b616af8d02a6d984d7dbec2b50087242958dd40
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 11:20:54 +00:00
Roozbeh Pournader
ad389346c8 Reland "Don't use framework strings for formatting file sizes"
Reland http://ag/2529020 because the over-translation issue should be
resolved now.

Modify various formatters to avoid using framework strings for
formatting file sizes.

Also update README instructions for running unit tests.

Bug: 36994779
Bug: 71580745
Bug: 217592956
Test: no new test failures from RunSettingsRoboTests
Test: manual opening the settings page.
Change-Id: Ic4689ab1b76622028004d05e69858228bdc441cf
2022-05-17 16:06:55 +01:00
kholoud mohamed
de78149c16 RESTRICT AUTOMERGE Refactor device policy resource APIs to a separate class
Bug: 217388602
Bug: 218875965
Test: atest EnterpriseResourcesTests
Test: manual
Change-Id: I4775d7741c7819fd811c3fc4eda1636b1e04b398
2022-03-17 17:37:45 +00:00
Jonathan Scott
e0d439472f Allow Device Management Role Holder to update Settings strings.
Test: manual
Bug: 188414370
Change-Id: I6e1a06619799a9e99382d791e72e2e4518f93cac
2022-01-25 19:03:24 +00:00
Evan Severson
7d1835a319 Set toggle state for profile group
The toggle state should be set for all users in the current profile
group; for example a profile user.

Test: make RunSettingsRoboTests ROBOTEST_FILTER=SensorToggleControllerTest
Fixes: 194280328
Change-Id: Ib0b74e7b27722b44b116e614dc960bff72983a38
2021-07-23 16:04:39 +00:00
Pyuli Naithani
c9dfa59d7c Add stats log for sensor privacy.
Test: statsd_testdrive 381

BUG: 192269258

Change-Id: I69e766b789b4b4a6ca0ad26b3a312baca3dbccd2
2021-07-07 05:26:51 +00:00
ryanlwlin
964872ab96 Fix incorrect seperator while concatenating shortcuts
We concatenate the selected shortcut with a comma
that is not localized. To fix it we use listformatter
to concatenate them.

Bug: 186891004
Test: manually test with differnt languages.
Change-Id: I2c6692facd457b434c56a0633e784ce771905b29
2021-05-21 16:32:23 +08:00
Evan Severson
175ca1c4b0 Update the settings privacy page to the latest mocks
Add the mic and camera toggles to the page. Also create an helper class
to keep binder calls to the system_server at a minimum.

Test: make RunSettingsRoboTests
Test: atest SettingsUnitTests
Test: Manual
Bug: 183985427
Change-Id: Iff6ee1c9a2c30095307f636decbcfcf298ed31b0
2021-05-17 22:49:28 +00:00
Janis Danisevskis
48e5f318db Merge "Keystore 2.0: Remove references to Keystore 1.0" am: 7aa99fe966 am: c90b511239 am: a308ea1915
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1624590

Change-Id: I49cad17eab31b7531cb710915cbc57accd894598
2021-03-23 14:10:20 +00:00
Janis Danisevskis
a308ea1915 Merge "Keystore 2.0: Remove references to Keystore 1.0" am: 7aa99fe966 am: c90b511239
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1624590

Change-Id: I590f53d3a4c1b6ad9c4bdb27f04103ccfba7e7af
2021-03-23 04:09:47 +00:00
Janis Danisevskis
75a91836e7 Keystore 2.0: Remove references to Keystore 1.0
Test: N/A
Bug: 171305684
Change-Id: I8b50c024e919d5b98348b792e0769c510ff1a33d
2021-03-22 13:35:53 -07:00
Janis Danisevskis
bb5ebce8a0 Merge "Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0" am: 3c7b085331 am: bae6535b75
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1569702

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4395ebf453fd712d9870580a90c370b42a770d7a
2021-03-05 05:41:50 +00:00
Janis Danisevskis
146a0dab01 Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0
Keystore 2.0 no longer stores vpn profiles. It still offers a
Legacy VPN profile store, to access existing profiles.

Test: N/A
Bug: 171305607
Bug: 171305388
Merged-In: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
Change-Id: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
2021-03-03 22:30:48 -08:00
Janis Danisevskis
e92bcb3287 Keystore 2.0: Update Wifi settings to use mostly public keystore API.
Test: N/A
Bug: 171305607
Bug: 171305388
Merged-In: Ib794c5f2d904c2b187d7d5fd00b81afc852d0052
Change-Id: Ib794c5f2d904c2b187d7d5fd00b81afc852d0052
2021-03-03 22:30:35 -08:00
Janis Danisevskis
b5caf84154 Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0
Keystore 2.0 no longer stores vpn profiles. It still offers a
Legacy VPN profile store, to access existing profiles.

Test: N/A
Bug: 171305607
Bug: 171305388
Change-Id: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
2021-03-02 13:52:46 -08:00
Janis Danisevskis
2c74864579 Keystore 2.0: Update Wifi settings to use mostly public keystore API.
Test: N/A
Bug: 171305607
Bug: 171305388
Merged-In: Ib794c5f2d904c2b187d7d5fd00b81afc852d0052
Change-Id: Ib794c5f2d904c2b187d7d5fd00b81afc852d0052
2021-03-01 20:09:08 -08:00
Janis Danisevskis
e2bfcf88b7 Address nits from ag/13702356
Test: N/A
Bug: 171305607
Bug: 171305388
Change-Id: I044beb29ad84b1b016075997979766035e8be49d
2021-02-26 08:13:12 -08:00
Janis Danisevskis
93af3137fc Keystore 2.0: Update Wifi settings to use mostly public keystore API.
Test: N/A
Bug: 171305607
Bug: 171305388
Merged-In: Ib794c5f2d904c2b187d7d5fd00b81afc852d0052
Change-Id: Ib794c5f2d904c2b187d7d5fd00b81afc852d0052
2021-02-25 17:40:19 -08:00
Edgar Wang
fc02ce1c20 Refactor AppPreference and AppSwitchPreference
- Move AppSwitchPreference
- Remove FeatureflagPreference summary

Bug: 176815722
Test: robotest
Change-Id: Id337097f237ac9ca6dfa01665df61b1258dc24f2
2021-01-05 18:27:08 +00:00
Edgar Wang
8829e515ca 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: Ibe64a68d7bddf84780dfac33555c097ff55c97a8
2020-07-30 12:54:27 +08:00
Bonian Chen
5faf771722 [Settings] Learn more link should be removed when not supported.
Learn more wording with link only help people when configured.
When no link available, these wording had better removed to avoid from
confusing people.

Bug: 159510116
Test: manual
Change-Id: I36b74b2b4586546090fb88562e8f4f052a877709
2020-06-23 21:19:15 +08:00
Rajeev Kumar
67c149bfe7 Settigns app changes to enable Notification listeners on Android Go.
Bug: 148575561
Test: make RunSettingsRoboTests -j40 and manual tests
Change-Id: I1832529edd55d9ba2053ccc0ff7e2bc93f4a00b5
2020-02-18 15:22:47 -08:00
Tsung-Mao Fang
605218c57b Show underline when text show a link
Hyperlinked text should have underline instead of using color only,
such that color blind users are able to compare to the surrounding text.

Change-Id: I7e93f76ebd40077710385e8670176e878b021ef8
Fix: 148839397
Test: visual see link in "Skip songs", "Silence interruptions", "Reach to check phone".
2020-02-06 16:36:59 +08:00
Edgar Wang
0f8c7a71d0 Handle Aware sensor status for Always On
- "Always On" preference will be hiden when aware
sensor is available
- Extract NavModeCandidateInfo from SystemNavigationGestureSettings

Bug: 136610131
Test: robotest & manual
Change-Id: If58c70549339b66116f19df7193d85bb04e3f1b7
2019-09-21 07:19:35 +08:00
Felipe Leme
fcf98251f2 Updated privacy settings to launch custom content capture settings when available.
Test: manual verification
Test: atest EnableContentCapturePreferenceControllerTest \
      CtsContentTestCases:android.content.cts.AvailableIntentsTest#testRequestEnableContentCaptureIntent
Test: adb shell am start-activity -a android.settings.REQUEST_ENABLE_CONTENT_CAPTURE

Fixes: 119264902

Change-Id: I2a030c31d966d40feb6ba449e4bbc9ef8cf0565b
2019-03-22 08:10:48 -07: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
Pasty Chang
c1f8600d9f Change to use setupcompat and setupdesign for suw pages
1. remove the dependence of setupwizardlib.
2. add to use setupcompat and setupdesign.
3. modify new footer button in following up cl.

Bug: 120805516
Bug: 120872944
Test: RunSettingsRoboTests
Change-Id: I463dd35b799d4250b2aabce0cb0b8102cf9dd7d6
2018-12-12 03:16:29 +00:00
Cn Chen
f63eee9f0a Revert "migrate new setupcompat and setupdesign to SetupChooseLockGeneric"
This reverts commit 0725bea86e.

Reason for revert: Settings crash
Bug: 120754151
Change-Id: I52f258f7f12d21b8dd16220ba11e50768d0802ee
2018-12-10 07:32:52 +00:00
cnchen
0725bea86e migrate new setupcompat and setupdesign to SetupChooseLockGeneric
Test: cd tests/robotests && mma
Bug: 117080118
Change-Id: I6a29ef5294040d353ee1a0f2bf9ce69de7de9094
2018-12-06 06:19:04 +00:00
Beverly
6543b077cb Null check for ManagedServiceSetting dialog title
Test: manual
Change-Id: If3753b01431ab9690cdbae5a0d7f0edf9c80fcec
Fixes: 114803288
2018-09-11 10:06:13 -04:00
Julia Reynolds
e4fe56e161 Fix settings crash on noti listener screen
Test: manual
Bug: 114417814
Change-Id: I053a62201d3e9a1066d16d4a494a0c13bebccaf7
2018-09-07 15:23:12 -04: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
Beverly
3cfa49e851 Use title in ManagedServiceSetting dialogs
- Use the title (not summary) of the preference in its warning dialogs

Test: manual
Bug: 112687996
Change-Id: Ia217e5252cf7a48450da853c0270093ffb57dca7
2018-08-21 12:46:00 -04:00
Fan Zhang
9a1928ea36 Move profile selector dialog to Settings
Bug: 77600770
Test: robotest
Change-Id: I601dabfd925a1990b7bd9115ef579bff9039a7c0
2018-08-02 13:35:08 -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
Fan Zhang
2ff710a911 Move logic from SavedAccessPoint fragment to controller
Change-Id: Ic54e536f97490cec1746fa58c42ec55b60d17f0e
Fixes: 64806699
Test: robotests
2018-07-19 14:49:14 -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
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
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00