blob: ef4190b2ccf506470e3353e3718c2676bbedb724 [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
Joe Onoratob51886d2010-11-08 18:25:51 -080019import android.accounts.Account;
20import android.accounts.AccountManager;
21import android.accounts.AuthenticatorDescription;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080022import android.app.Activity;
Christine Franksd7713c92017-01-20 11:24:14 -080023import android.app.FragmentManager;
Joe Onoratob51886d2010-11-08 18:25:51 -080024import android.content.Context;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080025import android.content.Intent;
Joe Onoratob51886d2010-11-08 18:25:51 -080026import android.content.pm.PackageManager;
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +010027import android.content.pm.UserInfo;
Amith Yamasanib14e1e02010-11-02 09:52:29 -070028import android.content.res.Resources;
Joe Onoratob51886d2010-11-08 18:25:51 -080029import android.graphics.drawable.Drawable;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080030import android.os.Bundle;
Kenny Root3785e392011-01-18 15:14:32 -080031import android.os.Environment;
Ben Komalo2a321922011-09-07 16:42:34 -070032import android.os.SystemProperties;
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +010033import android.os.UserHandle;
Amith Yamasani7eedcf42013-07-02 14:15:29 -070034import android.os.UserManager;
jackqdyulei0b3edc72016-12-13 17:07:08 -080035import android.support.annotation.VisibleForTesting;
qingxi072f2862017-04-11 18:28:40 -070036import android.telephony.euicc.EuiccManager;
Joe Onoratob51886d2010-11-08 18:25:51 -080037import android.util.Log;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080038import android.view.LayoutInflater;
39import android.view.View;
jackqdyulei0b3edc72016-12-13 17:07:08 -080040import android.view.View.OnScrollChangeListener;
Amith Yamasanib14e1e02010-11-02 09:52:29 -070041import android.view.ViewGroup;
jackqdyulei0b3edc72016-12-13 17:07:08 -080042import android.view.ViewTreeObserver.OnGlobalLayoutListener;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080043import android.widget.Button;
Dianne Hackborn1337d0f2010-10-14 11:58:30 -070044import android.widget.CheckBox;
Fan Zhang6b2bb392016-09-28 09:07:44 -070045import android.widget.ImageView;
Joe Onoratob51886d2010-11-08 18:25:51 -080046import android.widget.LinearLayout;
jackqdyulei0b3edc72016-12-13 17:07:08 -080047import android.widget.ScrollView;
Joe Onoratob51886d2010-11-08 18:25:51 -080048import android.widget.TextView;
Jason Monk39b46742015-09-10 15:52:51 -040049
Tamas Berghammer265d3c22016-06-22 15:34:45 +010050import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
Christine Franksd7713c92017-01-20 11:24:14 -080051import com.android.settings.widget.CarrierDemoPasswordDialogFragment;
Sudheer Shanka7dbbe132016-02-16 14:19:32 +000052import com.android.settingslib.RestrictedLockUtils;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080053
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +010054import java.util.List;
55
Sudheer Shanka7dbbe132016-02-16 14:19:32 +000056import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
57
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080058/**
59 * Confirm and execute a reset of the device to a clean "just out of the box"
60 * state. Multiple confirmations are required: first, a general "are you sure
61 * you want to do this?" prompt, followed by a keyguard pattern trace if the user
62 * has defined one, followed by a final strongly-worded "THIS WILL ERASE EVERYTHING
63 * ON THE PHONE" prompt. If at any time the phone is allowed to go to sleep, is
64 * locked, et cetera, then the confirmation sequence is abandoned.
Amith Yamasanib14e1e02010-11-02 09:52:29 -070065 *
66 * This is the initial screen.
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080067 */
Christine Franksd7713c92017-01-20 11:24:14 -080068public class MasterClear extends OptionsMenuFragment
69 implements CarrierDemoPasswordDialogFragment.Callback {
Joe Onoratob51886d2010-11-08 18:25:51 -080070 private static final String TAG = "MasterClear";
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080071
72 private static final int KEYGUARD_REQUEST = 55;
73
Amith Yamasanib14e1e02010-11-02 09:52:29 -070074 static final String ERASE_EXTERNAL_EXTRA = "erase_sd";
qingxi072f2862017-04-11 18:28:40 -070075 static final String ERASE_ESIMS_EXTRA = "erase_esim";
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080076
Amith Yamasanib14e1e02010-11-02 09:52:29 -070077 private View mContentView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080078 private Button mInitiateButton;
Dianne Hackborn1337d0f2010-10-14 11:58:30 -070079 private View mExternalStorageContainer;
qingxi072f2862017-04-11 18:28:40 -070080 @VisibleForTesting CheckBox mExternalStorage;
81 private View mEsimStorageContainer;
82 @VisibleForTesting CheckBox mEsimStorage;
jackqdyulei0b3edc72016-12-13 17:07:08 -080083 private ScrollView mScrollView;
84
85 private final OnGlobalLayoutListener mOnGlobalLayoutListener = new OnGlobalLayoutListener() {
86 @Override
87 public void onGlobalLayout() {
88 mScrollView.getViewTreeObserver().removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
89 mInitiateButton.setEnabled(hasReachedBottom(mScrollView));
90 }
91 };
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080092
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080093 /**
Jim Miller2deec7e2010-04-13 17:43:36 -070094 * Keyguard validation is run using the standard {@link ConfirmLockPattern}
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080095 * component as a subactivity
Jim Miller2deec7e2010-04-13 17:43:36 -070096 * @param request the request code to be returned once confirmation finishes
97 * @return true if confirmation launched
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -080098 */
Jim Miller2deec7e2010-04-13 17:43:36 -070099 private boolean runKeyguardConfirmation(int request) {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700100 Resources res = getActivity().getResources();
Jorim Jaggi8a09b612015-04-06 17:47:18 -0700101 return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity(
102 request, res.getText(R.string.master_clear_title));
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800103 }
104
105 @Override
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700106 public void onActivityResult(int requestCode, int resultCode, Intent data) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800107 super.onActivityResult(requestCode, resultCode, data);
108
Julia Reynolds2c539332014-06-11 12:56:02 -0400109 if (requestCode != KEYGUARD_REQUEST) {
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800110 return;
111 }
112
113 // If the user entered a valid keyguard trace, present the final
114 // confirmation prompt; otherwise, go back to the initial state.
115 if (resultCode == Activity.RESULT_OK) {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700116 showFinalConfirmation();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800117 } else {
118 establishInitialState();
119 }
120 }
121
qingxi072f2862017-04-11 18:28:40 -0700122 @VisibleForTesting
123 void showFinalConfirmation() {
Stuart Scottbe903412014-07-24 19:22:06 -0700124 Bundle args = new Bundle();
125 args.putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked());
qingxi072f2862017-04-11 18:28:40 -0700126 args.putBoolean(ERASE_ESIMS_EXTRA, mEsimStorage.isChecked());
Fan Zhangc6ca3142017-02-14 15:02:35 -0800127 ((SettingsActivity) getActivity()).startPreferencePanel(
128 this, MasterClearConfirm.class.getName(),
Stuart Scottbe903412014-07-24 19:22:06 -0700129 args, R.string.master_clear_confirm_title, null, null, 0);
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700130 }
131
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800132 /**
133 * If the user clicks to begin the reset sequence, we next require a
134 * keyguard confirmation if the user has currently enabled one. If there
135 * is no keyguard available, we simply go to the final confirmation prompt.
136 */
Ben Komalo2a321922011-09-07 16:42:34 -0700137 private final Button.OnClickListener mInitiateListener = new Button.OnClickListener() {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700138
139 public void onClick(View v) {
Christine Franksd7713c92017-01-20 11:24:14 -0800140 if ( Utils.isCarrierDemoUser(v.getContext())) {
141 // Require the carrier password before displaying the final confirmation.
142 final FragmentManager fm = getChildFragmentManager();
143 if (fm != null && !fm.isDestroyed()) {
144 new CarrierDemoPasswordDialogFragment().show(fm, null /* tag */);
145 }
146 } else if (!runKeyguardConfirmation(KEYGUARD_REQUEST)) {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700147 showFinalConfirmation();
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800148 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800149 }
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700150 };
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800151
Christine Franksd7713c92017-01-20 11:24:14 -0800152 @Override
153 public void onPasswordVerified() {
154 showFinalConfirmation();
155 }
156
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800157 /**
158 * In its initial state, the activity presents a button for the user to
159 * click in order to initiate a confirmation sequence. This method is
160 * called from various other points in the code to reset the activity to
161 * this base state.
Jim Miller47d380f2010-01-20 13:37:14 -0800162 *
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800163 * <p>Reinflating views from resources is expensive and prevents us from
164 * caching widget pointers, so we use a single-inflate pattern: we lazy-
165 * inflate each view, caching all of the widget pointers we'll need at the
166 * time, then simply reuse the inflated views directly whenever we need
167 * to change contents.
168 */
169 private void establishInitialState() {
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700170 mInitiateButton = (Button) mContentView.findViewById(R.id.initiate_master_clear);
171 mInitiateButton.setOnClickListener(mInitiateListener);
172 mExternalStorageContainer = mContentView.findViewById(R.id.erase_external_container);
173 mExternalStorage = (CheckBox) mContentView.findViewById(R.id.erase_external);
qingxi072f2862017-04-11 18:28:40 -0700174 mEsimStorageContainer = mContentView.findViewById(R.id.erase_esim_container);
175 mEsimStorage = (CheckBox) mContentView.findViewById(R.id.erase_esim);
jackqdyulei0b3edc72016-12-13 17:07:08 -0800176 mScrollView = (ScrollView) mContentView.findViewById(R.id.master_clear_scrollview);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800177
Kenny Root3785e392011-01-18 15:14:32 -0800178 /*
179 * If the external storage is emulated, it will be erased with a factory
180 * reset at any rate. There is no need to have a separate option until
181 * we have a factory reset that only erases some directories and not
Ben Komalo2a321922011-09-07 16:42:34 -0700182 * others. Likewise, if it's non-removable storage, it could potentially have been
183 * encrypted, and will also need to be wiped.
Kenny Root3785e392011-01-18 15:14:32 -0800184 */
Ben Komalo2a321922011-09-07 16:42:34 -0700185 boolean isExtStorageEmulated = Environment.isExternalStorageEmulated();
186 if (isExtStorageEmulated
187 || (!Environment.isExternalStorageRemovable() && isExtStorageEncrypted())) {
Kenny Root3785e392011-01-18 15:14:32 -0800188 mExternalStorageContainer.setVisibility(View.GONE);
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700189
Kenny Root3785e392011-01-18 15:14:32 -0800190 final View externalOption = mContentView.findViewById(R.id.erase_external_option_text);
191 externalOption.setVisibility(View.GONE);
192
193 final View externalAlsoErased = mContentView.findViewById(R.id.also_erases_external);
194 externalAlsoErased.setVisibility(View.VISIBLE);
Ben Komalo2a321922011-09-07 16:42:34 -0700195
196 // If it's not emulated, it is on a separate partition but it means we're doing
197 // a force wipe due to encryption.
198 mExternalStorage.setChecked(!isExtStorageEmulated);
Kenny Root3785e392011-01-18 15:14:32 -0800199 } else {
200 mExternalStorageContainer.setOnClickListener(new View.OnClickListener() {
201
202 @Override
203 public void onClick(View v) {
204 mExternalStorage.toggle();
205 }
206 });
207 }
Joe Onoratob51886d2010-11-08 18:25:51 -0800208
qingxi072f2862017-04-11 18:28:40 -0700209 EuiccManager euiccManager =
210 (EuiccManager) getActivity().getSystemService(Context.EUICC_SERVICE);
211 if (euiccManager.isEnabled()) {
212 mEsimStorageContainer.setOnClickListener(new View.OnClickListener() {
213
214 @Override
215 public void onClick(View v) {
216 mEsimStorage.toggle();
217 }
218 });
219 } else {
220 mEsimStorageContainer.setVisibility(View.GONE);
221 }
222
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100223 final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE);
224 loadAccountList(um);
Julia Reynoldsce25af42015-07-08 16:56:31 -0400225 StringBuffer contentDescription = new StringBuffer();
226 View masterClearContainer = mContentView.findViewById(R.id.master_clear_container);
227 getContentDescription(masterClearContainer, contentDescription);
228 masterClearContainer.setContentDescription(contentDescription);
jackqdyulei0b3edc72016-12-13 17:07:08 -0800229
230 // Set the status of initiateButton based on scrollview
231 mScrollView.setOnScrollChangeListener(new OnScrollChangeListener() {
232 @Override
233 public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX,
234 int oldScrollY) {
235 if (v instanceof ScrollView && hasReachedBottom((ScrollView) v)) {
236 mInitiateButton.setEnabled(true);
237 }
238 }
239 });
240
241 // Set the initial state of the initiateButton
242 mScrollView.getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
243 }
244
245 @VisibleForTesting
246 boolean hasReachedBottom(final ScrollView scrollView) {
247 if (scrollView.getChildCount() < 1) {
248 return true;
249 }
250
251 final View view = scrollView.getChildAt(0);
252 final int diff = view.getBottom() - (scrollView.getHeight() + scrollView.getScrollY());
253
254 return diff <= 0;
Julia Reynoldsce25af42015-07-08 16:56:31 -0400255 }
256
257 private void getContentDescription(View v, StringBuffer description) {
Jason Monkfda77412016-05-06 14:28:09 -0400258 if (v.getVisibility() != View.VISIBLE) {
259 return;
260 }
Julia Reynoldsce25af42015-07-08 16:56:31 -0400261 if (v instanceof ViewGroup) {
262 ViewGroup vGroup = (ViewGroup) v;
263 for (int i = 0; i < vGroup.getChildCount(); i++) {
264 View nextChild = vGroup.getChildAt(i);
265 getContentDescription(nextChild, description);
266 }
267 } else if (v instanceof TextView) {
268 TextView vText = (TextView) v;
269 description.append(vText.getText());
270 description.append(","); // Allow Talkback to pause between sections.
271 }
Joe Onoratob51886d2010-11-08 18:25:51 -0800272 }
273
Ben Komalo2a321922011-09-07 16:42:34 -0700274 private boolean isExtStorageEncrypted() {
275 String state = SystemProperties.get("vold.decrypt");
276 return !"".equals(state);
277 }
278
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100279 private void loadAccountList(final UserManager um) {
Joe Onoratob51886d2010-11-08 18:25:51 -0800280 View accountsLabel = mContentView.findViewById(R.id.accounts_label);
281 LinearLayout contents = (LinearLayout)mContentView.findViewById(R.id.accounts);
Amith Yamasani3f45de52011-09-22 14:34:17 -0700282 contents.removeAllViews();
Joe Onoratob51886d2010-11-08 18:25:51 -0800283
284 Context context = getActivity();
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100285 final List<UserInfo> profiles = um.getProfiles(UserHandle.myUserId());
286 final int profilesSize = profiles.size();
Joe Onoratob51886d2010-11-08 18:25:51 -0800287
288 AccountManager mgr = AccountManager.get(context);
Joe Onoratob51886d2010-11-08 18:25:51 -0800289
290 LayoutInflater inflater = (LayoutInflater)context.getSystemService(
291 Context.LAYOUT_INFLATER_SERVICE);
292
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100293 int accountsCount = 0;
294 for (int profileIndex = 0; profileIndex < profilesSize; profileIndex++) {
295 final UserInfo userInfo = profiles.get(profileIndex);
296 final int profileId = userInfo.id;
297 final UserHandle userHandle = new UserHandle(profileId);
298 Account[] accounts = mgr.getAccountsAsUser(profileId);
299 final int N = accounts.length;
300 if (N == 0) {
Joe Onoratob51886d2010-11-08 18:25:51 -0800301 continue;
302 }
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100303 accountsCount += N;
Joe Onoratob51886d2010-11-08 18:25:51 -0800304
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100305 AuthenticatorDescription[] descs = AccountManager.get(context)
306 .getAuthenticatorTypesAsUser(profileId);
307 final int M = descs.length;
308
Bartosz Fabianowski30ba8682017-04-19 11:51:43 +0200309 if (profilesSize > 1) {
310 View titleView = Utils.inflateCategoryHeader(inflater, contents);
311 final TextView titleText = (TextView) titleView.findViewById(android.R.id.title);
312 titleText.setText(userInfo.isManagedProfile() ? R.string.category_work
313 : R.string.category_personal);
314 contents.addView(titleView);
315 }
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100316
317 for (int i = 0; i < N; i++) {
318 Account account = accounts[i];
319 AuthenticatorDescription desc = null;
320 for (int j = 0; j < M; j++) {
321 if (account.type.equals(descs[j].type)) {
322 desc = descs[j];
323 break;
324 }
325 }
326 if (desc == null) {
327 Log.w(TAG, "No descriptor for account name=" + account.name
328 + " type=" + account.type);
329 continue;
330 }
331 Drawable icon = null;
332 try {
333 if (desc.iconId != 0) {
Zoltan Szatmary-Ban546790c2014-12-02 17:22:10 +0000334 Context authContext = context.createPackageContextAsUser(desc.packageName,
335 0, userHandle);
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100336 icon = context.getPackageManager().getUserBadgedIcon(
337 authContext.getDrawable(desc.iconId), userHandle);
338 }
339 } catch (PackageManager.NameNotFoundException e) {
Rubin Xud1ce82a2015-06-08 17:21:19 +0100340 Log.w(TAG, "Bad package name for account type " + desc.type);
341 } catch (Resources.NotFoundException e) {
342 Log.w(TAG, "Invalid icon id for account type " + desc.type, e);
343 }
344 if (icon == null) {
345 icon = context.getPackageManager().getDefaultActivityIcon();
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100346 }
347
Fan Zhang6b2bb392016-09-28 09:07:44 -0700348 View child = inflater.inflate(R.layout.master_clear_account, contents, false);
349 ((ImageView) child.findViewById(android.R.id.icon)).setImageDrawable(icon);
350 ((TextView) child.findViewById(android.R.id.title)).setText(account.name);
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100351 contents.addView(child);
Joe Onoratob51886d2010-11-08 18:25:51 -0800352 }
Joe Onoratob51886d2010-11-08 18:25:51 -0800353 }
354
Zoltan Szatmary-Ban7cc1b9e2014-10-24 18:03:18 +0100355 if (accountsCount > 0) {
356 accountsLabel.setVisibility(View.VISIBLE);
357 contents.setVisibility(View.VISIBLE);
358 }
359 // Checking for all other users and their profiles if any.
360 View otherUsers = mContentView.findViewById(R.id.other_users_present);
361 final boolean hasOtherUsers = (um.getUserCount() - profilesSize) > 0;
362 otherUsers.setVisibility(hasOtherUsers ? View.VISIBLE : View.GONE);
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800363 }
364
365 @Override
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700366 public View onCreateView(LayoutInflater inflater, ViewGroup container,
367 Bundle savedInstanceState) {
Christine Franks14782222017-01-23 16:44:02 -0800368 final Context context = getContext();
369 final EnforcedAdmin admin = RestrictedLockUtils.checkIfRestrictionEnforced(context,
370 UserManager.DISALLOW_FACTORY_RESET, UserHandle.myUserId());
371 final UserManager um = UserManager.get(context);
372 final boolean disallow = !um.isAdminUser() || RestrictedLockUtils.hasBaseUserRestriction(
373 context, UserManager.DISALLOW_FACTORY_RESET, UserHandle.myUserId());
374 if (disallow && !Utils.isCarrierDemoUser(context)) {
Julia Reynolds2c539332014-06-11 12:56:02 -0400375 return inflater.inflate(R.layout.master_clear_disallowed_screen, null);
Sudheer Shanka7dbbe132016-02-16 14:19:32 +0000376 } else if (admin != null) {
377 View view = inflater.inflate(R.layout.admin_support_details_empty_view, null);
378 ShowAdminSupportDetailsDialog.setAdminSupportDetails(getActivity(), view, admin, false);
379 view.setVisibility(View.VISIBLE);
380 return view;
Julia Reynolds2c539332014-06-11 12:56:02 -0400381 }
382
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700383 mContentView = inflater.inflate(R.layout.master_clear, null);
Joe Onoratob51886d2010-11-08 18:25:51 -0800384
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800385 establishInitialState();
Amith Yamasanib14e1e02010-11-02 09:52:29 -0700386 return mContentView;
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800387 }
Chris Wren8a963ba2015-03-20 10:29:14 -0400388
389 @Override
Fan Zhang65076132016-08-08 10:25:13 -0700390 public int getMetricsCategory() {
Chris Wren9d1bfd12016-01-26 18:04:01 -0500391 return MetricsEvent.MASTER_CLEAR;
Chris Wren8a963ba2015-03-20 10:29:14 -0400392 }
The Android Open Source Projectafc4ab22009-03-03 19:32:34 -0800393}