blob: 77c6091a56552735cd55dc40e912898cf7b4e53c [file] [log] [blame]
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.settings;
18
Maurice Lam2eb170c2017-04-28 16:18:47 -070019import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
20
Joe Onoratob51886d2010-11-08 18:25:51 -080021import android.accounts.Account;
22import android.accounts.AccountManager;
23import android.accounts.AuthenticatorDescription;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080024import android.app.Activity;
Christine Franksd7713c92017-01-20 11:24:14 -080025import android.app.FragmentManager;
Joe Onoratob51886d2010-11-08 18:25:51 -080026import android.content.Context;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080027import android.content.Intent;
Joe Onoratob51886d2010-11-08 18:25:51 -080028import android.content.pm.PackageManager;
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +010029import android.content.pm.UserInfo;
Amith Yamasanib14e1e02010-11-02 09:52:29 -070030import android.content.res.Resources;
Joe Onoratob51886d2010-11-08 18:25:51 -080031import android.graphics.drawable.Drawable;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080032import android.os.Bundle;
Kenny Root3785e392011-01-18 15:14:32 -080033import android.os.Environment;
Ben Komalo2a321922011-09-07 16:42:34 -070034import android.os.SystemProperties;
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +010035import android.os.UserHandle;
Amith Yamasani7eedcf42013-07-02 14:15:29 -070036import android.os.UserManager;
jackqdyulei0b3edc72016-12-13 17:07:08 -080037import android.support.annotation.VisibleForTesting;
qingxi072f2862017-04-11 18:28:40 -070038import android.telephony.euicc.EuiccManager;
Joe Onoratob51886d2010-11-08 18:25:51 -080039import android.util.Log;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080040import android.view.LayoutInflater;
41import android.view.View;
jackqdyulei0b3edc72016-12-13 17:07:08 -080042import android.view.View.OnScrollChangeListener;
Amith Yamasanib14e1e02010-11-02 09:52:29 -070043import android.view.ViewGroup;
jackqdyulei0b3edc72016-12-13 17:07:08 -080044import android.view.ViewTreeObserver.OnGlobalLayoutListener;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080045import android.widget.Button;
Dianne Hackborn1337d0f2010-10-14 11:58:30 -070046import android.widget.CheckBox;
Fan Zhang6b2bb392016-09-28 09:07:44 -070047import android.widget.ImageView;
Joe Onoratob51886d2010-11-08 18:25:51 -080048import android.widget.LinearLayout;
jackqdyulei0b3edc72016-12-13 17:07:08 -080049import android.widget.ScrollView;
Joe Onoratob51886d2010-11-08 18:25:51 -080050import android.widget.TextView;
Jason Monk39b46742015-09-10 15:52:51 -040051
Tamas Berghammer265d3c22016-06-22 15:34:45 +010052import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
Maurice Lam2eb170c2017-04-28 16:18:47 -070053import com.android.settings.password.ChooseLockSettingsHelper;
54import com.android.settings.password.ConfirmLockPattern;
Christine Franksd7713c92017-01-20 11:24:14 -080055import com.android.settings.widget.CarrierDemoPasswordDialogFragment;
Sudheer Shanka7dbbe132016-02-16 14:19:32 +000056import com.android.settingslib.RestrictedLockUtils;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080057
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +010058import java.util.List;
59
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080060/**
61 * Confirm and execute a reset of the device to a clean "just out of the box"
62 * state. Multiple confirmations are required: first, a general "are you sure
63 * you want to do this?" prompt, followed by a keyguard pattern trace if the user
64 * has defined one, followed by a final strongly-worded "THIS WILL ERASE EVERYTHING
65 * ON THE PHONE" prompt. If at any time the phone is allowed to go to sleep, is
66 * locked, et cetera, then the confirmation sequence is abandoned.
Amith Yamasanib14e1e02010-11-02 09:52:29 -070067 *
68 * This is the initial screen.
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080069 */
Christine Franksd7713c92017-01-20 11:24:14 -080070public class MasterClear extends OptionsMenuFragment
71 implements CarrierDemoPasswordDialogFragment.Callback {
Joe Onoratob51886d2010-11-08 18:25:51 -080072 private static final String TAG = "MasterClear";
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080073
74 private static final int KEYGUARD_REQUEST = 55;
75
Amith Yamasanib14e1e02010-11-02 09:52:29 -070076 static final String ERASE_EXTERNAL_EXTRA = "erase_sd";
qingxi072f2862017-04-11 18:28:40 -070077 static final String ERASE_ESIMS_EXTRA = "erase_esim";
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080078
Amith Yamasanib14e1e02010-11-02 09:52:29 -070079 private View mContentView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080080 private Button mInitiateButton;
Dianne Hackborn1337d0f2010-10-14 11:58:30 -070081 private View mExternalStorageContainer;
qingxi072f2862017-04-11 18:28:40 -070082 @VisibleForTesting CheckBox mExternalStorage;
83 private View mEsimStorageContainer;
84 @VisibleForTesting CheckBox mEsimStorage;
jackqdyulei0b3edc72016-12-13 17:07:08 -080085 private ScrollView mScrollView;
86
87 private final OnGlobalLayoutListener mOnGlobalLayoutListener = new OnGlobalLayoutListener() {
88 @Override
89 public void onGlobalLayout() {
90 mScrollView.getViewTreeObserver().removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
91 mInitiateButton.setEnabled(hasReachedBottom(mScrollView));
92 }
93 };
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080094
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080095 /**
Jim Miller2deec7e2010-04-13 17:43:36 -070096 * Keyguard validation is run using the standard {@link ConfirmLockPattern}
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080097 * component as a subactivity
Jim Miller2deec7e2010-04-13 17:43:36 -070098 * @param request the request code to be returned once confirmation finishes
99 * @return true if confirmation launched
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800100 */
Jim Miller2deec7e2010-04-13 17:43:36 -0700101 private boolean runKeyguardConfirmation(int request) {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700102 Resources res = getActivity().getResources();
Jorim Jaggi8a09b612015-04-06 17:47:18 -0700103 return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(
104 request, res.getText(R.string.master_clear_title));
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800105 }
106
107 @Override
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700108 public void onActivityResult(int requestCode, int resultCode, Intent data) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800109 super.onActivityResult(requestCode, resultCode, data);
110
Julia Reynolds2c539332014-06-11 12:56:02 -0400111 if (requestCode != KEYGUARD_REQUEST) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800112 return;
113 }
114
115 // If the user entered a valid keyguard trace, present the final
116 // confirmation prompt; otherwise, go back to the initial state.
117 if (resultCode == Activity.RESULT_OK) {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700118 showFinalConfirmation();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800119 } else {
120 establishInitialState();
121 }
122 }
123
qingxi072f2862017-04-11 18:28:40 -0700124 @VisibleForTesting
125 void showFinalConfirmation() {
Stuart Scottbe903412014-07-24 19:22:06 -0700126 Bundle args = new Bundle();
127 args.putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked());
qingxi072f2862017-04-11 18:28:40 -0700128 args.putBoolean(ERASE_ESIMS_EXTRA, mEsimStorage.isChecked());
Fan Zhangc6ca3142017-02-14 15:02:35 -0800129 ((SettingsActivity) getActivity()).startPreferencePanel(
130 this, MasterClearConfirm.class.getName(),
Stuart Scottbe903412014-07-24 19:22:06 -0700131 args, R.string.master_clear_confirm_title, null, null, 0);
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700132 }
133
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800134 /**
135 * If the user clicks to begin the reset sequence, we next require a
136 * keyguard confirmation if the user has currently enabled one. If there
137 * is no keyguard available, we simply go to the final confirmation prompt.
138 */
Ben Komalo2a321922011-09-07 16:42:34 -0700139 private final Button.OnClickListener mInitiateListener = new Button.OnClickListener() {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700140
141 public void onClick(View v) {
Christine Franksd7713c92017-01-20 11:24:14 -0800142 if ( Utils.isCarrierDemoUser(v.getContext())) {
143 // Require the carrier password before displaying the final confirmation.
144 final FragmentManager fm = getChildFragmentManager();
145 if (fm != null && !fm.isDestroyed()) {
146 new CarrierDemoPasswordDialogFragment().show(fm, null /* tag */);
147 }
148 } else if (!runKeyguardConfirmation(KEYGUARD_REQUEST)) {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700149 showFinalConfirmation();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800150 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800151 }
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700152 };
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800153
Christine Franksd7713c92017-01-20 11:24:14 -0800154 @Override
155 public void onPasswordVerified() {
156 showFinalConfirmation();
157 }
158
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800159 /**
160 * In its initial state, the activity presents a button for the user to
161 * click in order to initiate a confirmation sequence. This method is
162 * called from various other points in the code to reset the activity to
163 * this base state.
Jim Miller47d380f2010-01-20 13:37:14 -0800164 *
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800165 * <p>Reinflating views from resources is expensive and prevents us from
166 * caching widget pointers, so we use a single-inflate pattern: we lazy-
167 * inflate each view, caching all of the widget pointers we'll need at the
168 * time, then simply reuse the inflated views directly whenever we need
169 * to change contents.
170 */
171 private void establishInitialState() {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700172 mInitiateButton = (Button) mContentView.findViewById(R.id.initiate_master_clear);
173 mInitiateButton.setOnClickListener(mInitiateListener);
174 mExternalStorageContainer = mContentView.findViewById(R.id.erase_external_container);
175 mExternalStorage = (CheckBox) mContentView.findViewById(R.id.erase_external);
qingxi072f2862017-04-11 18:28:40 -0700176 mEsimStorageContainer = mContentView.findViewById(R.id.erase_esim_container);
177 mEsimStorage = (CheckBox) mContentView.findViewById(R.id.erase_esim);
jackqdyulei0b3edc72016-12-13 17:07:08 -0800178 mScrollView = (ScrollView) mContentView.findViewById(R.id.master_clear_scrollview);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800179
Kenny Root3785e392011-01-18 15:14:32 -0800180 /*
181 * If the external storage is emulated, it will be erased with a factory
182 * reset at any rate. There is no need to have a separate option until
183 * we have a factory reset that only erases some directories and not
Ben Komalo2a321922011-09-07 16:42:34 -0700184 * others. Likewise, if it's non-removable storage, it could potentially have been
185 * encrypted, and will also need to be wiped.
Kenny Root3785e392011-01-18 15:14:32 -0800186 */
Ben Komalo2a321922011-09-07 16:42:34 -0700187 boolean isExtStorageEmulated = Environment.isExternalStorageEmulated();
188 if (isExtStorageEmulated
189 || (!Environment.isExternalStorageRemovable() && isExtStorageEncrypted())) {
Kenny Root3785e392011-01-18 15:14:32 -0800190 mExternalStorageContainer.setVisibility(View.GONE);
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700191
Kenny Root3785e392011-01-18 15:14:32 -0800192 final View externalOption = mContentView.findViewById(R.id.erase_external_option_text);
193 externalOption.setVisibility(View.GONE);
194
195 final View externalAlsoErased = mContentView.findViewById(R.id.also_erases_external);
196 externalAlsoErased.setVisibility(View.VISIBLE);
Ben Komalo2a321922011-09-07 16:42:34 -0700197
198 // If it's not emulated, it is on a separate partition but it means we're doing
199 // a force wipe due to encryption.
200 mExternalStorage.setChecked(!isExtStorageEmulated);
Kenny Root3785e392011-01-18 15:14:32 -0800201 } else {
202 mExternalStorageContainer.setOnClickListener(new View.OnClickListener() {
203
204 @Override
205 public void onClick(View v) {
206 mExternalStorage.toggle();
207 }
208 });
209 }
Joe Onoratob51886d2010-11-08 18:25:51 -0800210
qingxi072f2862017-04-11 18:28:40 -0700211 EuiccManager euiccManager =
212 (EuiccManager) getActivity().getSystemService(Context.EUICC_SERVICE);
213 if (euiccManager.isEnabled()) {
214 mEsimStorageContainer.setOnClickListener(new View.OnClickListener() {
215
216 @Override
217 public void onClick(View v) {
218 mEsimStorage.toggle();
219 }
220 });
221 } else {
222 mEsimStorageContainer.setVisibility(View.GONE);
223 }
224
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100225 final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
226 loadAccountList(um);
Julia Reynoldsce25af42015-07-08 16:56:31 -0400227 StringBuffer contentDescription = new StringBuffer();
228 View masterClearContainer = mContentView.findViewById(R.id.master_clear_container);
229 getContentDescription(masterClearContainer, contentDescription);
230 masterClearContainer.setContentDescription(contentDescription);
jackqdyulei0b3edc72016-12-13 17:07:08 -0800231
232 // Set the status of initiateButton based on scrollview
233 mScrollView.setOnScrollChangeListener(new OnScrollChangeListener() {
234 @Override
235 public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX,
236 int oldScrollY) {
237 if (v instanceof ScrollView && hasReachedBottom((ScrollView) v)) {
238 mInitiateButton.setEnabled(true);
239 }
240 }
241 });
242
243 // Set the initial state of the initiateButton
244 mScrollView.getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
245 }
246
247 @VisibleForTesting
248 boolean hasReachedBottom(final ScrollView scrollView) {
249 if (scrollView.getChildCount() < 1) {
250 return true;
251 }
252
253 final View view = scrollView.getChildAt(0);
254 final int diff = view.getBottom() - (scrollView.getHeight() + scrollView.getScrollY());
255
256 return diff <= 0;
Julia Reynoldsce25af42015-07-08 16:56:31 -0400257 }
258
259 private void getContentDescription(View v, StringBuffer description) {
Jason Monkfda77412016-05-06 14:28:09 -0400260 if (v.getVisibility() != View.VISIBLE) {
261 return;
262 }
Julia Reynoldsce25af42015-07-08 16:56:31 -0400263 if (v instanceof ViewGroup) {
264 ViewGroup vGroup = (ViewGroup) v;
265 for (int i = 0; i < vGroup.getChildCount(); i++) {
266 View nextChild = vGroup.getChildAt(i);
267 getContentDescription(nextChild, description);
268 }
269 } else if (v instanceof TextView) {
270 TextView vText = (TextView) v;
271 description.append(vText.getText());
272 description.append(","); // Allow Talkback to pause between sections.
273 }
Joe Onoratob51886d2010-11-08 18:25:51 -0800274 }
275
Ben Komalo2a321922011-09-07 16:42:34 -0700276 private boolean isExtStorageEncrypted() {
277 String state = SystemProperties.get("vold.decrypt");
278 return !"".equals(state);
279 }
280
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100281 private void loadAccountList(final UserManager um) {
Joe Onoratob51886d2010-11-08 18:25:51 -0800282 View accountsLabel = mContentView.findViewById(R.id.accounts_label);
283 LinearLayout contents = (LinearLayout)mContentView.findViewById(R.id.accounts);
Amith Yamasani3f45de52011-09-22 14:34:17 -0700284 contents.removeAllViews();
Joe Onoratob51886d2010-11-08 18:25:51 -0800285
286 Context context = getActivity();
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100287 final List<UserInfo> profiles = um.getProfiles(UserHandle.myUserId());
288 final int profilesSize = profiles.size();
Joe Onoratob51886d2010-11-08 18:25:51 -0800289
290 AccountManager mgr = AccountManager.get(context);
Joe Onoratob51886d2010-11-08 18:25:51 -0800291
292 LayoutInflater inflater = (LayoutInflater)context.getSystemService(
293 Context.LAYOUT_INFLATER_SERVICE);
294
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100295 int accountsCount = 0;
296 for (int profileIndex = 0; profileIndex < profilesSize; profileIndex++) {
297 final UserInfo userInfo = profiles.get(profileIndex);
298 final int profileId = userInfo.id;
299 final UserHandle userHandle = new UserHandle(profileId);
300 Account[] accounts = mgr.getAccountsAsUser(profileId);
301 final int N = accounts.length;
302 if (N == 0) {
Joe Onoratob51886d2010-11-08 18:25:51 -0800303 continue;
304 }
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100305 accountsCount += N;
Joe Onoratob51886d2010-11-08 18:25:51 -0800306
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100307 AuthenticatorDescription[] descs = AccountManager.get(context)
308 .getAuthenticatorTypesAsUser(profileId);
309 final int M = descs.length;
310
Bartosz Fabianowski30ba8682017-04-19 11:51:43 +0200311 if (profilesSize > 1) {
312 View titleView = Utils.inflateCategoryHeader(inflater, contents);
313 final TextView titleText = (TextView) titleView.findViewById(android.R.id.title);
314 titleText.setText(userInfo.isManagedProfile() ? R.string.category_work
315 : R.string.category_personal);
316 contents.addView(titleView);
317 }
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100318
319 for (int i = 0; i < N; i++) {
320 Account account = accounts[i];
321 AuthenticatorDescription desc = null;
322 for (int j = 0; j < M; j++) {
323 if (account.type.equals(descs[j].type)) {
324 desc = descs[j];
325 break;
326 }
327 }
328 if (desc == null) {
329 Log.w(TAG, "No descriptor for account name=" + account.name
330 + " type=" + account.type);
331 continue;
332 }
333 Drawable icon = null;
334 try {
335 if (desc.iconId != 0) {
Zoltan Szatmary-Ban546790c2014-12-02 17:22:10 +0000336 Context authContext = context.createPackageContextAsUser(desc.packageName,
337 0, userHandle);
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100338 icon = context.getPackageManager().getUserBadgedIcon(
339 authContext.getDrawable(desc.iconId), userHandle);
340 }
341 } catch (PackageManager.NameNotFoundException e) {
Rubin Xud1ce82a2015-06-08 17:21:19 +0100342 Log.w(TAG, "Bad package name for account type " + desc.type);
343 } catch (Resources.NotFoundException e) {
344 Log.w(TAG, "Invalid icon id for account type " + desc.type, e);
345 }
346 if (icon == null) {
347 icon = context.getPackageManager().getDefaultActivityIcon();
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100348 }
349
Fan Zhang6b2bb392016-09-28 09:07:44 -0700350 View child = inflater.inflate(R.layout.master_clear_account, contents, false);
351 ((ImageView) child.findViewById(android.R.id.icon)).setImageDrawable(icon);
352 ((TextView) child.findViewById(android.R.id.title)).setText(account.name);
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100353 contents.addView(child);
Joe Onoratob51886d2010-11-08 18:25:51 -0800354 }
Joe Onoratob51886d2010-11-08 18:25:51 -0800355 }
356
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100357 if (accountsCount > 0) {
358 accountsLabel.setVisibility(View.VISIBLE);
359 contents.setVisibility(View.VISIBLE);
360 }
361 // Checking for all other users and their profiles if any.
362 View otherUsers = mContentView.findViewById(R.id.other_users_present);
363 final boolean hasOtherUsers = (um.getUserCount() - profilesSize) > 0;
364 otherUsers.setVisibility(hasOtherUsers ? View.VISIBLE : View.GONE);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800365 }
366
367 @Override
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700368 public View onCreateView(LayoutInflater inflater, ViewGroup container,
369 Bundle savedInstanceState) {
Christine Franks14782222017-01-23 16:44:02 -0800370 final Context context = getContext();
371 final EnforcedAdmin admin = RestrictedLockUtils.checkIfRestrictionEnforced(context,
372 UserManager.DISALLOW_FACTORY_RESET, UserHandle.myUserId());
373 final UserManager um = UserManager.get(context);
374 final boolean disallow = !um.isAdminUser() || RestrictedLockUtils.hasBaseUserRestriction(
375 context, UserManager.DISALLOW_FACTORY_RESET, UserHandle.myUserId());
376 if (disallow && !Utils.isCarrierDemoUser(context)) {
Julia Reynolds2c539332014-06-11 12:56:02 -0400377 return inflater.inflate(R.layout.master_clear_disallowed_screen, null);
Sudheer Shanka7dbbe132016-02-16 14:19:32 +0000378 } else if (admin != null) {
379 View view = inflater.inflate(R.layout.admin_support_details_empty_view, null);
380 ShowAdminSupportDetailsDialog.setAdminSupportDetails(getActivity(), view, admin, false);
381 view.setVisibility(View.VISIBLE);
382 return view;
Julia Reynolds2c539332014-06-11 12:56:02 -0400383 }
384
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700385 mContentView = inflater.inflate(R.layout.master_clear, null);
Joe Onoratob51886d2010-11-08 18:25:51 -0800386
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800387 establishInitialState();
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700388 return mContentView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800389 }
Chris Wren8a963ba2015-03-20 10:29:14 -0400390
391 @Override
Fan Zhang65076132016-08-08 10:25:13 -0700392 public int getMetricsCategory() {
Chris Wren9d1bfd12016-01-26 18:04:01 -0500393 return MetricsEvent.MASTER_CLEAR;
Chris Wren8a963ba2015-03-20 10:29:14 -0400394 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800395}