diff --git a/res/layout/master_clear.xml b/res/layout/master_clear.xml
index 16222d3fa1e..ec61310b286 100644
--- a/res/layout/master_clear.xml
+++ b/res/layout/master_clear.xml
@@ -35,6 +35,22 @@
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="@string/master_clear_desc" />
+
+
+
+
+
+
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 93df0bbf7a6..cfaa9809c5e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1597,11 +1597,14 @@
Erases all data on phone
- "This will erase all data from your tablet\'s internal storage, including:\n\nYour Google account\nSystem and application data and settings\nDownloaded applications\n\nTo clear all data on this tablet the USB storage needs to be erased.\n\n"
+ "This will erase all data from your tablet\'s internal storage, including:\n\nYour Google account\nSystem and application data and settings\nDownloaded applications"
- "This will erase all data from your phone\'s internal storage, including:\n\nYour Google account\nSystem and application data and settings\nDownloaded applications\n\nTo clear all data on this phone the USB storage needs to be erased.\n\n"
-
- "This will erase all data from your phone\'s internal storage, including:\n\nYour Google account\nSystem and application data and settings\nDownloaded applications\n\nTo also clear music, pictures, and other user data, the SD card needs to be erased.\n\n"
+ "This will erase all data from your phone\'s internal storage, including:\n\nYour Google account\nSystem and application data and settings\nDownloaded applications"
+
+ "\n\nYou are currently signed into the following accounts:\n"
+
+ "\n\nTo also clear music, pictures, and other user data, the USB storage needs to be erased."
+ "\n\nTo also clear music, pictures, and other user data, the SD card needs to be erased."
Erase USB storage
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index a2ef7f4a604..3060d3e1893 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -18,18 +18,27 @@ package com.android.settings;
import com.android.settings.R;
+import android.accounts.Account;
+import android.accounts.AccountManager;
+import android.accounts.AuthenticatorDescription;
import android.app.Activity;
import android.app.Fragment;
+import android.content.Context;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
+import android.widget.LinearLayout;
+import android.widget.TextView;
/**
* Confirm and execute a reset of the device to a clean "just out of the box"
@@ -42,6 +51,7 @@ import android.widget.CheckBox;
* This is the initial screen.
*/
public class MasterClear extends Fragment {
+ private static final String TAG = "MasterClear";
private static final int KEYGUARD_REQUEST = 55;
@@ -130,12 +140,72 @@ public class MasterClear extends Fragment {
mExternalStorage.toggle();
}
});
+
+ loadAccountList();
+ }
+
+ private void loadAccountList() {
+ View accountsLabel = mContentView.findViewById(R.id.accounts_label);
+ LinearLayout contents = (LinearLayout)mContentView.findViewById(R.id.accounts);
+
+ Context context = getActivity();
+
+ AccountManager mgr = AccountManager.get(context);
+ Account[] accounts = mgr.getAccounts();
+ final int N = accounts.length;
+ if (N == 0) {
+ accountsLabel.setVisibility(View.GONE);
+ contents.setVisibility(View.GONE);
+ return;
+ }
+
+ LayoutInflater inflater = (LayoutInflater)context.getSystemService(
+ Context.LAYOUT_INFLATER_SERVICE);
+
+ AuthenticatorDescription[] descs = AccountManager.get(context).getAuthenticatorTypes();
+ final int M = descs.length;
+
+ for (int i=0; i