Update escalation cards layout and data binding.

Bug: 29397123

- Updated the UI for support escalation cards so different state have
  the same height and text/button shows up at roughly same place.
- Split data model for escalation cards from SupportData. The data and
  UI between escalation cards and support tiles are different enough
  that it no longer makes sense to share the same data object.

Change-Id: I328cc33961b9638e5e5fc2cad3ebf443991f4d0c
diff --git a/res/layout/support_escalation_options.xml b/res/layout/support_escalation_options.xml
index 6b88908..b214561 100644
--- a/res/layout/support_escalation_options.xml
+++ b/res/layout/support_escalation_options.xml
@@ -17,51 +17,71 @@
 
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    style="@style/SupportEscalationCard"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@color/card_background_grey"
-    android:gravity="center_horizontal"
-    android:paddingBottom="40dp">
-    <LinearLayout
-        android:layout_width="wrap_content"
+    android:orientation="vertical">
+    <TextView
+        android:id="@+id/tile_title"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginEnd="8dp"
         android:gravity="center_horizontal"
-        android:orientation="vertical">
-        <Button
-            android:id="@android:id/text1"
-            style="@style/SupportPrimaryButton"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_margin="8dp"/>
-        <TextView
-            android:id="@+id/summary1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="14dp"
-            android:textAppearance="@style/TextAppearance.Small"
-            android:textColor="?android:attr/textColorSecondary"/>
-    </LinearLayout>
-    <LinearLayout
-        android:layout_width="wrap_content"
+        android:textAppearance="@style/TextAppearance.SupportTitle"/>
+    <TextView
+        android:id="@+id/tile_summary"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="8dp"
-        android:layout_marginEnd="8dp"
         android:gravity="center_horizontal"
-        android:orientation="vertical">
-        <Button
-            android:id="@android:id/text2"
-            style="@style/SupportPrimaryButton"
+        android:paddingTop="8dp"
+        android:paddingBottom="30dp"
+        android:textAppearance="@style/TextAppearance.Small"
+        android:textColor="?android:attr/textColorSecondary"/>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:orientation="horizontal">
+        <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_margin="8dp"/>
-        <TextView
-            android:id="@+id/summary2"
+            android:layout_marginStart="8dp"
+            android:layout_marginEnd="8dp"
+            android:gravity="center_horizontal"
+            android:orientation="vertical">
+            <Button
+                android:id="@android:id/text1"
+                style="@style/SupportPrimaryButton"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="8dp"/>
+            <TextView
+                android:id="@+id/summary1"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="14dp"
+                android:textAppearance="@style/TextAppearance.Small"
+                android:textColor="?android:attr/textColorSecondary"/>
+        </LinearLayout>
+        <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="14dp"
-            android:textAppearance="@style/TextAppearance.Small"
-            android:textColor="?android:attr/textColorSecondary"/>
+            android:layout_marginStart="8dp"
+            android:layout_marginEnd="8dp"
+            android:gravity="center_horizontal"
+            android:orientation="vertical">
+            <Button
+                android:id="@android:id/text2"
+                style="@style/SupportPrimaryButton"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_margin="8dp"/>
+            <TextView
+                android:id="@+id/summary2"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="14dp"
+                android:textAppearance="@style/TextAppearance.Small"
+                android:textColor="?android:attr/textColorSecondary"/>
+        </LinearLayout>
     </LinearLayout>
 </LinearLayout>
diff --git a/res/layout/support_item_title.xml b/res/layout/support_item_title.xml
deleted file mode 100644
index 0110da0..0000000
--- a/res/layout/support_item_title.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2016 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.
--->
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:background="@color/card_background_grey"
-    android:paddingTop="40dp"
-    android:paddingBottom="42dp"
-    android:paddingStart="56dp"
-    android:paddingEnd="56dp"
-    android:orientation="vertical">
-    <TextView
-        android:id="@android:id/text1"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_horizontal"
-        android:textAppearance="@style/TextAppearance.SupportTitle"/>
-    <TextView
-        android:id="@android:id/text2"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:gravity="center_horizontal"
-        android:paddingTop="8dp"
-        android:textAppearance="@style/TextAppearance.Small"
-        android:textColor="?android:attr/textColorSecondary"/>
-</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/support_offline_escalation_options.xml b/res/layout/support_offline_escalation_options.xml
index 43be55f..d1e77a3 100644
--- a/res/layout/support_offline_escalation_options.xml
+++ b/res/layout/support_offline_escalation_options.xml
@@ -17,13 +17,25 @@
 
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    style="@style/SupportEscalationCard"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@color/card_background_grey"
-    android:gravity="center_horizontal"
-    android:paddingBottom="40dp"
     android:orientation="vertical">
-
+    <TextView
+        android:id="@+id/tile_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:textAppearance="@style/TextAppearance.SupportTitle"/>
+    <TextView
+        android:id="@+id/tile_summary"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:paddingTop="8dp"
+        android:paddingBottom="10dp"
+        android:textAppearance="@style/TextAppearance.Small"
+        android:textColor="?android:attr/textColorSecondary"/>
     <LinearLayout
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
@@ -31,6 +43,7 @@
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:paddingEnd="8dp"
             android:text="@string/support_country_list_title"
             android:textAppearance="@style/TextAppearance.Small"
             android:textColor="?android:attr/textColorSecondary"/>
diff --git a/res/layout/support_sign_in_button.xml b/res/layout/support_sign_in_button.xml
index fb789e8..45de571 100644
--- a/res/layout/support_sign_in_button.xml
+++ b/res/layout/support_sign_in_button.xml
@@ -17,11 +17,25 @@
 
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+    style="@style/SupportEscalationCard"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@color/card_background_grey"
-    android:gravity="center_horizontal"
     android:orientation="vertical">
+    <TextView
+        android:id="@+id/tile_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:textAppearance="@style/TextAppearance.SupportTitle"/>
+    <TextView
+        android:id="@+id/tile_summary"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center_horizontal"
+        android:paddingTop="8dp"
+        android:paddingBottom="30dp"
+        android:textAppearance="@style/TextAppearance.Small"
+        android:textColor="?android:attr/textColorSecondary"/>
     <Button
         android:id="@android:id/text1"
         style="@style/SupportPrimaryButton"
diff --git a/res/layout/support_tile.xml b/res/layout/support_tile.xml
index e07e173..5f7ced4 100644
--- a/res/layout/support_tile.xml
+++ b/res/layout/support_tile.xml
@@ -31,7 +31,7 @@
         android:layout_marginStart="@dimen/dashboard_tile_image_margin_start"
         android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end"/>
     <TextView
-        android:id="@android:id/text1"
+        android:id="@+id/tile_title"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:singleLine="true"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c15236c..f83c621 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7535,9 +7535,6 @@
         <xliff:g id="language" example="English">%s</xliff:g> (<xliff:g id="phone" example="800-000-0000">%s</xliff:g>)
     </string>
 
-    <!-- Title text for support options when there is no internet access. [CHAR LIMIT=80]-->
-    <string name="support_offline_title">Call us toll-free</string>
-
     <!-- Title text for a list of international support phone numbers. [CHAR LIMIT=60]-->
     <string name="support_international_phone_title">Traveling aboard?</string>
 
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 1942a4c..cc6dc30 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -424,4 +424,12 @@
         <item name="android:textAppearance">@android:style/TextAppearance.Material.Subhead</item>
     </style>
 
+    <style name="SupportEscalationCard">
+        <item name="android:background">@color/card_background_grey</item>
+        <item name="android:gravity">center</item>
+        <item name="android:minHeight">368dp</item>
+        <item name="android:paddingStart">56dp</item>
+        <item name="android:paddingEnd">56dp</item>
+    </style>
+
 </resources>
diff --git a/src/com/android/settings/dashboard/SupportItemAdapter.java b/src/com/android/settings/dashboard/SupportItemAdapter.java
index 8f2be01..678226a 100644
--- a/src/com/android/settings/dashboard/SupportItemAdapter.java
+++ b/src/com/android/settings/dashboard/SupportItemAdapter.java
@@ -56,7 +56,6 @@
 public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAdapter.ViewHolder> {
 
     private static final String STATE_SELECTED_COUNTRY = "STATE_SELECTED_COUNTRY";
-    private static final int TYPE_TITLE = R.layout.support_item_title;
     private static final int TYPE_ESCALATION_OPTIONS = R.layout.support_escalation_options;
     private static final int TYPE_ESCALATION_OPTIONS_OFFLINE =
             R.layout.support_offline_escalation_options;
@@ -104,13 +103,13 @@
         final SupportData data = mSupportData.get(position);
         switch (holder.getItemViewType()) {
             case TYPE_SIGN_IN_BUTTON:
-                bindSignInPromoTile(holder, data);
+                bindSignInPromoTile(holder, (EscalationData) data);
                 break;
             case TYPE_ESCALATION_OPTIONS:
-                bindEscalationOptions(holder, data);
+                bindEscalationOptions(holder, (EscalationData) data);
                 break;
             case TYPE_ESCALATION_OPTIONS_OFFLINE:
-                bindOfflineEscalationOptions(holder, (OfflineSupportData) data);
+                bindOfflineEscalationOptions(holder, (OfflineEscalationData) data);
                 break;
             default:
                 bindSupportTile(holder, data);
@@ -183,44 +182,36 @@
                 mSupportFeatureProvider.isSupportTypeEnabled(mActivity, PHONE);
         final boolean hasChatOperation =
                 mSupportFeatureProvider.isSupportTypeEnabled(mActivity, CHAT);
+        final EscalationData.Builder builder = new EscalationData.Builder(mActivity);
         if (!hasPhoneOperation && !hasChatOperation) {
             // No support at all.
-            mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
-                    .setText1(R.string.support_escalation_title)
-                    .setText2(mActivity.getString(R.string.support_escalation_unavailable_summary))
-                    .build());
+            builder.setTileTitle(R.string.support_escalation_title)
+                    .setTileSummary(R.string.support_escalation_unavailable_summary);
         } else if (mSupportFeatureProvider.isAlwaysOperating(PHONE, null /* countryCode */)
                 || mSupportFeatureProvider.isAlwaysOperating(CHAT, null /* countryCode */)) {
             // Support is available.
-            mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
-                    .setText1(R.string.support_escalation_24_7_title)
-                    .setText2(mActivity.getString(R.string.support_escalation_24_7_summary))
-                    .build());
+            builder.setTileTitle(R.string.support_escalation_24_7_title)
+                    .setTileSummary(mActivity.getString(R.string.support_escalation_24_7_summary));
         } else if (mSupportFeatureProvider.isOperatingNow(PHONE)
                 || mSupportFeatureProvider.isOperatingNow(CHAT)) {
             // Support is available now.
-            mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
-                    .setText1(R.string.support_escalation_title)
-                    .setText2(R.string.support_escalation_summary)
-                    .build());
+            builder.setTileTitle(R.string.support_escalation_title)
+                    .setTileSummary(R.string.support_escalation_summary);
         } else {
             // Support is not temporarily unavailable.
-            mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
-                    .setText1(R.string.support_escalation_title)
-                    .setText2(mSupportFeatureProvider.getOperationHours(mActivity, PHONE, null))
-                    .build());
+            builder.setTileTitle(R.string.support_escalation_title)
+                    .setTileSummary(
+                            mSupportFeatureProvider.getOperationHours(mActivity, PHONE, null));
         }
-        final SupportData.Builder builder =
-                new SupportData.Builder(mActivity, TYPE_ESCALATION_OPTIONS);
         if (hasPhoneOperation) {
-            builder.setText1(R.string.support_escalation_by_phone);
-            builder.setSummary1(mSupportFeatureProvider.getEstimatedWaitTime(mActivity, PHONE));
-            builder.setEnabled1(mSupportFeatureProvider.isOperatingNow(PHONE));
+            builder.setText1(R.string.support_escalation_by_phone)
+                    .setSummary1(mSupportFeatureProvider.getEstimatedWaitTime(mActivity, PHONE))
+                    .setEnabled1(mSupportFeatureProvider.isOperatingNow(PHONE));
         }
         if (hasChatOperation) {
-            builder.setText2(R.string.support_escalation_by_chat);
-            builder.setSummary2(mSupportFeatureProvider.getEstimatedWaitTime(mActivity, CHAT));
-            builder.setEnabled2(mSupportFeatureProvider.isOperatingNow(CHAT));
+            builder.setText2(R.string.support_escalation_by_chat)
+                    .setSummary2(mSupportFeatureProvider.getEstimatedWaitTime(mActivity, CHAT))
+                    .setEnabled2(mSupportFeatureProvider.isOperatingNow(CHAT));
         }
         mSupportData.add(builder.build());
     }
@@ -233,46 +224,44 @@
             operatingHours = mSupportFeatureProvider.getOperationHours(mActivity,
                     PHONE, mSelectedCountry);
         }
-        mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
-                .setText1(R.string.support_offline_title)
-                .setText2(operatingHours)
-                .build());
-        final OfflineSupportData.Builder builder = new OfflineSupportData.Builder(mActivity);
-        builder.setCountries(mSupportFeatureProvider.getPhoneSupportCountries())
+        mSupportData.add(new OfflineEscalationData.Builder(mActivity)
+                .setCountries(mSupportFeatureProvider.getPhoneSupportCountries())
                 .setTollFreePhone(mSupportFeatureProvider.getSupportPhones(
                         mSelectedCountry, true /* isTollFree */))
                 .setTolledPhone(mSupportFeatureProvider.getSupportPhones(
-                        mSelectedCountry, false /* isTollFree */));
-        mSupportData.add(builder.build());
+                        mSelectedCountry, false /* isTollFree */))
+                .setTileTitle(R.string.support_escalation_title)
+                .setTileSummary(operatingHours)
+                .build());
     }
 
     private void addSignInPromo() {
-        mSupportData.add(new SupportData.Builder(mActivity, TYPE_TITLE)
-                .setText1(R.string.support_sign_in_required_title)
-                .setText2(R.string.support_sign_in_required_summary)
-                .build());
-        mSupportData.add(new SupportData.Builder(mActivity, TYPE_SIGN_IN_BUTTON)
+        mSupportData.add(new EscalationData.Builder(mActivity, TYPE_SIGN_IN_BUTTON)
                 .setText1(R.string.support_sign_in_button_text)
                 .setText2(R.string.support_sign_in_required_help)
+                .setTileTitle(R.string.support_sign_in_required_title)
+                .setTileSummary(R.string.support_sign_in_required_summary)
                 .build());
     }
 
     private void addMoreHelpItems() {
         mSupportData.add(new SupportData.Builder(mActivity, TYPE_SUPPORT_TILE)
                 .setIcon(R.drawable.ic_help_24dp)
-                .setText1(R.string.support_help_feedback_title)
+                .setTileTitle(R.string.support_help_feedback_title)
                 .setIntent(mSupportFeatureProvider.getHelpIntent(mActivity))
                 .setMetricsEvent(MetricsProto.MetricsEvent.ACTION_SUPPORT_HELP_AND_FEEDBACK)
                 .build());
         mSupportData.add(new SupportData.Builder(mActivity, TYPE_SUPPORT_TILE)
                 .setIcon(R.drawable.ic_lightbulb_outline_24)
-                .setText1(R.string.support_tips_and_tricks_title)
+                .setTileTitle(R.string.support_tips_and_tricks_title)
                 .setIntent(mSupportFeatureProvider.getTipsAndTricksIntent(mActivity))
                 .setMetricsEvent(MetricsProto.MetricsEvent.ACTION_SUPPORT_TIPS_AND_TRICKS)
                 .build());
     }
 
-    private void bindEscalationOptions(ViewHolder holder, SupportData data) {
+    private void bindEscalationOptions(ViewHolder holder, EscalationData data) {
+        holder.tileTitleView.setText(data.tileTitle);
+        holder.tileSummaryView.setText(data.tileSummary);
         if (data.text1 == 0) {
             holder.text1View.setVisibility(View.GONE);
         } else {
@@ -299,7 +288,10 @@
         }
     }
 
-    private void bindOfflineEscalationOptions(ViewHolder holder, OfflineSupportData data) {
+    private void bindOfflineEscalationOptions(ViewHolder holder, OfflineEscalationData data) {
+        // Bind Title
+        holder.tileTitleView.setText(data.tileTitle);
+        holder.tileSummaryView.setText(data.tileSummary);
         // Bind spinner
         final Spinner spinner = (Spinner) holder.itemView.findViewById(R.id.spinner);
         final ArrayAdapter<String> adapter = new ArrayAdapter(
@@ -331,7 +323,9 @@
         }
     }
 
-    private void bindSignInPromoTile(ViewHolder holder, SupportData data) {
+    private void bindSignInPromoTile(ViewHolder holder, EscalationData data) {
+        holder.tileTitleView.setText(data.tileTitle);
+        holder.tileSummaryView.setText(data.tileSummary);
         holder.text1View.setText(data.text1);
         holder.text2View.setText(data.text2);
         holder.text1View.setOnClickListener(mEscalationClickListener);
@@ -342,11 +336,11 @@
         if (holder.iconView != null) {
             holder.iconView.setImageResource(data.icon);
         }
-        if (holder.text1View != null) {
-            holder.text1View.setText(data.text1);
+        if (holder.tileTitleView != null) {
+            holder.tileTitleView.setText(data.tileTitle);
         }
-        if (holder.text2View != null) {
-            holder.text2View.setText(data.text2);
+        if (holder.tileSummaryView != null) {
+            holder.tileSummaryView.setText(data.tileSummary);
         }
         holder.itemView.setOnClickListener(mItemClickListener);
     }
@@ -445,6 +439,8 @@
     static final class ViewHolder extends RecyclerView.ViewHolder {
 
         final ImageView iconView;
+        final TextView tileTitleView;
+        final TextView tileSummaryView;
         final TextView text1View;
         final TextView text2View;
         final TextView summary1View;
@@ -453,6 +449,8 @@
         ViewHolder(View itemView) {
             super(itemView);
             iconView = (ImageView) itemView.findViewById(android.R.id.icon);
+            tileTitleView = (TextView) itemView.findViewById(R.id.tile_title);
+            tileSummaryView = (TextView) itemView.findViewById(R.id.tile_summary);
             text1View = (TextView) itemView.findViewById(android.R.id.text1);
             text2View = (TextView) itemView.findViewById(android.R.id.text2);
             summary1View = (TextView) itemView.findViewById(R.id.summary1);
@@ -472,40 +470,29 @@
         @DrawableRes
         final int icon;
         @StringRes
-        final int text1;
-        final CharSequence text2;
-        final boolean enabled1;
-        final boolean enabled2;
-        final CharSequence summary1;
-        final CharSequence summary2;
+        final int tileTitle;
+        final CharSequence tileSummary;
+
 
         private SupportData(Builder builder) {
             this.type = builder.mType;
             this.icon = builder.mIcon;
-            this.text1 = builder.mText1;
-            this.text2 = builder.mText2;
-            this.summary1 = builder.mSummary1;
-            this.summary2 = builder.mSummary2;
-            this.enabled1 = builder.mEnabled1;
-            this.enabled2 = builder.mEnabled2;
+            this.tileTitle = builder.mTileTitle;
+            this.tileSummary = builder.mTileSummary;
             this.intent = builder.mIntent;
             this.metricsEvent = builder.mMetricsEvent;
         }
 
         static class Builder {
 
-            private final Context mContext;
+            protected final Context mContext;
             @LayoutRes
             private final int mType;
             @DrawableRes
             private int mIcon;
-            private boolean mEnabled1;
-            private boolean mEnabled2;
             @StringRes
-            private int mText1;
-            private CharSequence mText2;
-            private CharSequence mSummary1;
-            private CharSequence mSummary2;
+            private int mTileTitle;
+            private CharSequence mTileSummary;
             private Intent mIntent;
             private int mMetricsEvent = -1;
 
@@ -519,6 +506,78 @@
                 return this;
             }
 
+            Builder setTileTitle(@StringRes int title) {
+                mTileTitle = title;
+                return this;
+            }
+
+            Builder setTileSummary(@StringRes int summary) {
+                mTileSummary = mContext.getString(summary);
+                return this;
+            }
+
+            Builder setTileSummary(CharSequence summary) {
+                mTileSummary = summary;
+                return this;
+            }
+
+            Builder setMetricsEvent(int metricsEvent) {
+                mMetricsEvent = metricsEvent;
+                return this;
+            }
+
+            Builder setIntent(Intent intent) {
+                mIntent = intent;
+                return this;
+            }
+
+            SupportData build() {
+                return new SupportData(this);
+            }
+        }
+    }
+
+    /**
+     * Data model for escalation cards.
+     */
+    private static class EscalationData extends SupportData {
+
+        @StringRes
+        final int text1;
+        final CharSequence text2;
+        final boolean enabled1;
+        final boolean enabled2;
+        final CharSequence summary1;
+        final CharSequence summary2;
+
+        private EscalationData(Builder builder) {
+            super(builder);
+            this.text1 = builder.mText1;
+            this.text2 = builder.mText2;
+            this.summary1 = builder.mSummary1;
+            this.summary2 = builder.mSummary2;
+            this.enabled1 = builder.mEnabled1;
+            this.enabled2 = builder.mEnabled2;
+        }
+
+        static class Builder extends SupportData.Builder {
+
+            @StringRes
+            private int mText1;
+            private CharSequence mText2;
+            private CharSequence mSummary1;
+            private CharSequence mSummary2;
+            private boolean mEnabled1;
+            private boolean mEnabled2;
+
+            protected Builder(Context context, @LayoutRes int type) {
+                super(context, type);
+            }
+
+            Builder(Context context) {
+                this(context, TYPE_ESCALATION_OPTIONS);
+            }
+
             Builder setEnabled1(boolean enabled) {
                 mEnabled1 = enabled;
                 return this;
@@ -554,18 +613,8 @@
                 return this;
             }
 
-            Builder setMetricsEvent(int metricsEvent) {
-                mMetricsEvent = metricsEvent;
-                return this;
-            }
-
-            Builder setIntent(Intent intent) {
-                mIntent = intent;
-                return this;
-            }
-
-            SupportData build() {
-                return new SupportData(this);
+            EscalationData build() {
+                return new EscalationData(this);
             }
         }
     }
@@ -573,20 +622,20 @@
     /**
      * Support data for offline mode.
      */
-    private static final class OfflineSupportData extends SupportData {
+    private static final class OfflineEscalationData extends EscalationData {
 
         final List<String> countries;
         final SupportPhone tollFreePhone;
         final SupportPhone tolledPhone;
 
-        private OfflineSupportData(Builder builder) {
+        private OfflineEscalationData(Builder builder) {
             super(builder);
             countries = builder.mCountries;
             tollFreePhone = builder.mTollFreePhone;
             tolledPhone = builder.mTolledPhone;
         }
 
-        static final class Builder extends SupportData.Builder {
+        static final class Builder extends EscalationData.Builder {
 
             private List<String> mCountries;
             private SupportPhone mTollFreePhone;
@@ -611,8 +660,8 @@
                 return this;
             }
 
-            OfflineSupportData build() {
-                return new OfflineSupportData(this);
+            OfflineEscalationData build() {
+                return new OfflineEscalationData(this);
             }
         }
     }