DO NOT MERGE: Add setAllowDismissButton to AlertDialogBuilder

By default, the AlertDialogBuilder may add a "Dismiss" button if a
positive/negative/neutral button is not provided. This is so that
the dialog is still dismissible using the rotary controller. If
however, there are buttons that can close the dialog via
setAdapter(CarUiListItemAdapter) or a similar method, then it may
be desirable to suppress the addition of the dismiss button, which
this method allows for.

Test: Manually
Bug: 171067302
Change-Id: If84b6c2dee449931852400d594a555d835b3e23f
diff --git a/car-ui-lib/car-ui-lib/src/androidTest/java/com/android/car/ui/AlertDialogBuilderTest.java b/car-ui-lib/car-ui-lib/src/androidTest/java/com/android/car/ui/AlertDialogBuilderTest.java
new file mode 100644
index 0000000..0aaa250
--- /dev/null
+++ b/car-ui-lib/car-ui-lib/src/androidTest/java/com/android/car/ui/AlertDialogBuilderTest.java
@@ -0,0 +1,256 @@
+/*
+ * 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.
+ */
+
+package com.android.car.ui;
+
+import static androidx.test.espresso.Espresso.onView;
+import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
+import static androidx.test.espresso.assertion.ViewAssertions.matches;
+import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
+import static androidx.test.espresso.matcher.ViewMatchers.withText;
+
+import android.app.AlertDialog;
+import android.database.Cursor;
+import android.view.View;
+
+import androidx.test.espresso.Root;
+import androidx.test.rule.ActivityTestRule;
+
+import com.android.car.ui.recyclerview.CarUiContentListItem;
+import com.android.car.ui.recyclerview.CarUiListItemAdapter;
+import com.android.car.ui.recyclerview.CarUiRadioButtonListItem;
+import com.android.car.ui.recyclerview.CarUiRadioButtonListItemAdapter;
+import com.android.car.ui.test.R;
+
+import org.hamcrest.Description;
+import org.hamcrest.TypeSafeMatcher;
+import org.junit.Rule;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class AlertDialogBuilderTest {
+
+    @Rule
+    public ActivityTestRule<TestActivity> mActivityRule =
+            new ActivityTestRule<>(TestActivity.class);
+
+    @Test
+    public void test_AlertDialogBuilder_works() throws Throwable {
+        String title = "Test message from AlertDialogBuilder";
+        String subtitle = "Subtitle from AlertDialogBuilder";
+        mActivityRule.runOnUiThread(() ->
+                new AlertDialogBuilder(mActivityRule.getActivity())
+                        .setMessage(title)
+                        .setSubtitle(subtitle)
+                        .show());
+
+        AlertDialog dialog = checkDefaultButtonExists(true,
+                new AlertDialogBuilder(mActivityRule.getActivity())
+                        .setMessage(title)
+                        .setSubtitle(subtitle));
+        onView(withText(title))
+                .inRoot(new RootWithDecorMatcher(dialog.getWindow().getDecorView()))
+                .check(matches(isDisplayed()));
+        onView(withText(subtitle))
+                .inRoot(new RootWithDecorMatcher(dialog.getWindow().getDecorView()))
+                .check(matches(isDisplayed()));
+    }
+
+    @Test
+    public void test_showSingleListChoiceItem_StringArray_hidesDefaultButton() throws Throwable {
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setSingleChoiceItems(new CharSequence[]{"Item 1", "Item 2"}, 0,
+                        ((dialog, which) -> {
+                        }));
+
+        checkDefaultButtonExists(false, builder);
+    }
+
+    @Test
+    public void test_showSingleListChoiceItem_StringArrayResource_hidesDefaultButton()
+            throws Throwable {
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setSingleChoiceItems(R.array.test_string_array, 0, ((dialog, which) -> {
+                }));
+
+        checkDefaultButtonExists(false, builder);
+    }
+
+    @Test
+    public void test_showSingleListChoiceItem_CarUiRadioButtonListItemAdapter_forcesDefaultButton()
+            throws Throwable {
+        CarUiRadioButtonListItem item1 = new CarUiRadioButtonListItem();
+        item1.setTitle("Item 1");
+        CarUiRadioButtonListItem item2 = new CarUiRadioButtonListItem();
+        item2.setTitle("Item 2");
+        CarUiRadioButtonListItem item3 = new CarUiRadioButtonListItem();
+        item3.setTitle("Item 3");
+
+        CarUiRadioButtonListItemAdapter adapter = new CarUiRadioButtonListItemAdapter(
+                Arrays.asList(item1, item2, item3));
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setSingleChoiceItems(adapter);
+
+        checkDefaultButtonExists(true, builder);
+    }
+
+    @Test
+    public void test_showSingleListChoiceItem_cursor_hidesDefaultButton() throws Throwable {
+        Cursor cursor = new FakeCursor(Arrays.asList("Item 1", "Item 2"), "ColumnName");
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setTitle("Title")
+                .setAllowDismissButton(false)
+                .setSingleChoiceItems(cursor, 0, "ColumnName", ((dialog, which) -> {
+                }));
+
+        checkDefaultButtonExists(false, builder);
+    }
+
+    @Test
+    public void test_setItems_StringArrayResource_hidesDefaultButton() throws Throwable {
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setItems(R.array.test_string_array, ((dialog, which) -> {
+                }));
+
+        checkDefaultButtonExists(false, builder);
+    }
+
+    @Test
+    public void test_setItems_StringArray_hidesDefaultButton() throws Throwable {
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setItems(new CharSequence[]{"Item 1", "Item 2"}, ((dialog, which) -> {
+                }));
+
+        checkDefaultButtonExists(false, builder);
+    }
+
+    @Test
+    public void test_setAdapter_hidesDefaultButton()
+            throws Throwable {
+        CarUiContentListItem item1 = new CarUiContentListItem(CarUiContentListItem.Action.NONE);
+        item1.setTitle("Item 1");
+        CarUiContentListItem item2 = new CarUiContentListItem(CarUiContentListItem.Action.NONE);
+        item2.setTitle("Item 2");
+        CarUiContentListItem item3 = new CarUiContentListItem(CarUiContentListItem.Action.NONE);
+        item3.setTitle("Item 3");
+
+        CarUiListItemAdapter adapter = new CarUiListItemAdapter(
+                Arrays.asList(item1, item2, item3));
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setAdapter(adapter);
+
+        checkDefaultButtonExists(false, builder);
+    }
+
+    @Test
+    public void test_multichoiceItems_StringArrayResource_forcesDefaultButton()
+            throws Throwable {
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setMultiChoiceItems(R.array.test_string_array, null,
+                        ((dialog, which, isChecked) -> {
+                        }));
+
+        checkDefaultButtonExists(true, builder);
+    }
+
+    @Test
+    public void test_multichoiceItems_StringArray_forcesDefaultButton()
+            throws Throwable {
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setMultiChoiceItems(new CharSequence[]{"Test 1", "Test 2"}, null,
+                        ((dialog, which, isChecked) -> {
+                        }));
+
+        checkDefaultButtonExists(true, builder);
+    }
+
+    @Test
+    public void test_multichoiceItems_Cursor_forcesDefaultButton()
+            throws Throwable {
+        Cursor cursor = new FakeCursor(Arrays.asList("Item 1", "Item 2"), "Label");
+        AlertDialogBuilder builder = new AlertDialogBuilder(mActivityRule.getActivity())
+                .setAllowDismissButton(false)
+                .setMultiChoiceItems(cursor, "isChecked", "Label",
+                        ((dialog, which, isChecked) -> {
+                        }));
+
+        checkDefaultButtonExists(true, builder);
+    }
+
+    private AlertDialog checkDefaultButtonExists(boolean shouldExist, AlertDialogBuilder builder)
+            throws Throwable {
+        AtomicBoolean done = new AtomicBoolean(false);
+        AlertDialog[] result = new AlertDialog[1];
+        mActivityRule.runOnUiThread(() -> {
+            try {
+                result[0] = builder.create();
+                result[0].show();
+            } catch (RuntimeException e) {
+                assert e.getMessage() != null;
+                assert e.getMessage().contains(
+                        "must have at least one button to disable the dismiss button");
+
+                assert shouldExist;
+                done.set(true);
+            }
+        });
+
+        if (done.get()) {
+            return result[0];
+        }
+
+        if (shouldExist) {
+            onView(withText(R.string.car_ui_alert_dialog_default_button))
+                    .inRoot(new RootWithDecorMatcher(result[0].getWindow().getDecorView()))
+                    .check(matches(isDisplayed()));
+        } else {
+            onView(withText(R.string.car_ui_alert_dialog_default_button))
+                    .inRoot(new RootWithDecorMatcher(result[0].getWindow().getDecorView()))
+                    .check(doesNotExist());
+        }
+
+        return result[0];
+    }
+
+    private static class RootWithDecorMatcher extends TypeSafeMatcher<Root> {
+
+        private View mView;
+
+        RootWithDecorMatcher(View view) {
+            mView = view;
+        }
+
+        @Override
+        public void describeTo(Description description) {
+            description.appendText("is a root with a certain decor");
+        }
+
+        @Override
+        protected boolean matchesSafely(Root item) {
+            return item.getDecorView() == mView;
+        }
+    }
+}
diff --git a/car-ui-lib/car-ui-lib/src/androidTest/java/com/android/car/ui/FakeCursor.java b/car-ui-lib/car-ui-lib/src/androidTest/java/com/android/car/ui/FakeCursor.java
new file mode 100644
index 0000000..d6bc4e1
--- /dev/null
+++ b/car-ui-lib/car-ui-lib/src/androidTest/java/com/android/car/ui/FakeCursor.java
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+package com.android.car.ui;
+
+import android.database.AbstractCursor;
+
+import java.util.List;
+
+public class FakeCursor extends AbstractCursor {
+
+    private List<String> mRows;
+    private String mColumnName;
+
+    public FakeCursor(List<String> rows, String columnName) {
+        mRows = rows;
+        mColumnName = columnName;
+    }
+
+    @Override
+    public int getCount() {
+        return mRows.size();
+    }
+
+    @Override
+    public String[] getColumnNames() {
+        return new String[] { mColumnName };
+    }
+
+    @Override
+    public String getString(int column) {
+        return mRows.get(getPosition());
+    }
+
+    @Override
+    public short getShort(int column) {
+        return 0;
+    }
+
+    @Override
+    public int getInt(int column) {
+        return 0;
+    }
+
+    @Override
+    public long getLong(int column) {
+        return 0;
+    }
+
+    @Override
+    public float getFloat(int column) {
+        return 0;
+    }
+
+    @Override
+    public double getDouble(int column) {
+        return 0;
+    }
+
+    @Override
+    public boolean isNull(int column) {
+        return mRows.get(getPosition()) == null;
+    }
+}
diff --git a/car-ui-lib/car-ui-lib/src/androidTest/res/values/strings.xml b/car-ui-lib/car-ui-lib/src/androidTest/res/values/strings.xml
index 21f4ee4..7926d9c 100644
--- a/car-ui-lib/car-ui-lib/src/androidTest/res/values/strings.xml
+++ b/car-ui-lib/car-ui-lib/src/androidTest/res/values/strings.xml
@@ -31,4 +31,10 @@
     <string name="title_dropdown_preference">Dropdown preference</string>
     <string name="title_twoaction_preference">TwoAction preference</string>
     <string name="summary_twoaction_preference">A widget should be visible on the right</string>
+
+    <string-array name="test_string_array">
+        <item>Item 1</item>
+        <item>Item 2</item>
+        <item>Item 3</item>
+    </string-array>
 </resources>
diff --git a/car-ui-lib/car-ui-lib/src/main/java/com/android/car/ui/AlertDialogBuilder.java b/car-ui-lib/car-ui-lib/src/main/java/com/android/car/ui/AlertDialogBuilder.java
index 6be0ade..803bb29 100644
--- a/car-ui-lib/car-ui-lib/src/main/java/com/android/car/ui/AlertDialogBuilder.java
+++ b/car-ui-lib/car-ui-lib/src/main/java/com/android/car/ui/AlertDialogBuilder.java
@@ -60,6 +60,8 @@
     private CharSequence mSubtitle;
     private Drawable mIcon;
     private boolean mIconTinted;
+    private boolean mAllowDismissButton = true;
+    private boolean mHasSingleChoiceBodyButton = false;
 
     public AlertDialogBuilder(Context context) {
         // Resource id specified as 0 uses the parent contexts resolved value for alertDialogTheme.
@@ -329,6 +331,7 @@
     public AlertDialogBuilder setItems(@ArrayRes int itemsId,
             final DialogInterface.OnClickListener listener) {
         mBuilder.setItems(itemsId, listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -341,6 +344,7 @@
     public AlertDialogBuilder setItems(CharSequence[] items,
             final DialogInterface.OnClickListener listener) {
         mBuilder.setItems(items, listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -353,6 +357,7 @@
     public AlertDialogBuilder setAdapter(final ListAdapter adapter,
             final DialogInterface.OnClickListener listener) {
         mBuilder.setAdapter(adapter, listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -363,6 +368,7 @@
      */
     public AlertDialogBuilder setAdapter(final CarUiListItemAdapter adapter) {
         setCustomList(adapter);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -390,6 +396,7 @@
             final DialogInterface.OnClickListener listener,
             String labelColumn) {
         mBuilder.setCursor(cursor, listener, labelColumn);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -413,6 +420,7 @@
     public AlertDialogBuilder setMultiChoiceItems(@ArrayRes int itemsId, boolean[] checkedItems,
             final DialogInterface.OnMultiChoiceClickListener listener) {
         mBuilder.setMultiChoiceItems(itemsId, checkedItems, listener);
+        mHasSingleChoiceBodyButton = false;
         return this;
     }
 
@@ -435,6 +443,7 @@
     public AlertDialogBuilder setMultiChoiceItems(CharSequence[] items, boolean[] checkedItems,
             final DialogInterface.OnMultiChoiceClickListener listener) {
         mBuilder.setMultiChoiceItems(items, checkedItems, listener);
+        mHasSingleChoiceBodyButton = false;
         return this;
     }
 
@@ -460,6 +469,7 @@
             String labelColumn,
             final DialogInterface.OnMultiChoiceClickListener listener) {
         mBuilder.setMultiChoiceItems(cursor, isCheckedColumn, labelColumn, listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -480,6 +490,7 @@
     public AlertDialogBuilder setSingleChoiceItems(@ArrayRes int itemsId, int checkedItem,
             final DialogInterface.OnClickListener listener) {
         mBuilder.setSingleChoiceItems(itemsId, checkedItem, listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -502,6 +513,7 @@
             String labelColumn,
             final DialogInterface.OnClickListener listener) {
         mBuilder.setSingleChoiceItems(cursor, checkedItem, labelColumn, listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -521,6 +533,7 @@
     public AlertDialogBuilder setSingleChoiceItems(CharSequence[] items, int checkedItem,
             final DialogInterface.OnClickListener listener) {
         mBuilder.setSingleChoiceItems(items, checkedItem, listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -534,6 +547,7 @@
     public AlertDialogBuilder setSingleChoiceItems(ListAdapter adapter, int checkedItem,
             final DialogInterface.OnClickListener listener) {
         mBuilder.setSingleChoiceItems(adapter, checkedItem, listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -555,6 +569,7 @@
     public AlertDialogBuilder setSingleChoiceItems(CarUiRadioButtonListItemAdapter adapter,
             final DialogInterface.OnClickListener listener) {
         setCustomList(adapter);
+        mHasSingleChoiceBodyButton = false;
         return this;
     }
 
@@ -570,6 +585,7 @@
      */
     public AlertDialogBuilder setSingleChoiceItems(CarUiRadioButtonListItemAdapter adapter) {
         setCustomList(adapter);
+        mHasSingleChoiceBodyButton = false;
         return this;
     }
 
@@ -583,6 +599,7 @@
     public AlertDialogBuilder setOnItemSelectedListener(
             final AdapterView.OnItemSelectedListener listener) {
         mBuilder.setOnItemSelectedListener(listener);
+        mHasSingleChoiceBodyButton = true;
         return this;
     }
 
@@ -635,6 +652,22 @@
         return setEditBox(prompt, textChangedListener, inputFilters, 0);
     }
 
+    /**
+     * By default, the AlertDialogBuilder may add a "Dismiss" button if you don't provide
+     * a positive/negative/neutral button. This is so that the dialog is still dismissible
+     * using the rotary controller. If however, you add buttons that can close the dialog via
+     * {@link #setAdapter(CarUiListItemAdapter)} or a similar method, then you may wish to
+     * suppress the addition of the dismiss button, which this method allows for.
+     *
+     * @param allowDismissButton If true, a "Dismiss" button may be added to the dialog.
+     *                           If false, it will never be added.
+     * @return this Builder object to allow for chaining of calls to set methods
+     */
+    public AlertDialogBuilder setAllowDismissButton(boolean allowDismissButton) {
+        mAllowDismissButton = allowDismissButton;
+        return this;
+    }
+
 
     /** Final steps common to both {@link #create()} and {@link #show()} */
     private void prepareDialog() {
@@ -659,8 +692,14 @@
         }
         mBuilder.setCustomTitle(customTitle);
 
-        if (mContext.getResources().getBoolean(R.bool.car_ui_alert_dialog_force_dismiss_button)
+        if (!mAllowDismissButton && !mHasSingleChoiceBodyButton
                 && !mNeutralButtonSet && !mNegativeButtonSet && !mPositiveButtonSet) {
+            throw new RuntimeException(
+                    "The dialog must have at least one button to disable the dismiss button");
+        }
+        if (mContext.getResources().getBoolean(R.bool.car_ui_alert_dialog_force_dismiss_button)
+                && !mNeutralButtonSet && !mNegativeButtonSet && !mPositiveButtonSet
+                && mAllowDismissButton) {
             String mDefaultButtonText = mContext.getString(
                     R.string.car_ui_alert_dialog_default_button);
             mBuilder.setNegativeButton(mDefaultButtonText, (dialog, which) -> {
diff --git a/car-ui-lib/paintbooth/src/main/java/com/android/car/ui/paintbooth/dialogs/DialogsActivity.java b/car-ui-lib/paintbooth/src/main/java/com/android/car/ui/paintbooth/dialogs/DialogsActivity.java
index 7cf1cce..fd70730 100644
--- a/car-ui-lib/paintbooth/src/main/java/com/android/car/ui/paintbooth/dialogs/DialogsActivity.java
+++ b/car-ui-lib/paintbooth/src/main/java/com/android/car/ui/paintbooth/dialogs/DialogsActivity.java
@@ -18,6 +18,7 @@
 
 import android.Manifest;
 import android.app.Activity;
+import android.app.AlertDialog;
 import android.content.pm.PackageManager;
 import android.os.Bundle;
 import android.util.Pair;
@@ -35,6 +36,8 @@
 import com.android.car.ui.baselayout.InsetsChangedListener;
 import com.android.car.ui.core.CarUi;
 import com.android.car.ui.paintbooth.R;
+import com.android.car.ui.recyclerview.CarUiContentListItem;
+import com.android.car.ui.recyclerview.CarUiListItemAdapter;
 import com.android.car.ui.recyclerview.CarUiRadioButtonListItem;
 import com.android.car.ui.recyclerview.CarUiRadioButtonListItemAdapter;
 import com.android.car.ui.recyclerview.CarUiRecyclerView;
@@ -83,6 +86,8 @@
                 v -> showDialogWithLongSubtitleAndIcon()));
         mButtons.add(Pair.create(R.string.dialog_show_single_choice,
                 v -> showDialogWithSingleChoiceItems()));
+        mButtons.add(Pair.create(R.string.dialog_show_list_items_without_default_button,
+                v -> showDialogWithListItemsWithoutDefaultButton()));
         mButtons.add(Pair.create(R.string.dialog_show_permission_dialog,
                 v -> showPermissionDialog()));
         mButtons.add(Pair.create(R.string.dialog_show_multi_permission_dialog,
@@ -199,6 +204,35 @@
                 .show();
     }
 
+
+    private void showDialogWithListItemsWithoutDefaultButton() {
+        ArrayList<CarUiContentListItem> data = new ArrayList<>();
+        AlertDialog[] dialog = new AlertDialog[1];
+
+        CarUiContentListItem item = new CarUiContentListItem(CarUiContentListItem.Action.NONE);
+        item.setTitle("First item");
+        item.setOnItemClickedListener(i -> dialog[0].dismiss());
+        data.add(item);
+
+
+        item = new CarUiContentListItem(CarUiContentListItem.Action.NONE);
+        item.setTitle("Second item");
+        item.setOnItemClickedListener(i -> dialog[0].dismiss());
+        data.add(item);
+
+        item = new CarUiContentListItem(CarUiContentListItem.Action.NONE);
+        item.setTitle("Third item");
+        item.setOnItemClickedListener(i -> dialog[0].dismiss());
+        data.add(item);
+
+        dialog[0] = new AlertDialogBuilder(this)
+                .setTitle("Select one option.")
+                .setSubtitle("Ony one option may be selected at a time")
+                .setAdapter(new CarUiListItemAdapter(data))
+                .setAllowDismissButton(false)
+                .show();
+    }
+
     private void showDialogWithSubtitleAndIcon() {
         new AlertDialogBuilder(this)
                 .setTitle("My Title!")
diff --git a/car-ui-lib/paintbooth/src/main/res/values/strings.xml b/car-ui-lib/paintbooth/src/main/res/values/strings.xml
index f347784..04f1413 100644
--- a/car-ui-lib/paintbooth/src/main/res/values/strings.xml
+++ b/car-ui-lib/paintbooth/src/main/res/values/strings.xml
@@ -270,6 +270,9 @@
   <!-- Text to show Dialog with single choice items-->
   <string name="dialog_show_single_choice">Show with single choice items</string>
 
+  <!-- Text to show a dialog with single choice items and no default button [CHAR_LIMIT=200] -->
+  <string name="dialog_show_list_items_without_default_button">Show with single choice items and no default button</string>
+
   <!-- Text to show a permission Dialog [CHAR_LIMIT=50] -->
   <string name="dialog_show_permission_dialog">Show permission dialog</string>
 
diff --git a/car-ui-lib/referencedesign/res/values/values.xml b/car-ui-lib/referencedesign/res/values/values.xml
index 4d34c7b..0cbb8ee 100644
--- a/car-ui-lib/referencedesign/res/values/values.xml
+++ b/car-ui-lib/referencedesign/res/values/values.xml
@@ -12,6 +12,4 @@
 
     <dimen name="car_ui_toolbar_logo_size">44dp</dimen>
     <dimen name="car_ui_toolbar_nav_icon_size">44dp</dimen>
-
-    <bool name="car_ui_alert_dialog_force_dismiss_button">false</bool>
 </resources>
diff --git a/car-ui-lib/referencedesign/res/xml/overlays.xml b/car-ui-lib/referencedesign/res/xml/overlays.xml
index 61e5fb4..cc9b092 100644
--- a/car-ui-lib/referencedesign/res/xml/overlays.xml
+++ b/car-ui-lib/referencedesign/res/xml/overlays.xml
@@ -49,7 +49,6 @@
     <item target="bool/car_ui_toolbar_logo_fills_nav_icon_space" value="@bool/car_ui_toolbar_logo_fills_nav_icon_space" />
     <item target="bool/car_ui_toolbar_tab_flexible_layout" value="@bool/car_ui_toolbar_tab_flexible_layout" />
     <item target="bool/car_ui_toolbar_tabs_on_second_row" value="@bool/car_ui_toolbar_tabs_on_second_row" />
-    <item target="bool/car_ui_alert_dialog_force_dismiss_button" value="@bool/car_ui_alert_dialog_force_dismiss_button" />
 
     <item target="id/car_ui_toolbar_background" value="@id/car_ui_toolbar_background" />
     <item target="id/car_ui_toolbar_nav_icon_container" value="@id/car_ui_toolbar_nav_icon_container" />