Commit Graph

34 Commits

Author SHA1 Message Date
Jacky Wang
e4761149f3 Add cancel button to Erase all data (factory reset)
Bug: 300634367
Test: unit test & manual test
Change-Id: I860955291b27ea1f7c748ac746b91153224eacb7
2023-11-10 13:32:00 +08:00
Krzysztof Kosiński
c81fbcef2e Clean up obsolete aliases for Truth.
Bug: 255714762
Test: presubmit
Change-Id: I8aab463c74d5e869d949a2b712886a9cc4d15709
2023-10-11 19:39:33 +00:00
Gil Cukierman
761fd612c4 Stop honoring CarrierConfigManager.KEY_HIDE_ENABLE_2G
KEY_HIDE_ENABLE_2G is soft removed in Android API level 35
because it hides a security feature. This patch
introduces simplified logic that ignores the
carrier config value. The new behavior is behind a feature flag.

This patch also includes some cleanup.
1. It removes an unneeded check for null carrier config
2. It removes test logic that set the value of KEY_HIDE_ENABLE_2G
   in places where it had no impact on the test.

Bug: 300248708
Test: atest Enable2gPreferenceControllerTest
Change-Id: I892d115d1ae173d2f3cd69e8f8b97bc5bfa7c67b
2023-10-04 13:59:55 +00:00
Eghosa Ewansiha-Vlachavas
2c50be71c5 Fix testGetUserMinAspectRatioEntry for both tablets and foldables am: 136bd906da am: 933b2431fb
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24879571

Change-Id: I1a08e894582e04583bb2f1e26945cae85f1b4fc4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 21:51:22 +00:00
Eghosa Ewansiha-Vlachavas
933b2431fb Fix testGetUserMinAspectRatioEntry for both tablets and foldables am: 136bd906da
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24879571

Change-Id: If37a415cc6f53f1f9df7731129dd9fa42341c4d4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-29 20:45:20 +00:00
Eghosa Ewansiha-Vlachavas
136bd906da Fix testGetUserMinAspectRatioEntry for both tablets and foldables
Tabelts and foldables now have different aspect ratio values in their
config, so we need to test the devices separately as we shouldnt test for
values that are not in the config of the device the test is run on.

Fixes: 302155585
Test: atest SettingsUnitTests:UserAspectRatioManagerTest
Change-Id: I78fa3020501a4be992bb90fea16a6fec4f37594b
2023-09-28 13:23:11 +00:00
Joshua McCloskey
1ec202576d Moved FakeFingerprintManagerInteractor
Test: atest
Bug: 295206367
Change-Id: If9f3b9dc88260c0725f70d3444c4f9a4b6ee5c2f
2023-09-22 16:55:25 +00:00
Sudheer Shanka
abbb5c4dc3 Add controls in dev options to quarantine apps.
Bug: 297934650
Test: m -j RunSettingsRoboTests
Test: atest SettingsUnitTests
Change-Id: Ic0f35b370c04dd4ed3baaf3610b46ff1b37a0463
2023-09-18 07:27:37 +00:00
Manish Singh
8cef63acc1 Merge "Remove temp workaround for feature flag" into main 2023-09-15 10:13:01 +00:00
Chaohui Wang
e4f5ac6b24 Clean up SettingsUnitTests unused dependencies
Bug: 290856342
Test: atest SettingsUnitTests
Change-Id: Ifcec968b3dfca965c8cd5b897bbdf84dfe220fd5
2023-09-14 15:59:59 +08:00
Manish Singh
5aef6b6264 Remove temp workaround for feature flag
Using the trunk stable feature flagging now.

Bug: 295516544
Test: m
Test: manual adb
Test: atest SafetySourceBroadcastReceiverTest
Test: atest PrivateSpaceSafetySourceTest
Change-Id: I3d2d8c11dfb224ad2b09572493633366b4c4805c
2023-09-13 08:49:56 +01:00
Chaohui Wang
81d99646e9 Set use_resource_processor for Settings tests
Bug: 293810334
Test: unit test
Test: robo test
Change-Id: Ibc1756f4f1f943ee6aa8ebb4dda930684d93ae07
2023-09-08 12:13:35 +08:00
Joshua McCloskey
d084f6a61f Fixed formatting
Test: N/A
Change-Id: If450b64f8709b65f1e5d0c7cb2e177d8ca1a89aa
2023-08-29 18:39:40 +00:00
Joshua Mccloskey
eb7692e052 Merge "Implement basic Fingerprint functionality." into udc-qpr-dev am: 1412f391d5 am: 22b67802f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23480676

Change-Id: I981accee2b7f0f3742c98d1b352d3076d421dede
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-18 17:28:29 +00:00
Joshua Mccloskey
22b67802f5 Merge "Implement basic Fingerprint functionality." into udc-qpr-dev am: 1412f391d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23480676

Change-Id: If0de6ed25832d88a049f82ad86485fb4b1d027e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-18 16:45:52 +00:00
Joshua McCloskey
5a4211ec82 Implement basic Fingerprint functionality.
Test: Verified enroll/deletion/renaming/authentication flows.
Test: atest FingerprintSettingsViewModelTest
Test: atest FingerprintManagerInteractorTest
Bug: 280862076
Change-Id: Ic34fd89f01f24468d0f769ef0492e742d9330112
2023-07-11 20:46:43 +00:00
Joshua McCloskey
b7f0d7a8ff Moving FingerprintSettings to Kotlin
This change is the first of many, it will

1. Change java -> kotlin
2. Use the MVVM architecture
3. Be feature flagged

This change in particular is focused on transitions to and from various activities.

Enable feature via
adb shell setprop sys.fflag.override.settings_biometrics2_fingerprint true

Bug: 280862076
Test: atest FingerprintSettingsViewModelTest
Change-Id: I8eb5c30e6f2e92c256ae7c257a9d560439ba418f
Merged-In: I8eb5c30e6f2e92c256ae7c257a9d560439ba418f
2023-07-11 17:43:07 +00:00
Joshua McCloskey
9642d1e8cb Moving FingerprintSettings to Kotlin
This change is the first of many, it will

1. Change java -> kotlin
2. Use the MVVM architecture
3. Be feature flagged

This change in particular is focused on transitions to and from various activities.

Enable feature via
adb shell setprop sys.fflag.override.settings_biometrics2_fingerprint true

Bug: 280862076
Test: atest FingerprintSettingsViewModelTest
Change-Id: I8eb5c30e6f2e92c256ae7c257a9d560439ba418f
2023-06-28 18:09:35 +00:00
Joshua McCloskey
2f46489926 Moving FingerprintSettings to Kotlin
This change is the first of many, it will

1. Change java -> kotlin
2. Use the MVVM architecture
3. Be feature flagged

This change in particular is focused on transitions to and from various activities.

Enable feature via
adb shell setprop sys.fflag.override.settings_biometrics2_fingerprint true

Bug: 280862076
Test: atest FingerprintSettingsViewModelTest
Change-Id: I8eb5c30e6f2e92c256ae7c257a9d560439ba418f
Merged-In: I8eb5c30e6f2e92c256ae7c257a9d560439ba418f
2023-06-28 15:49:02 +00:00
Milton Wu
aadecbaf34 [BiometricsV2] Refactor model code to kotlin
Bug: 286196884
Test: atest FingerprintEnrollmentActivityTest CredentialModelTest
      EnrollmentRequestTest FingerprintEnrollIntroViewModelTest
      FingerprintEnrollmentViewModelTest
Test: atest biometrics-enrollment-test
Change-Id: I2bdae4d2dd052d3664a790cd982edf51fcebec09
2023-06-13 10:29:16 +00:00
Fangqiu Su
6b6044bedb Merge "Update uiautomator references in packages/apps/Settings/tests/unit" am: 233c708436 am: a176782c18 am: 5ed8e6bc0e
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2558510

Change-Id: Ic9bd09f06a4cf29e220b9516846ead6b0e2e634e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 01:55:20 +00:00
Fangqiu Su
828f2fcec9 Update uiautomator references in packages/apps/Settings/tests/unit
* Remove unused dependencies.
* Replace "ub-uiautomator" (v2.2.0) with
  "androidx.test.uiautomator_uiautomator" (v2.3.0).

Bug: 235842600
Test: mmma .
Change-Id: I55c2d77b0bcd3b673de5a0b42170414de5fc3baf
2023-04-24 18:07:07 +00:00
Michael Groover
38819fd906 Make CheckReturnValue errorprone check a warning for unit tests
CredentialManagerPreferenceControllerTest now differs between the
current development branch and internal main, and the
CheckReturnValue errorprone is failing in the branches that use
the code from the development branch. Modifying
CredentialManagerPreferenceControllerTest does not resolve this
because it results in merge conflicts, but making this check a
warning in the development branch will allow the fix to reach all
affected branches.

Fixes: 273833063
Test: m RUN_ERROR_PRONE=true SettingsUnitTests
Change-Id: Ia923f0d988b1428cbb7378f33b4703ed19113dcd
2023-03-16 11:31:05 -05:00
Hai Zhang
6bf47f6274 Don't add SettingsLib to static_libs in Settings unit test.
Adding them results in duplicate classes and causes conflict for the R
classes and resource loading.

Meanwhile, correctly removing the SettingsLibSettingsSpinner resulted
in the test failing to find the getSelectedItem() method which is
unused inside Settings app. This is an inherent issue when unit
testing an optimized (and shrunk) app, and since there's no other way
for the test to get the current selected item, this change simply
changes the Settings code to invoke getSelectedItem() as well. This
has exactly the same effect because SettingsSpinnerPreference updates
its mPosition right before calling the OnItemSelectedListener in its
implementation.

Bug: 183340630
Bug: 177638625
Bug: 183342958
Test: atest SettingsSliderPreferenceControllerTest
Test: atest PrivateVolumeForgetTest
Change-Id: Ia26ca923369b41291614fb9bd50dfbd2aac2f0fa
2021-05-11 03:33:08 -07:00
Arc Wang
e22d1493af Fix resource problem in PrivateVolumeForgetTest
Somehow Resource IDs are inconsistent between SettingsLib and
SettingsUnitTests. Import SettingsLibMainSwitchPreference to fix.

Bug: 183342958
Test: atest com.android.settings.deviceinfo.PrivateVolumeForgetTest
Change-Id: Id8dfccd520577fc1a8e5177e20e99b52bb57a66a
2021-03-25 06:31:57 +00:00
Arc Wang
2383c6c806 Fix resource problem in SettingsSliderPreferenceControllerTest
Somehow Resource IDs are inconsistent between Settings and
SettingsUnitTests. Import SettingsLibTwoTargetPreference to fix.

Bug: 183340630
Test: atest SettingsSliderPreferenceControllerTest
Change-Id: Icc404d8ebefe1399806775272a37c56845406bc7
2021-03-24 16:39:05 +08:00
Arc Wang
d496a737ce Revamp Storage Settings header part
1. Add new object StorageEntry to encapsulate VolumeInfo and
   unsupported DiskInfo and missing VolumeRecord.
2. Replaces StorageSummaryDonutPreference with UsageProgressBarPreference.
3. Add storage select spinner.
4. Add a "Free up storage" preference to replace "Manage storage" button.

Bug: 174964885
Test: atest com.android.settings.deviceinfo.storage
      atest com.android.settings.deviceinfo
      manual
      Insert an USB drive, select the drive in StorageDashboardFragment
      and observe UI.
Change-Id: I83877f76869414de4fb2788b6b18fe507aa5cfcf
Merged-In: I83877f76869414de4fb2788b6b18fe507aa5cfcf
2021-03-19 18:08:38 +08:00
Bob Badour
a73a67240c [LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Settings
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  protos/Android.bp
  tests/anomaly-tester/Android.bp
  tests/componenttests/Android.bp
  tests/legacy_unit/InstrumentedEntitlementApp/Android.bp
  tests/perftests/Android.bp
  tests/robotests/Android.bp
  tests/uitests/Android.bp
  tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I58a85aced69923fa9a8e5a2b89ecfdd33de5e05c
2021-02-25 15:05:14 -08:00
Bob Badour
18e9723489 Revert "[LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Settings"
This reverts commit 0e73d05c74.

Change-Id: I627be6c5355eda9602b1cb201806fce4548fc951
2021-02-25 11:52:32 -08:00
Bob Badour
0e73d05c74 [LSC] Add LOCAL_LICENSE_KINDS to packages/apps/Settings
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  protos/Android.bp
  tests/anomaly-tester/Android.bp
  tests/perftests/Android.bp
  tests/robotests/Android.bp
  tests/uitests/Android.bp
  tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: I81f11a66b5977cb5096e262819084706af5fa54c
Merged-in: I81f11a66b5977cb5096e262819084706af5fa54c
2021-02-21 08:50:16 -08:00
Jeremy Goldman
ae03dd39da DataUsageSummaryPreferenceTest converted to JUnit
There are couple of newly explored concepts in this CL, which will
hopefully be useful for migrating other tests in the future as well. In
broad strokes, the changes to this file cover:

Android build file species the preferences library, in order to access
PreferenceViewHolder.createInstanceForTests.
Resource ids in JUnit tests differ from the Settings apk. This is true
not only of strings but also views and layouts. Helper functions added
to main class to access the layouts needed by the test.
Shadow activities are not needed to view layouts, the context can be
used.
Context startActivity can be mocked and verified in order to capture and
examine the intent created by the library under test.

Bug: 175389659
Test: atest -c DataUsageSummaryPreferenceTest
Change-Id: Ib8cb87f0299c47a32c3f5d3af7edb20592b727ec
2020-12-21 12:39:02 +08:00
changbetty
c3aa6d26ee [Testing] Remove Robolectric import and use AndroidJUnit4 instead in MobileDataEnabledListenerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context

Bug: 162048313
Test: atest -c MobileDataEnabledListenerTest
Change-Id: I81b3d6ac075666a45649c8d811832a40bdb1b41b
2020-08-05 22:53:29 +08:00
paulhu
2efe482d95 Forward the ResultReceiver to Tethering Entitlement app
Bug: 156336264
Test: atest TetherProvisioningActivityTest
Change-Id: I37fcaddd5569223146ff9d6316d97f33312d8d24
2020-05-21 02:33:15 +00:00
Colin Cross
946a0fd964 Convert Settings to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Test: m RunSettingsRoboTests-jacoco
Change-Id: I267534c095c30833f77273dbdb1893b7830ed45d
2019-05-13 13:42:01 -07:00