feat: SettingsLib验证通过-使用App module启用
This commit is contained in:
BIN
CarSettings/tests/robotests/res/drawable/test_icon.png
Normal file
BIN
CarSettings/tests/robotests/res/drawable/test_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 361 B |
30
CarSettings/tests/robotests/res/values/arrays.xml
Normal file
30
CarSettings/tests/robotests/res/values/arrays.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019 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>
|
||||
</resources>
|
||||
25
CarSettings/tests/robotests/res/values/config.xml
Normal file
25
CarSettings/tests/robotests/res/values/config.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019 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>
|
||||
<!-- explicitly set to unset string for testing purpose -->
|
||||
<string name="config_defaultAssistantComponentName" translatable="false">#+UNSET</string>
|
||||
<!-- Whether exit button in settings' root action bar should be shown or not -->
|
||||
<bool name="config_show_settings_root_exit_icon">true</bool>
|
||||
|
||||
<string name="config_default_screen_reader" translatable="false">com.android.screen.reader/.ScreenReaderService</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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>
|
||||
|
||||
<!-- Progress bar preference resources -->
|
||||
<color name="config_progress_background_tint">@android:color/white</color>
|
||||
<color name="white_disabled_material">@android:color/white</color>
|
||||
</resources>
|
||||
24
CarSettings/tests/robotests/res/values/preference_keys.xml
Normal file
24
CarSettings/tests/robotests/res/values/preference_keys.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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.
|
||||
-->
|
||||
<!-- 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>
|
||||
|
||||
<string name="tpk_two_action_preference" translatable="false">two_action_preference</string>
|
||||
</resources>
|
||||
36
CarSettings/tests/robotests/res/values/strings.xml
Normal file
36
CarSettings/tests/robotests/res/values/strings.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="test_volume_call" translatable="false">Call Volume</string>
|
||||
<string name="test_volume_music" translatable="false">Music Volume</string>
|
||||
|
||||
<!-- AccountListPreferenceControllerTest, AddAccountPreferenceControllerTest, and AccountSettingsFragmentTest -->
|
||||
<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="bt_rename_dialog_title" translatable="false">Rename Title</string>
|
||||
<string name="bt_profile_name" translatable="false">Profile Name</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="fake_title" translatable="false">fake_title</string>
|
||||
<string name="fake_summary" translatable="false">fake_summary</string>
|
||||
<string name="fake_category" translatable="false">fake_category</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
<Preference
|
||||
android:key="key"
|
||||
settings:controller="com.android.car.settings.common.NonExistentPreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
<Preference
|
||||
android:key="key1"
|
||||
settings:occupant_driver="write"
|
||||
settings:occupant_front_passenger="read"
|
||||
settings:occupant_rear_passenger="hidden"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
<Preference
|
||||
android:key="key2"
|
||||
settings:occupant_driver="hide"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
@@ -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.
|
||||
-->
|
||||
|
||||
<PreferenceScreen xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
<Preference
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
<Preference
|
||||
android:key="key1"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
<Preference
|
||||
android:key="key2"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
<!-- Preferences without controllers should be skipped by the list helper. -->
|
||||
<Preference
|
||||
android:key="key3"/>
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto">
|
||||
<Preference
|
||||
android:key="key1"
|
||||
settings:occupant_driver="write"
|
||||
settings:occupant_front_passenger="read"
|
||||
settings:occupant_rear_passenger="hidden"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
<Preference
|
||||
android:key="key2"
|
||||
settings:occupant_driver="hidden"
|
||||
settings:occupant_front_passenger="write"
|
||||
settings:occupant_rear_passenger="read"
|
||||
settings:controller="com.android.car.settings.common.DefaultRestrictionsPreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:key="fake_title_key"
|
||||
android:title="screen_title"
|
||||
settings:controller="com.android.car.settings.common.FakePreferenceController">
|
||||
<Preference
|
||||
android:key="key1"
|
||||
settings:occupant_driver="write"
|
||||
settings:occupant_front_passenger="read"
|
||||
settings:occupant_rear_passenger="hidden"
|
||||
settings:controller="com.android.car.settings.common.FakePreferenceController"/>
|
||||
<PreferenceCategory
|
||||
android:key="key2"
|
||||
settings:controller="com.android.car.settings.common.FakePreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
32
CarSettings/tests/robotests/res/xml/preference_parser.xml
Normal file
32
CarSettings/tests/robotests/res/xml/preference_parser.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||
android:key="fake_title_key"
|
||||
android:title="screen_title"
|
||||
settings:controller="com.android.car.settings.common.FakePreferenceController">
|
||||
<Preference
|
||||
android:key="key1"
|
||||
settings:controller="com.android.car.settings.common.FakePreferenceController"/>
|
||||
<PreferenceCategory
|
||||
android:key="key2"
|
||||
settings:controller="com.android.car.settings.common.FakePreferenceController"/>
|
||||
<com.android.car.settings.common.LogicalPreferenceGroup
|
||||
android:key="key3"
|
||||
settings:controller="com.android.car.settings.common.FakePreferenceController"/>
|
||||
</PreferenceScreen>
|
||||
33
CarSettings/tests/robotests/res/xml/settings_fragment.xml
Normal file
33
CarSettings/tests/robotests/res/xml/settings_fragment.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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"/>
|
||||
<item car:usage="voice_communication_signalling"
|
||||
car:titleText="@string/test_volume_call"
|
||||
car:icon="@drawable/test_icon"/>
|
||||
<item car:usage="media"
|
||||
car:titleText="@string/test_volume_music"
|
||||
car:icon="@drawable/test_icon"/>
|
||||
</carVolumeItems>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<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"/>
|
||||
</PreferenceScreen>
|
||||
Reference in New Issue
Block a user