account: add device name edition

Change the device list:
* add "this device" indication
* add dialog to rename our device
* minor bug fix in revocation dialog:
  getDialog() is always null in onCreateDialog()

Change-Id: I8e5b7256268bf4018cba135402e6f6de00b745cc
Tuleap: #1494
diff --git a/ring-android/app/src/main/res/layout/item_device.xml b/ring-android/app/src/main/res/layout/item_device.xml
index e9b68d1..0027516 100644
--- a/ring-android/app/src/main/res/layout/item_device.xml
+++ b/ring-android/app/src/main/res/layout/item_device.xml
@@ -41,8 +41,12 @@
         android:layout_centerVertical="true"
         android:layout_marginLeft="56dp"
         android:layout_marginStart="56dp"
+        android:layout_toLeftOf="@+id/txt_device_thisflag"
+        android:layout_toStartOf="@+id/txt_device_thisflag"
+        android:ellipsize="end"
+        android:lines="1"
         android:textAppearance="@style/ListPrimary"
-        tools:text="8E24CCF4" />
+        tools:text="My device" />
 
     <TextView
         android:id="@+id/txt_device_id"
@@ -51,13 +55,39 @@
         android:layout_alignLeft="@id/txt_device_label"
         android:layout_alignStart="@+id/txt_device_label"
         android:layout_below="@id/txt_device_label"
-        android:layout_toLeftOf="@+id/revoke_button"
-        android:layout_toStartOf="@+id/revoke_button"
+        android:layout_toLeftOf="@+id/rename_button"
+        android:layout_toStartOf="@+id/rename_button"
         android:ellipsize="middle"
         android:maxLines="1"
-        android:maxWidth="150dp"
         android:textAppearance="@style/TextAppearance.AppCompat.Caption"
-        tools:text="e3806a4963993ed1e8adc5c0ed9809c354dfc872" />
+        tools:text="b982672502b9f1236a68353d74734cb82f9d1fab" />
+
+    <TextView
+        android:id="@+id/txt_device_thisflag"
+        style="@style/TextAppearance.AppCompat.Small"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignBaseline="@+id/txt_device_label"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_toLeftOf="@+id/rename_button"
+        android:layout_toStartOf="@+id/rename_button"
+        android:text="@string/account_device_this_indicator"
+        android:textStyle="italic" />
+
+    <ImageButton
+        android:id="@+id/rename_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignWithParentIfMissing="true"
+        android:layout_centerVertical="true"
+        android:layout_toLeftOf="@+id/revoke_button"
+        android:layout_toStartOf="@+id/revoke_button"
+        android:background="?selectableItemBackgroundBorderless"
+        android:contentDescription="@string/account_device_revoke"
+        android:padding="8dp"
+        android:tint="@color/black"
+        app:srcCompat="@drawable/ic_action_edit" />
 
     <ImageButton
         android:id="@+id/revoke_button"