feat: SettingsLib验证通过-使用App module启用
This commit is contained in:
27
CarSettings/tests/unit/res/drawable/test_icon.xml
Normal file
27
CarSettings/tests/unit/res/drawable/test_icon.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2020 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#ffffff"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||
</vector>
|
||||
BIN
CarSettings/tests/unit/res/drawable/test_icon_2.png
Normal file
BIN
CarSettings/tests/unit/res/drawable/test_icon_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 361 B |
34
CarSettings/tests/unit/res/values/arrays.xml
Normal file
34
CarSettings/tests/unit/res/values/arrays.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string-array name="entries" translatable="false">
|
||||
<item>Choose me!</item>
|
||||
<item>No, me!</item>
|
||||
<item>What about me?!</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="entry_values" translatable="false">
|
||||
<item>alpha</item>
|
||||
<item>beta</item>
|
||||
<item>charlie</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="settings_qc_provider_package_allowlist">
|
||||
<item>com.android.car.settings.test.unit</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
27
CarSettings/tests/unit/res/values/config.xml
Normal file
27
CarSettings/tests/unit/res/values/config.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<!--
|
||||
~ Copyright (C) 2021 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Whether exit button in settings' root action bar should be shown or not -->
|
||||
<bool name="config_show_settings_root_exit_icon">true</bool>
|
||||
<!-- Whether the root fragment should actually be root -->
|
||||
<bool name="config_is_root_fragment_root">true</bool>
|
||||
<!--
|
||||
Maximum number of devices to show for paired bluetooth device quick control.
|
||||
Set to -1 for unlimited.
|
||||
-->
|
||||
<integer name="config_qc_bluetooth_device_limit">3</integer>
|
||||
</resources>
|
||||
21
CarSettings/tests/unit/res/values/internal_resources.xml
Normal file
21
CarSettings/tests/unit/res/values/internal_resources.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<bool name="config_automatic_brightness_available">true</bool>
|
||||
<integer name="config_networkAvoidBadWifi">0</integer>
|
||||
</resources>
|
||||
23
CarSettings/tests/unit/res/values/preference_keys.xml
Normal file
23
CarSettings/tests/unit/res/values/preference_keys.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- Namespaced with "tpk" (Test Preference Key) to avoid conflicts. -->
|
||||
<resources>
|
||||
<!-- SettingsFragmentTest -->
|
||||
<string name="tpk_fake_controller" translatable="false">fake_controller</string>
|
||||
<string name="tpk_edit_text_preference" translatable="false">edit_text_preference</string>
|
||||
<string name="tpk_list_preference" translatable="false">list_preference</string>
|
||||
|
||||
</resources>
|
||||
34
CarSettings/tests/unit/res/values/strings.xml
Normal file
34
CarSettings/tests/unit/res/values/strings.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="account_type1_label" translatable="false">Type 1</string>
|
||||
<string name="account_type2_label" translatable="false">Type 2</string>
|
||||
<string name="account_type3_label" translatable="false">Type 3</string>
|
||||
|
||||
<string name="test_positive_button_label" translatable="false">Positive Button</string>
|
||||
<string name="test_negative_button_label" translatable="false">Negative Button</string>
|
||||
<string name="test_neutral_button_label" translatable="false">Neutral Button</string>
|
||||
|
||||
<string name="fancy_device_admin_label" translatable="false">LordOfTheSevenReceiverKingdoms</string>
|
||||
<string name="fancy_device_admin_description" translatable="false">One Receiver to Rule them All</string>
|
||||
|
||||
<string name="test_volume_call" translatable="false">Call Volume</string>
|
||||
<string name="test_volume_music" translatable="false">Music Volume</string>
|
||||
<string name="test_volume_navigation" translatable="false">Navigation Volume</string>
|
||||
|
||||
<string name="bt_profile_name" translatable="false">Profile Name</string>
|
||||
</resources>
|
||||
16
CarSettings/tests/unit/res/xml/empty_device_admin.xml
Normal file
16
CarSettings/tests/unit/res/xml/empty_device_admin.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<device-admin xmlns:android="http://schemas.android.com/apk/res/android"/>
|
||||
19
CarSettings/tests/unit/res/xml/empty_preference_screen.xml
Normal file
19
CarSettings/tests/unit/res/xml/empty_preference_screen.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<!--
|
||||
~ Copyright (C) 2021 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="empty_preference_screen_title"/>
|
||||
27
CarSettings/tests/unit/res/xml/fancy_device_admin.xml
Normal file
27
CarSettings/tests/unit/res/xml/fancy_device_admin.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-policies>
|
||||
<!-- Arbitrary number of policies -->
|
||||
<expire-password/>
|
||||
<encrypted-storage/>
|
||||
<force-lock/>
|
||||
<limit-password/>
|
||||
<reset-password/>
|
||||
<watch-login/>
|
||||
<wipe-data/>
|
||||
</uses-policies>
|
||||
</device-admin>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="screen_title">
|
||||
<Preference
|
||||
android:key="@string/tpk_fake_controller"
|
||||
settings:controller="com.android.car.settings.common.FakePreferenceController"/>
|
||||
<EditTextPreference
|
||||
android:key="@string/tpk_edit_text_preference"/>
|
||||
<ListPreference
|
||||
android:title="@string/tpk_list_preference"
|
||||
android:dialogTitle="@string/tpk_list_preference"
|
||||
android:entries="@array/entries"
|
||||
android:entryValues="@array/entry_values"
|
||||
android:key="@string/tpk_list_preference"/>
|
||||
</PreferenceScreen>
|
||||
37
CarSettings/tests/unit/res/xml/test_car_volume_items.xml
Normal file
37
CarSettings/tests/unit/res/xml/test_car_volume_items.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2018 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!--
|
||||
We use a separate test file due to the difficulty accessing android internal resources in tests.
|
||||
-->
|
||||
<carVolumeItems xmlns:car="http://schemas.android.com/apk/res-auto">
|
||||
<item car:usage="voice_communication"
|
||||
car:titleText="@string/test_volume_call"
|
||||
car:icon="@drawable/test_icon"
|
||||
car:mute_icon="@drawable/test_icon" />
|
||||
<item car:usage="voice_communication_signalling"
|
||||
car:titleText="@string/test_volume_call"
|
||||
car:icon="@drawable/test_icon"
|
||||
car:mute_icon="@drawable/test_icon" />
|
||||
<item car:usage="media"
|
||||
car:titleText="@string/test_volume_music"
|
||||
car:icon="@drawable/test_icon"
|
||||
car:mute_icon="@drawable/test_icon" />
|
||||
<item car:usage="assistance_navigation_guidance"
|
||||
car:titleText="@string/test_volume_navigation"
|
||||
car:icon="@drawable/test_icon"
|
||||
car:mute_icon="@drawable/test_icon" />
|
||||
</carVolumeItems>
|
||||
29
CarSettings/tests/unit/res/xml/test_preference_screen.xml
Normal file
29
CarSettings/tests/unit/res/xml/test_preference_screen.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<!--
|
||||
~ Copyright (C) 2021 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="test_screen_title">
|
||||
<Preference
|
||||
android:fragment="com.android.car.settings.testutils.TestSettingsFragment1"
|
||||
android:key="pk_test_preference_1"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
<Preference
|
||||
android:fragment="com.android.car.settings.testutils.TestSettingsFragment2"
|
||||
android:key="pk_test_preference_2"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,29 @@
|
||||
<!--
|
||||
~ Copyright (C) 2021 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:title="test_top_level_menu_screen_title">
|
||||
<Preference
|
||||
android:fragment="com.android.car.settings.testutils.TestSettingsFragment1"
|
||||
android:key="pk_test_fragment_1"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
<Preference
|
||||
android:fragment="com.android.car.settings.testutils.TestSettingsFragment2"
|
||||
android:key="pk_test_fragment_2"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
Reference in New Issue
Block a user