diff --git a/res/drawable/ic_delete_accent.xml b/res/drawable/ic_delete_accent.xml
new file mode 100644
index 00000000000..86a9ccacd40
--- /dev/null
+++ b/res/drawable/ic_delete_accent.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
diff --git a/res/layout/master_clear.xml b/res/layout/master_clear.xml
index 921347e655e..247eedc407f 100644
--- a/res/layout/master_clear.xml
+++ b/res/layout/master_clear.xml
@@ -14,122 +14,125 @@
limitations under the License.
-->
-
+ android:orientation="vertical"
+ android:theme="@style/SuwThemeGlifV3.Light"
+ android:icon="@drawable/ic_delete_accent"
+ app:suwHeaderText="@string/master_clear_title">
+ android:id="@+id/master_clear_scrollview"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginStart="@dimen/reset_master_clear_margin_start"
+ android:layout_marginEnd="@dimen/reset_master_clear_margin_end">
+
+
-
+
-
+
-
+
-
+ android:text="@string/master_clear_accounts"/>
+
-
-
+
-
+
-
+
+
+
-
-
+ android:layout_gravity="center_vertical"
+ android:orientation="vertical">
+ android:text="@string/erase_external_storage"/>
+ android:text="@string/erase_external_storage_description"/>
-
+
-
-
-
+
diff --git a/res/layout/master_clear_account.xml b/res/layout/master_clear_account.xml
index 4a0552de873..0b522f24274 100644
--- a/res/layout/master_clear_account.xml
+++ b/res/layout/master_clear_account.xml
@@ -20,8 +20,7 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
- android:paddingStart="16dp"
- android:paddingEnd="16dp">
+ style="@style/SuwDescription.Glif" >
+ style="@style/TextAppearance.SuwGlifItemSummary"/>
diff --git a/res/layout/master_clear_confirm.xml b/res/layout/master_clear_confirm.xml
index 4ab3a0fb72c..146fb770b8d 100644
--- a/res/layout/master_clear_confirm.xml
+++ b/res/layout/master_clear_confirm.xml
@@ -4,37 +4,37 @@
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.
-->
-
+ android:theme="@style/SuwThemeGlifV3.Light"
+ android:id="@+id/setup_wizard_layout"
+ android:icon="@drawable/ic_delete_accent"
+ app:suwHeaderText="@string/master_clear_confirm_title">
-
+ android:orientation="vertical">
-
-
-
+
+
+
diff --git a/res/layout/reset_esim_checkbox.xml b/res/layout/reset_esim_checkbox.xml
index fb15fe66766..e2ae4bbd5ed 100644
--- a/res/layout/reset_esim_checkbox.xml
+++ b/res/layout/reset_esim_checkbox.xml
@@ -15,6 +15,7 @@
-->
+ android:duplicateParentState="true"/>
+ android:layout_height="wrap_content"/>
+ android:text="@string/reset_esim_desc"/>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 4d168518897..a11dd5fd947 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -301,7 +301,7 @@
72dp
12dp
- 72dp
+ 32dp
12dp
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 88ff2bb56be..b096cf8821d 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -458,9 +458,4 @@
- 24dp
-
-
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index c8ec448594b..97942fec63e 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -21,7 +21,7 @@ import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AuthenticatorDescription;
-import android.annotation.Nullable;
+import android.app.ActionBar;
import android.app.Activity;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -31,6 +31,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
import android.content.res.Resources;
+import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Environment;
@@ -61,8 +62,9 @@ import com.android.settings.core.SubSettingLauncher;
import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
import com.android.settings.password.ChooseLockSettingsHelper;
import com.android.settings.password.ConfirmLockPattern;
-import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.RestrictedLockUtilsInternal;
+import com.android.setupwizardlib.TemplateLayout;
+import com.android.setupwizardlib.template.ButtonFooterMixin;
import java.util.List;
@@ -79,8 +81,10 @@ import java.util.List;
public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutListener {
private static final String TAG = "MasterClear";
- @VisibleForTesting static final int KEYGUARD_REQUEST = 55;
- @VisibleForTesting static final int CREDENTIAL_CONFIRM_REQUEST = 56;
+ @VisibleForTesting
+ static final int KEYGUARD_REQUEST = 55;
+ @VisibleForTesting
+ static final int CREDENTIAL_CONFIRM_REQUEST = 56;
private static final String KEY_SHOW_ESIM_RESET_CHECKBOX
= "masterclear.allow_retain_esim_profiles_after_fdr";
@@ -89,27 +93,41 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
static final String ERASE_ESIMS_EXTRA = "erase_esim";
private View mContentView;
- @VisibleForTesting Button mInitiateButton;
+ @VisibleForTesting
+ Button mInitiateButton;
private View mExternalStorageContainer;
- @VisibleForTesting CheckBox mExternalStorage;
+ @VisibleForTesting
+ CheckBox mExternalStorage;
private View mEsimStorageContainer;
- @VisibleForTesting CheckBox mEsimStorage;
- @VisibleForTesting ScrollView mScrollView;
+ @VisibleForTesting
+ CheckBox mEsimStorage;
+ @VisibleForTesting
+ ScrollView mScrollView;
@Override
public void onGlobalLayout() {
mInitiateButton.setEnabled(hasReachedBottom(mScrollView));
}
- @Override
- public void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- getActivity().setTitle(R.string.master_clear_short_title);
+ private void setUpActionBarAndTitle() {
+ final Activity activity = getActivity();
+ if (activity == null) {
+ Log.e(TAG, "No activity attached, skipping setUpActionBarAndTitle");
+ return;
+ }
+ final ActionBar actionBar = activity.getActionBar();
+ if (actionBar == null) {
+ Log.e(TAG, "No actionbar, skipping setUpActionBarAndTitle");
+ return;
+ }
+ actionBar.hide();
+ activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
}
/**
* Keyguard validation is run using the standard {@link ConfirmLockPattern}
* component as a subactivity
+ *
* @param request the request code to be returned once confirmation finishes
* @return true if confirmation launched
*/
@@ -189,8 +207,8 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
Account[] accounts = am.getAccountsByType(accountType);
if (accounts != null && accounts.length > 0) {
final Intent requestAccountConfirmation = new Intent()
- .setPackage(packageName)
- .setComponent(new ComponentName(packageName, className));
+ .setPackage(packageName)
+ .setComponent(new ComponentName(packageName, className));
// Check to make sure that the intent is supported.
final PackageManager pm = context.getPackageManager();
final ResolveInfo resolution = pm.resolveActivity(requestAccountConfirmation, 0);
@@ -259,8 +277,9 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
*/
@VisibleForTesting
void establishInitialState() {
- mInitiateButton = mContentView.findViewById(R.id.initiate_master_clear);
- mInitiateButton.setOnClickListener(mInitiateListener);
+ setUpActionBarAndTitle();
+ setUpInitiateButton();
+
mExternalStorageContainer = mContentView.findViewById(R.id.erase_external_container);
mExternalStorage = mContentView.findViewById(R.id.erase_external);
mEsimStorageContainer = mContentView.findViewById(R.id.erase_esim_container);
@@ -334,7 +353,7 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
mScrollView.setOnScrollChangeListener(new OnScrollChangeListener() {
@Override
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX,
- int oldScrollY) {
+ int oldScrollY) {
if (v instanceof ScrollView && hasReachedBottom((ScrollView) v)) {
mInitiateButton.setEnabled(true);
mScrollView.setOnScrollChangeListener(null);
@@ -360,8 +379,8 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
}
ContentResolver cr = context.getContentResolver();
return Settings.Global.getInt(cr, Settings.Global.EUICC_PROVISIONED, 0) != 0
- || Settings.Global.getInt(
- cr, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
+ || Settings.Global.getInt(
+ cr, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0;
}
@VisibleForTesting
@@ -388,21 +407,36 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
return diff <= 0;
}
+ private void setUpInitiateButton() {
+ if (mInitiateButton != null) {
+ return;
+ }
+
+ final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
+ final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
+ buttonFooterMixin.removeAllViews();
+ buttonFooterMixin.addSpace();
+ buttonFooterMixin.addSpace();
+ mInitiateButton = buttonFooterMixin.addButton(R.string.master_clear_button_text,
+ R.style.SuwGlifButton_Primary);
+ mInitiateButton.setOnClickListener(mInitiateListener);
+ }
+
private void getContentDescription(View v, StringBuffer description) {
- if (v.getVisibility() != View.VISIBLE) {
- return;
- }
- if (v instanceof ViewGroup) {
- ViewGroup vGroup = (ViewGroup) v;
- for (int i = 0; i < vGroup.getChildCount(); i++) {
- View nextChild = vGroup.getChildAt(i);
- getContentDescription(nextChild, description);
- }
- } else if (v instanceof TextView) {
- TextView vText = (TextView) v;
- description.append(vText.getText());
- description.append(","); // Allow Talkback to pause between sections.
- }
+ if (v.getVisibility() != View.VISIBLE) {
+ return;
+ }
+ if (v instanceof ViewGroup) {
+ ViewGroup vGroup = (ViewGroup) v;
+ for (int i = 0; i < vGroup.getChildCount(); i++) {
+ View nextChild = vGroup.getChildAt(i);
+ getContentDescription(nextChild, description);
+ }
+ } else if (v instanceof TextView) {
+ TextView vText = (TextView) v;
+ description.append(vText.getText());
+ description.append(","); // Allow Talkback to pause between sections.
+ }
}
private boolean isExtStorageEncrypted() {
@@ -412,7 +446,7 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
private void loadAccountList(final UserManager um) {
View accountsLabel = mContentView.findViewById(R.id.accounts_label);
- LinearLayout contents = (LinearLayout)mContentView.findViewById(R.id.accounts);
+ LinearLayout contents = (LinearLayout) mContentView.findViewById(R.id.accounts);
contents.removeAllViews();
Context context = getActivity();
@@ -421,7 +455,7 @@ public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutL
AccountManager mgr = AccountManager.get(context);
- LayoutInflater inflater = (LayoutInflater)context.getSystemService(
+ LayoutInflater inflater = (LayoutInflater) context.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
int accountsCount = 0;
diff --git a/src/com/android/settings/MasterClearConfirm.java b/src/com/android/settings/MasterClearConfirm.java
index cfd20ebf03d..8ebb71054b3 100644
--- a/src/com/android/settings/MasterClearConfirm.java
+++ b/src/com/android/settings/MasterClearConfirm.java
@@ -16,18 +16,23 @@
package com.android.settings;
+
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+import android.app.ActionBar;
+import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
+import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
import android.service.oemlock.OemLockManager;
import android.service.persistentdata.PersistentDataBlockManager;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -37,8 +42,9 @@ import android.widget.TextView;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
-import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.RestrictedLockUtilsInternal;
+import com.android.setupwizardlib.TemplateLayout;
+import com.android.setupwizardlib.template.ButtonFooterMixin;
/**
* Confirm and execute a reset of the device to a clean "just out of the box"
@@ -51,6 +57,7 @@ import com.android.settingslib.RestrictedLockUtilsInternal;
* This is the confirmation screen.
*/
public class MasterClearConfirm extends InstrumentedFragment {
+ private final static String TAG = "MasterClearConfirm";
private View mContentView;
private boolean mEraseSdCard;
@@ -103,9 +110,11 @@ public class MasterClearConfirm extends InstrumentedFragment {
mProgressDialog.show();
// need to prevent orientation changes as we're about to go into
- // a long IO request, so we won't be able to access inflate resources on flash
+ // a long IO request, so we won't be able to access inflate resources on
+ // flash
mOldOrientation = getActivity().getRequestedOrientation();
- getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
+ getActivity().setRequestedOrientation(
+ ActivityInfo.SCREEN_ORIENTATION_LOCKED);
}
}.execute();
} else {
@@ -140,8 +149,29 @@ public class MasterClearConfirm extends InstrumentedFragment {
* Configure the UI for the final confirmation interaction
*/
private void establishFinalConfirmationState() {
- mContentView.findViewById(R.id.execute_master_clear)
- .setOnClickListener(mFinalClickListener);
+ final TemplateLayout layout = mContentView.findViewById(R.id.setup_wizard_layout);
+
+ final ButtonFooterMixin buttonFooterMixin = layout.getMixin(ButtonFooterMixin.class);
+ buttonFooterMixin.removeAllViews();
+ buttonFooterMixin.addSpace();
+ buttonFooterMixin.addSpace();
+ buttonFooterMixin.addButton(R.string.master_clear_button_text,
+ R.style.SuwGlifButton_Primary).setOnClickListener(mFinalClickListener);
+ }
+
+ private void setUpActionBarAndTitle() {
+ final Activity activity = getActivity();
+ if (activity == null) {
+ Log.e(TAG, "No activity attached, skipping setUpActionBarAndTitle");
+ return;
+ }
+ final ActionBar actionBar = activity.getActionBar();
+ if (actionBar == null) {
+ Log.e(TAG, "No actionbar, skipping setUpActionBarAndTitle");
+ return;
+ }
+ actionBar.hide();
+ activity.getWindow().setStatusBarColor(Color.TRANSPARENT);
}
@Override
@@ -160,6 +190,7 @@ public class MasterClearConfirm extends InstrumentedFragment {
return new View(getActivity());
}
mContentView = inflater.inflate(R.layout.master_clear_confirm, null);
+ setUpActionBarAndTitle();
establishFinalConfirmationState();
setAccessibilityTitle();
return mContentView;
@@ -167,8 +198,7 @@ public class MasterClearConfirm extends InstrumentedFragment {
private void setAccessibilityTitle() {
CharSequence currentTitle = getActivity().getTitle();
- TextView confirmationMessage =
- (TextView) mContentView.findViewById(R.id.master_clear_confirm);
+ TextView confirmationMessage = mContentView.findViewById(R.id.master_clear_confirm);
if (confirmationMessage != null) {
String accessibleText = new StringBuilder(currentTitle).append(",").append(
confirmationMessage.getText()).toString();
diff --git a/tests/robotests/src/com/android/settings/MasterClearTest.java b/tests/robotests/src/com/android/settings/MasterClearTest.java
index e1243655bb1..174f5ab7af6 100644
--- a/tests/robotests/src/com/android/settings/MasterClearTest.java
+++ b/tests/robotests/src/com/android/settings/MasterClearTest.java
@@ -122,8 +122,8 @@ public class MasterClearTest {
verify(context).startActivity(intent.capture());
assertThat(intent.getValue().getBundleExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS)
- .getBoolean(MasterClear.ERASE_ESIMS_EXTRA, false))
- .isTrue();
+ .getBoolean(MasterClear.ERASE_ESIMS_EXTRA, false))
+ .isTrue();
}
@Test
@@ -139,8 +139,8 @@ public class MasterClearTest {
verify(context).startActivity(intent.capture());
assertThat(intent.getValue().getBundleExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS)
- .getBoolean(MasterClear.ERASE_ESIMS_EXTRA, false))
- .isFalse();
+ .getBoolean(MasterClear.ERASE_ESIMS_EXTRA, false))
+ .isFalse();
}
@Test
@@ -210,11 +210,10 @@ public class MasterClearTest {
ShadowUtils.setIsDemoUser(true);
final ComponentName componentName =
- ComponentName.unflattenFromString("com.android.retaildemo/.DeviceAdminReceiver");
+ ComponentName.unflattenFromString("com.android.retaildemo/.DeviceAdminReceiver");
ShadowUtils.setDeviceOwnerComponent(componentName);
- mMasterClear.mInitiateListener
- .onClick(mContentView.findViewById(R.id.initiate_master_clear));
+ mMasterClear.mInitiateListener.onClick(mContentView);
final Intent intent = mShadowActivity.getNextStartedActivity();
assertThat(Intent.ACTION_FACTORY_RESET).isEqualTo(intent.getAction());
assertThat(componentName).isNotNull();
@@ -240,7 +239,8 @@ public class MasterClearTest {
doNothing().when(mMasterClear).establishInitialState();
mMasterClear
- .onActivityResultInternal(MasterClear.KEYGUARD_REQUEST, Activity.RESULT_CANCELED, null);
+ .onActivityResultInternal(MasterClear.KEYGUARD_REQUEST, Activity.RESULT_CANCELED,
+ null);
verify(mMasterClear, times(1)).isValidRequestCode(eq(MasterClear.KEYGUARD_REQUEST));
verify(mMasterClear, times(1)).establishInitialState();
@@ -255,7 +255,7 @@ public class MasterClearTest {
doNothing().when(mMasterClear).showAccountCredentialConfirmation(eq(mMockIntent));
mMasterClear
- .onActivityResultInternal(MasterClear.KEYGUARD_REQUEST, Activity.RESULT_OK, null);
+ .onActivityResultInternal(MasterClear.KEYGUARD_REQUEST, Activity.RESULT_OK, null);
verify(mMasterClear, times(1)).isValidRequestCode(eq(MasterClear.KEYGUARD_REQUEST));
verify(mMasterClear, times(0)).establishInitialState();
@@ -270,7 +270,7 @@ public class MasterClearTest {
doNothing().when(mMasterClear).showFinalConfirmation();
mMasterClear
- .onActivityResultInternal(MasterClear.KEYGUARD_REQUEST, Activity.RESULT_OK, null);
+ .onActivityResultInternal(MasterClear.KEYGUARD_REQUEST, Activity.RESULT_OK, null);
verify(mMasterClear, times(1)).isValidRequestCode(eq(MasterClear.KEYGUARD_REQUEST));
verify(mMasterClear, times(0)).establishInitialState();
@@ -281,14 +281,14 @@ public class MasterClearTest {
@Test
public void testOnActivityResultInternal_confirmRequestTriggeringShowFinal() {
doReturn(true).when(mMasterClear)
- .isValidRequestCode(eq(MasterClear.CREDENTIAL_CONFIRM_REQUEST));
+ .isValidRequestCode(eq(MasterClear.CREDENTIAL_CONFIRM_REQUEST));
doNothing().when(mMasterClear).showFinalConfirmation();
mMasterClear.onActivityResultInternal(
- MasterClear.CREDENTIAL_CONFIRM_REQUEST, Activity.RESULT_OK, null);
+ MasterClear.CREDENTIAL_CONFIRM_REQUEST, Activity.RESULT_OK, null);
verify(mMasterClear, times(1))
- .isValidRequestCode(eq(MasterClear.CREDENTIAL_CONFIRM_REQUEST));
+ .isValidRequestCode(eq(MasterClear.CREDENTIAL_CONFIRM_REQUEST));
verify(mMasterClear, times(0)).establishInitialState();
verify(mMasterClear, times(0)).getAccountConfirmationIntent();
verify(mMasterClear, times(1)).showFinalConfirmation();
@@ -306,9 +306,9 @@ public class MasterClearTest {
when(mMasterClear.getActivity()).thenReturn(mMockActivity);
when(mMockActivity.getString(R.string.account_type)).thenReturn(TEST_ACCOUNT_TYPE);
when(mMockActivity.getString(R.string.account_confirmation_package))
- .thenReturn(TEST_CONFIRMATION_PACKAGE);
+ .thenReturn(TEST_CONFIRMATION_PACKAGE);
when(mMockActivity.getString(R.string.account_confirmation_class))
- .thenReturn(TEST_CONFIRMATION_CLASS);
+ .thenReturn(TEST_CONFIRMATION_CLASS);
Account[] accounts = new Account[0];
when(mMockActivity.getSystemService(Context.ACCOUNT_SERVICE)).thenReturn(mAccountManager);
@@ -321,10 +321,10 @@ public class MasterClearTest {
when(mMasterClear.getActivity()).thenReturn(mMockActivity);
when(mMockActivity.getString(R.string.account_type)).thenReturn(TEST_ACCOUNT_TYPE);
when(mMockActivity.getString(R.string.account_confirmation_package))
- .thenReturn(TEST_CONFIRMATION_PACKAGE);
+ .thenReturn(TEST_CONFIRMATION_PACKAGE);
when(mMockActivity.getString(R.string.account_confirmation_class))
- .thenReturn(TEST_CONFIRMATION_CLASS);
- Account[] accounts = new Account[] { new Account(TEST_ACCOUNT_NAME, TEST_ACCOUNT_TYPE) };
+ .thenReturn(TEST_CONFIRMATION_CLASS);
+ Account[] accounts = new Account[]{new Account(TEST_ACCOUNT_NAME, TEST_ACCOUNT_TYPE)};
when(mMockActivity.getSystemService(Context.ACCOUNT_SERVICE)).thenReturn(mAccountManager);
when(mAccountManager.getAccountsByType(TEST_ACCOUNT_TYPE)).thenReturn(accounts);
// The package manager should not resolve the confirmation intent targeting the non-existent
@@ -339,11 +339,11 @@ public class MasterClearTest {
// Only try to show account confirmation if the appropriate resource overlays are available.
when(mMockActivity.getString(R.string.account_type)).thenReturn(TEST_ACCOUNT_TYPE);
when(mMockActivity.getString(R.string.account_confirmation_package))
- .thenReturn(TEST_CONFIRMATION_PACKAGE);
+ .thenReturn(TEST_CONFIRMATION_PACKAGE);
when(mMockActivity.getString(R.string.account_confirmation_class))
- .thenReturn(TEST_CONFIRMATION_CLASS);
+ .thenReturn(TEST_CONFIRMATION_CLASS);
// Add accounts to trigger the search for a resolving intent.
- Account[] accounts = new Account[] { new Account(TEST_ACCOUNT_NAME, TEST_ACCOUNT_TYPE) };
+ Account[] accounts = new Account[]{new Account(TEST_ACCOUNT_NAME, TEST_ACCOUNT_TYPE)};
when(mMockActivity.getSystemService(Context.ACCOUNT_SERVICE)).thenReturn(mAccountManager);
when(mAccountManager.getAccountsByType(TEST_ACCOUNT_TYPE)).thenReturn(accounts);
// The package manager should not resolve the confirmation intent targeting the non-existent
@@ -366,17 +366,19 @@ public class MasterClearTest {
public void testShowAccountCredentialConfirmation() {
// Finally mock out the startActivityForResultCall
doNothing().when(mMasterClear)
- .startActivityForResult(eq(mMockIntent), eq(MasterClear.CREDENTIAL_CONFIRM_REQUEST));
+ .startActivityForResult(eq(mMockIntent),
+ eq(MasterClear.CREDENTIAL_CONFIRM_REQUEST));
mMasterClear.showAccountCredentialConfirmation(mMockIntent);
verify(mMasterClear, times(1))
- .startActivityForResult(eq(mMockIntent), eq(MasterClear.CREDENTIAL_CONFIRM_REQUEST));
+ .startActivityForResult(eq(mMockIntent),
+ eq(MasterClear.CREDENTIAL_CONFIRM_REQUEST));
}
@Test
public void testIsValidRequestCode() {
assertThat(mMasterClear.isValidRequestCode(MasterClear.KEYGUARD_REQUEST)).isTrue();
assertThat(mMasterClear.isValidRequestCode(MasterClear.CREDENTIAL_CONFIRM_REQUEST))
- .isTrue();
+ .isTrue();
assertThat(mMasterClear.isValidRequestCode(0)).isFalse();
}