Change owner info to be a dialog rather than screen

Bug: 15937670
Change-Id: I8d8609ff165c4a76e318a80a62fb1dc9effbc82a
diff --git a/res/layout/ownerinfo.xml b/res/layout/ownerinfo.xml
index 6adec7d..80f0192 100644
--- a/res/layout/ownerinfo.xml
+++ b/res/layout/ownerinfo.xml
@@ -16,70 +16,29 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:paddingStart="20dip"
+    android:paddingEnd="20dip"
+    android:paddingTop="20dip"
     android:orientation="vertical"
-    android:scrollbars="vertical"
     android:background="@android:color/white">
 
-    <ScrollView
+    <EditText
+        android:id="@+id/owner_info_edit_text"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:scrollbarStyle="outsideOverlay"
-        android:fillViewport="true">
+        android:layout_height="wrap_content"
+        android:gravity="top"
+        android:hint="@string/owner_info_settings_edit_text_hint"
+        android:maxLength="100"
+        android:inputType="textMultiLine|textCapSentences"
+        />
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            android:paddingStart="?android:attr/listPreferredItemPaddingStart"
-            android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
-
-            <View
-                android:paddingTop="53dip"
-                android:layout_width="match_parent"
-                android:layout_height="1dip"
-                android:background="#ff404040"
-                />
-
-            <EditText android:id="@+id/owner_info_nickname"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="8dip"
-                android:gravity="top"
-                android:hint="@string/user_nickname"
-                android:inputType="textCapWords"
-            />
-
-            <CheckBox android:id="@+id/show_owner_info_on_lockscreen_checkbox"
-                android:layout_width="match_parent"
-                android:layout_height="64dip"
-                android:gravity="center_vertical"
-                android:layout_marginTop="8dip"
-                android:text="@string/show_owner_info_on_lockscreen_label"
-                android:textAppearance="?android:attr/textAppearanceMedium"
-                android:textColor="?android:attr/textColorSecondary"
-            />
-
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="1dip"
-                android:background="#ff404040"
-                />
-
-            <EditText android:id="@+id/owner_info_edit_text"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginStart="62dip"
-                android:layout_marginTop="40dip"
-                android:gravity="top"
-                android:hint="@string/owner_info_settings_edit_text_hint"
-                android:lines="8"
-                android:maxLines="8"
-                android:inputType="textMultiLine|textCapSentences"
-            />
-
-        </LinearLayout>
-
-    </ScrollView>
+    <TextView
+        android:id="@+id/owner_info_status"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="end"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        />
 
 </LinearLayout>
 
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 153492b..7e7026d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -700,17 +700,17 @@
     <!-- Text shown next to checkbox for showing owner info on LockScreen [CHAR LIMIT=50]-->
     <string name="show_owner_info_on_lockscreen_label">Show owner info on lock screen</string>
     <!-- Text shown for title of owner info setting [CHAR LIMIT=20]-->
-    <string name="owner_info_settings_title">Owner info</string>
+    <string name="owner_info_settings_title">Lock screen message</string>
     <!-- Text shown for title of settings checkbox to enable widgets [CHAR LIMIT=20]-->
     <string name="security_enable_widgets_title">Enable widgets</string>
     <!-- Summary for settings checkbox to disable widgets when the setting has been disabled by an installed device admin [CHAR LIMIT=50] -->
     <string name="security_enable_widgets_disabled_summary">Disabled by administrator</string>
-    <!-- Text shown for summary of owner info setting [CHAR LIMIT=40]-->
-    <string name="owner_info_settings_summary"></string>
+    <!-- Text shown for summary of owner info setting (if none set) [CHAR LIMIT=40]-->
+    <string name="owner_info_settings_summary">None</string>
+    <!-- Description of how many characters are used in owner info [CHAR LIMIT=40]-->
+    <string name="owner_info_settings_status"><xliff:g id="count" example="90">%1$d</xliff:g> / <xliff:g id="count" example="100">%2$d</xliff:g></string>
     <!-- Hint text shown in owner info edit text [CHAR LIMIT=50] -->
-    <string name="owner_info_settings_edit_text_hint">Type text to display on the lock screen</string>
-    <!-- Text shown next to checkbox for showing user info on LockScreen [CHAR LIMIT=50]-->
-    <string name="show_user_info_on_lockscreen_label">Show user info on lock screen</string>
+    <string name="owner_info_settings_edit_text_hint">E.g., Joe\'s Android.</string>
     <!-- Text shown for title of user info setting [CHAR LIMIT=20]-->
     <string name="user_info_settings_title">User info</string>
     <!-- Text shown next to checkbox for showing profile info on LockScreen [CHAR LIMIT=50]-->
diff --git a/res/xml/security_settings_chooser.xml b/res/xml/security_settings_chooser.xml
index 4c1d809..af7bfeb 100644
--- a/res/xml/security_settings_chooser.xml
+++ b/res/xml/security_settings_chooser.xml
@@ -27,9 +27,8 @@
             android:summary="@string/unlock_set_unlock_mode_none"
             android:persistent="false"/>
 
-        <PreferenceScreen
+        <com.android.settings.SingleLineSummaryPreference
             android:key="owner_info_settings"
-            android:fragment="com.android.settings.OwnerInfoSettings"
             android:title="@string/owner_info_settings_title"
             android:summary="@string/owner_info_settings_summary"/>
 
diff --git a/res/xml/security_settings_lockscreen.xml b/res/xml/security_settings_lockscreen.xml
index 88df74b..480d6ee 100644
--- a/res/xml/security_settings_lockscreen.xml
+++ b/res/xml/security_settings_lockscreen.xml
@@ -29,9 +29,8 @@
             settings:keywords="@string/keywords_lockscreen"
             android:persistent="false"/>
 
-        <PreferenceScreen
+        <com.android.settings.SingleLineSummaryPreference
             android:key="owner_info_settings"
-            android:fragment="com.android.settings.OwnerInfoSettings"
             android:title="@string/owner_info_settings_title"
             android:summary="@string/owner_info_settings_summary"/>
 
diff --git a/res/xml/security_settings_password.xml b/res/xml/security_settings_password.xml
index 9f1092a..b610562 100644
--- a/res/xml/security_settings_password.xml
+++ b/res/xml/security_settings_password.xml
@@ -41,9 +41,8 @@
             android:key="power_button_instantly_locks"
             android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
 
-        <PreferenceScreen
+        <com.android.settings.SingleLineSummaryPreference
             android:key="owner_info_settings"
-            android:fragment="com.android.settings.OwnerInfoSettings"
             android:title="@string/owner_info_settings_title"
             android:summary="@string/owner_info_settings_summary"/>
 
diff --git a/res/xml/security_settings_pattern.xml b/res/xml/security_settings_pattern.xml
index ceb749c..867bed4 100644
--- a/res/xml/security_settings_pattern.xml
+++ b/res/xml/security_settings_pattern.xml
@@ -45,8 +45,7 @@
             android:key="power_button_instantly_locks"
             android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
 
-        <PreferenceScreen
-            android:fragment="com.android.settings.OwnerInfoSettings"
+        <com.android.settings.SingleLineSummaryPreference
             android:key="owner_info_settings"
             android:title="@string/owner_info_settings_title"
             android:summary="@string/owner_info_settings_summary"/>
diff --git a/res/xml/security_settings_pin.xml b/res/xml/security_settings_pin.xml
index 4470b1d..ac09a2c 100644
--- a/res/xml/security_settings_pin.xml
+++ b/res/xml/security_settings_pin.xml
@@ -41,9 +41,8 @@
             android:key="power_button_instantly_locks"
             android:title="@string/lockpattern_settings_enable_power_button_instantly_locks"/>
 
-        <PreferenceScreen
+        <com.android.settings.SingleLineSummaryPreference
             android:key="owner_info_settings"
-            android:fragment="com.android.settings.OwnerInfoSettings"
             android:title="@string/owner_info_settings_title"
             android:summary="@string/owner_info_settings_summary"/>