The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package com.android.settings; |
| 18 | |
Maurice Lam | 2eb170c | 2017-04-28 16:18:47 -0700 | [diff] [blame] | 19 | import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin; |
| 20 | |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 21 | import android.accounts.Account; |
| 22 | import android.accounts.AccountManager; |
| 23 | import android.accounts.AuthenticatorDescription; |
Doris Ling | ed4685f | 2017-10-25 14:08:57 -0700 | [diff] [blame] | 24 | import android.annotation.Nullable; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 25 | import android.app.Activity; |
Christine Franks | a09eb38 | 2017-06-23 14:28:21 -0700 | [diff] [blame] | 26 | import android.content.ComponentName; |
Jeff Davidson | f1c13fa | 2017-05-19 17:03:32 -0700 | [diff] [blame] | 27 | import android.content.ContentResolver; |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 28 | import android.content.Context; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 29 | import android.content.Intent; |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 30 | import android.content.pm.PackageManager; |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 31 | import android.content.pm.ResolveInfo; |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 32 | import android.content.pm.UserInfo; |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 33 | import android.content.res.Resources; |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 34 | import android.graphics.drawable.Drawable; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 35 | import android.os.Bundle; |
Kenny Root | 3785e39 | 2011-01-18 15:14:32 -0800 | [diff] [blame] | 36 | import android.os.Environment; |
Ben Komalo | 2a32192 | 2011-09-07 16:42:34 -0700 | [diff] [blame] | 37 | import android.os.SystemProperties; |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 38 | import android.os.UserHandle; |
Amith Yamasani | 7eedcf4 | 2013-07-02 14:15:29 -0700 | [diff] [blame] | 39 | import android.os.UserManager; |
Jeff Davidson | f1c13fa | 2017-05-19 17:03:32 -0700 | [diff] [blame] | 40 | import android.provider.Settings; |
qingxi | 072f286 | 2017-04-11 18:28:40 -0700 | [diff] [blame] | 41 | import android.telephony.euicc.EuiccManager; |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 42 | import android.text.TextUtils; |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 43 | import android.util.Log; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 44 | import android.view.LayoutInflater; |
| 45 | import android.view.View; |
jackqdyulei | 0b3edc7 | 2016-12-13 17:07:08 -0800 | [diff] [blame] | 46 | import android.view.View.OnScrollChangeListener; |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 47 | import android.view.ViewGroup; |
jackqdyulei | 0b3edc7 | 2016-12-13 17:07:08 -0800 | [diff] [blame] | 48 | import android.view.ViewTreeObserver.OnGlobalLayoutListener; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 49 | import android.widget.Button; |
Dianne Hackborn | 1337d0f | 2010-10-14 11:58:30 -0700 | [diff] [blame] | 50 | import android.widget.CheckBox; |
Fan Zhang | 6b2bb39 | 2016-09-28 09:07:44 -0700 | [diff] [blame] | 51 | import android.widget.ImageView; |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 52 | import android.widget.LinearLayout; |
jackqdyulei | 0b3edc7 | 2016-12-13 17:07:08 -0800 | [diff] [blame] | 53 | import android.widget.ScrollView; |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 54 | import android.widget.TextView; |
Jason Monk | 39b4674 | 2015-09-10 15:52:51 -0400 | [diff] [blame] | 55 | |
Fan Zhang | 23f8d59 | 2018-08-28 15:11:40 -0700 | [diff] [blame] | 56 | import androidx.annotation.VisibleForTesting; |
| 57 | |
Tamas Berghammer | 265d3c2 | 2016-06-22 15:34:45 +0100 | [diff] [blame] | 58 | import com.android.internal.logging.nano.MetricsProto.MetricsEvent; |
Doris Ling | 7248972 | 2017-11-16 11:03:40 -0800 | [diff] [blame] | 59 | import com.android.settings.core.InstrumentedFragment; |
Fan Zhang | 7cf99f5 | 2018-02-16 10:37:37 -0800 | [diff] [blame] | 60 | import com.android.settings.core.SubSettingLauncher; |
arangelov | e35badd | 2017-10-27 13:51:28 +0100 | [diff] [blame] | 61 | import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper; |
Maurice Lam | 2eb170c | 2017-04-28 16:18:47 -0700 | [diff] [blame] | 62 | import com.android.settings.password.ChooseLockSettingsHelper; |
| 63 | import com.android.settings.password.ConfirmLockPattern; |
Sudheer Shanka | 7dbbe13 | 2016-02-16 14:19:32 +0000 | [diff] [blame] | 64 | import com.android.settingslib.RestrictedLockUtils; |
Philip P. Moltmann | e3f7211 | 2018-08-28 15:01:43 -0700 | [diff] [blame^] | 65 | import com.android.settingslib.RestrictedLockUtilsInternal; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 66 | |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 67 | import java.util.List; |
| 68 | |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 69 | /** |
| 70 | * Confirm and execute a reset of the device to a clean "just out of the box" |
| 71 | * state. Multiple confirmations are required: first, a general "are you sure |
| 72 | * you want to do this?" prompt, followed by a keyguard pattern trace if the user |
| 73 | * has defined one, followed by a final strongly-worded "THIS WILL ERASE EVERYTHING |
| 74 | * ON THE PHONE" prompt. If at any time the phone is allowed to go to sleep, is |
| 75 | * locked, et cetera, then the confirmation sequence is abandoned. |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 76 | * |
| 77 | * This is the initial screen. |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 78 | */ |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 79 | public class MasterClear extends InstrumentedFragment implements OnGlobalLayoutListener { |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 80 | private static final String TAG = "MasterClear"; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 81 | |
Carlos Valdivia | 5dd6ed4 | 2018-01-23 09:12:59 -0800 | [diff] [blame] | 82 | @VisibleForTesting static final int KEYGUARD_REQUEST = 55; |
Carlos Valdivia | 08c8820 | 2018-01-21 18:57:28 -0800 | [diff] [blame] | 83 | @VisibleForTesting static final int CREDENTIAL_CONFIRM_REQUEST = 56; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 84 | |
Qingxi Li | c8a2b04 | 2018-01-11 11:35:07 -0800 | [diff] [blame] | 85 | private static final String KEY_SHOW_ESIM_RESET_CHECKBOX |
| 86 | = "masterclear.allow_retain_esim_profiles_after_fdr"; |
| 87 | |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 88 | static final String ERASE_EXTERNAL_EXTRA = "erase_sd"; |
qingxi | 072f286 | 2017-04-11 18:28:40 -0700 | [diff] [blame] | 89 | static final String ERASE_ESIMS_EXTRA = "erase_esim"; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 90 | |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 91 | private View mContentView; |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 92 | @VisibleForTesting Button mInitiateButton; |
Dianne Hackborn | 1337d0f | 2010-10-14 11:58:30 -0700 | [diff] [blame] | 93 | private View mExternalStorageContainer; |
qingxi | 072f286 | 2017-04-11 18:28:40 -0700 | [diff] [blame] | 94 | @VisibleForTesting CheckBox mExternalStorage; |
Qingxi Li | c8a2b04 | 2018-01-11 11:35:07 -0800 | [diff] [blame] | 95 | private View mEsimStorageContainer; |
| 96 | @VisibleForTesting CheckBox mEsimStorage; |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 97 | @VisibleForTesting ScrollView mScrollView; |
jackqdyulei | 0b3edc7 | 2016-12-13 17:07:08 -0800 | [diff] [blame] | 98 | |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 99 | @Override |
| 100 | public void onGlobalLayout() { |
| 101 | mInitiateButton.setEnabled(hasReachedBottom(mScrollView)); |
| 102 | } |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 103 | |
Doris Ling | 03a3b51 | 2017-10-18 14:25:01 -0700 | [diff] [blame] | 104 | @Override |
Doris Ling | ed4685f | 2017-10-25 14:08:57 -0700 | [diff] [blame] | 105 | public void onCreate(@Nullable Bundle savedInstanceState) { |
| 106 | super.onCreate(savedInstanceState); |
Fan Zhang | dc00efa | 2018-05-10 15:10:19 -0700 | [diff] [blame] | 107 | getActivity().setTitle(R.string.master_clear_short_title); |
Doris Ling | 03a3b51 | 2017-10-18 14:25:01 -0700 | [diff] [blame] | 108 | } |
| 109 | |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 110 | /** |
Jim Miller | 2deec7e | 2010-04-13 17:43:36 -0700 | [diff] [blame] | 111 | * Keyguard validation is run using the standard {@link ConfirmLockPattern} |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 112 | * component as a subactivity |
Jim Miller | 2deec7e | 2010-04-13 17:43:36 -0700 | [diff] [blame] | 113 | * @param request the request code to be returned once confirmation finishes |
| 114 | * @return true if confirmation launched |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 115 | */ |
Jim Miller | 2deec7e | 2010-04-13 17:43:36 -0700 | [diff] [blame] | 116 | private boolean runKeyguardConfirmation(int request) { |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 117 | Resources res = getActivity().getResources(); |
Jorim Jaggi | 8a09b61 | 2015-04-06 17:47:18 -0700 | [diff] [blame] | 118 | return new ChooseLockSettingsHelper(getActivity(), this).launchConfirmationActivity( |
Fan Zhang | dc00efa | 2018-05-10 15:10:19 -0700 | [diff] [blame] | 119 | request, res.getText(R.string.master_clear_short_title)); |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 120 | } |
| 121 | |
Carlos Valdivia | 5dd6ed4 | 2018-01-23 09:12:59 -0800 | [diff] [blame] | 122 | @VisibleForTesting |
| 123 | boolean isValidRequestCode(int requestCode) { |
| 124 | return !((requestCode != KEYGUARD_REQUEST) && (requestCode != CREDENTIAL_CONFIRM_REQUEST)); |
| 125 | } |
| 126 | |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 127 | @Override |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 128 | public void onActivityResult(int requestCode, int resultCode, Intent data) { |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 129 | super.onActivityResult(requestCode, resultCode, data); |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 130 | onActivityResultInternal(requestCode, resultCode, data); |
| 131 | } |
| 132 | |
| 133 | /* |
| 134 | * Internal method that allows easy testing without dealing with super references. |
| 135 | */ |
| 136 | @VisibleForTesting |
| 137 | void onActivityResultInternal(int requestCode, int resultCode, Intent data) { |
Carlos Valdivia | 5dd6ed4 | 2018-01-23 09:12:59 -0800 | [diff] [blame] | 138 | if (!isValidRequestCode(requestCode)) { |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 139 | return; |
| 140 | } |
| 141 | |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 142 | if (resultCode != Activity.RESULT_OK) { |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 143 | establishInitialState(); |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 144 | return; |
| 145 | } |
| 146 | |
| 147 | Intent intent = null; |
| 148 | // If returning from a Keyguard request, try to show an account confirmation request if |
| 149 | // applciable. |
| 150 | if (CREDENTIAL_CONFIRM_REQUEST != requestCode |
| 151 | && (intent = getAccountConfirmationIntent()) != null) { |
| 152 | showAccountCredentialConfirmation(intent); |
| 153 | } else { |
| 154 | showFinalConfirmation(); |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 155 | } |
| 156 | } |
| 157 | |
qingxi | 072f286 | 2017-04-11 18:28:40 -0700 | [diff] [blame] | 158 | @VisibleForTesting |
| 159 | void showFinalConfirmation() { |
Fan Zhang | 7cf99f5 | 2018-02-16 10:37:37 -0800 | [diff] [blame] | 160 | final Bundle args = new Bundle(); |
Stuart Scott | be90341 | 2014-07-24 19:22:06 -0700 | [diff] [blame] | 161 | args.putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked()); |
Qingxi Li | c8a2b04 | 2018-01-11 11:35:07 -0800 | [diff] [blame] | 162 | args.putBoolean(ERASE_ESIMS_EXTRA, mEsimStorage.isChecked()); |
Fan Zhang | 7cf99f5 | 2018-02-16 10:37:37 -0800 | [diff] [blame] | 163 | new SubSettingLauncher(getContext()) |
| 164 | .setDestination(MasterClearConfirm.class.getName()) |
| 165 | .setArguments(args) |
hjchangliao | e86eec0 | 2018-05-02 13:01:07 +0800 | [diff] [blame] | 166 | .setTitleRes(R.string.master_clear_confirm_title) |
Fan Zhang | 7cf99f5 | 2018-02-16 10:37:37 -0800 | [diff] [blame] | 167 | .setSourceMetricsCategory(getMetricsCategory()) |
| 168 | .launch(); |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 169 | } |
| 170 | |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 171 | @VisibleForTesting |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 172 | void showAccountCredentialConfirmation(Intent intent) { |
| 173 | startActivityForResult(intent, CREDENTIAL_CONFIRM_REQUEST); |
| 174 | } |
| 175 | |
| 176 | @VisibleForTesting |
| 177 | Intent getAccountConfirmationIntent() { |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 178 | final Context context = getActivity(); |
| 179 | final String accountType = context.getString(R.string.account_type); |
| 180 | final String packageName = context.getString(R.string.account_confirmation_package); |
Carlos Valdivia | 5114604 | 2018-01-23 17:17:56 -0800 | [diff] [blame] | 181 | final String className = context.getString(R.string.account_confirmation_class); |
| 182 | if (TextUtils.isEmpty(accountType) |
| 183 | || TextUtils.isEmpty(packageName) |
| 184 | || TextUtils.isEmpty(className)) { |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 185 | Log.i(TAG, "Resources not set for account confirmation."); |
| 186 | return null; |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 187 | } |
| 188 | final AccountManager am = AccountManager.get(context); |
| 189 | Account[] accounts = am.getAccountsByType(accountType); |
| 190 | if (accounts != null && accounts.length > 0) { |
| 191 | final Intent requestAccountConfirmation = new Intent() |
| 192 | .setPackage(packageName) |
Carlos Valdivia | 5114604 | 2018-01-23 17:17:56 -0800 | [diff] [blame] | 193 | .setComponent(new ComponentName(packageName, className)); |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 194 | // Check to make sure that the intent is supported. |
| 195 | final PackageManager pm = context.getPackageManager(); |
Carlos Valdivia | 08c8820 | 2018-01-21 18:57:28 -0800 | [diff] [blame] | 196 | final ResolveInfo resolution = pm.resolveActivity(requestAccountConfirmation, 0); |
| 197 | if (resolution != null |
| 198 | && resolution.activityInfo != null |
| 199 | && packageName.equals(resolution.activityInfo.packageName)) { |
| 200 | // Note that we need to check the packagename to make sure that an Activity resolver |
| 201 | // wasn't returned. |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 202 | return requestAccountConfirmation; |
| 203 | } else { |
| 204 | Log.i(TAG, "Unable to resolve Activity: " + packageName + "/" + className); |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 205 | } |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 206 | } else { |
| 207 | Log.d(TAG, "No " + accountType + " accounts installed!"); |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 208 | } |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 209 | return null; |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 210 | } |
| 211 | |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 212 | /** |
| 213 | * If the user clicks to begin the reset sequence, we next require a |
| 214 | * keyguard confirmation if the user has currently enabled one. If there |
| 215 | * is no keyguard available, we simply go to the final confirmation prompt. |
Christine Franks | a09eb38 | 2017-06-23 14:28:21 -0700 | [diff] [blame] | 216 | * |
| 217 | * If the user is in demo mode, route to the demo mode app for confirmation. |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 218 | */ |
Christine Franks | a09eb38 | 2017-06-23 14:28:21 -0700 | [diff] [blame] | 219 | @VisibleForTesting |
| 220 | protected final Button.OnClickListener mInitiateListener = new Button.OnClickListener() { |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 221 | |
Christine Franks | a09eb38 | 2017-06-23 14:28:21 -0700 | [diff] [blame] | 222 | public void onClick(View view) { |
| 223 | final Context context = view.getContext(); |
| 224 | if (Utils.isDemoUser(context)) { |
Justin Klaassen | 3025727 | 2017-08-08 21:58:05 -0700 | [diff] [blame] | 225 | final ComponentName componentName = Utils.getDeviceOwnerComponent(context); |
| 226 | if (componentName != null) { |
Christine Franks | a09eb38 | 2017-06-23 14:28:21 -0700 | [diff] [blame] | 227 | final Intent requestFactoryReset = new Intent() |
Justin Klaassen | 3025727 | 2017-08-08 21:58:05 -0700 | [diff] [blame] | 228 | .setPackage(componentName.getPackageName()) |
Christine Franks | a09eb38 | 2017-06-23 14:28:21 -0700 | [diff] [blame] | 229 | .setAction(Intent.ACTION_FACTORY_RESET); |
| 230 | context.startActivity(requestFactoryReset); |
Christine Franks | d7713c9 | 2017-01-20 11:24:14 -0800 | [diff] [blame] | 231 | } |
Carlos Valdivia | a9736ed | 2018-01-16 13:59:31 -0800 | [diff] [blame] | 232 | return; |
| 233 | } |
| 234 | |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 235 | if (runKeyguardConfirmation(KEYGUARD_REQUEST)) { |
| 236 | return; |
| 237 | } |
| 238 | |
| 239 | Intent intent = getAccountConfirmationIntent(); |
| 240 | if (intent != null) { |
| 241 | showAccountCredentialConfirmation(intent); |
| 242 | } else { |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 243 | showFinalConfirmation(); |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 244 | } |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 245 | } |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 246 | }; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 247 | |
| 248 | /** |
| 249 | * In its initial state, the activity presents a button for the user to |
| 250 | * click in order to initiate a confirmation sequence. This method is |
| 251 | * called from various other points in the code to reset the activity to |
| 252 | * this base state. |
Jim Miller | 47d380f | 2010-01-20 13:37:14 -0800 | [diff] [blame] | 253 | * |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 254 | * <p>Reinflating views from resources is expensive and prevents us from |
| 255 | * caching widget pointers, so we use a single-inflate pattern: we lazy- |
| 256 | * inflate each view, caching all of the widget pointers we'll need at the |
| 257 | * time, then simply reuse the inflated views directly whenever we need |
| 258 | * to change contents. |
| 259 | */ |
Carlos Valdivia | 4b34dad | 2018-01-29 18:30:33 -0800 | [diff] [blame] | 260 | @VisibleForTesting |
| 261 | void establishInitialState() { |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 262 | mInitiateButton = mContentView.findViewById(R.id.initiate_master_clear); |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 263 | mInitiateButton.setOnClickListener(mInitiateListener); |
| 264 | mExternalStorageContainer = mContentView.findViewById(R.id.erase_external_container); |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 265 | mExternalStorage = mContentView.findViewById(R.id.erase_external); |
Qingxi Li | c8a2b04 | 2018-01-11 11:35:07 -0800 | [diff] [blame] | 266 | mEsimStorageContainer = mContentView.findViewById(R.id.erase_esim_container); |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 267 | mEsimStorage = mContentView.findViewById(R.id.erase_esim); |
| 268 | if (mScrollView != null) { |
| 269 | mScrollView.getViewTreeObserver().removeOnGlobalLayoutListener(this); |
| 270 | } |
| 271 | mScrollView = mContentView.findViewById(R.id.master_clear_scrollview); |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 272 | |
Kenny Root | 3785e39 | 2011-01-18 15:14:32 -0800 | [diff] [blame] | 273 | /* |
| 274 | * If the external storage is emulated, it will be erased with a factory |
| 275 | * reset at any rate. There is no need to have a separate option until |
| 276 | * we have a factory reset that only erases some directories and not |
Ben Komalo | 2a32192 | 2011-09-07 16:42:34 -0700 | [diff] [blame] | 277 | * others. Likewise, if it's non-removable storage, it could potentially have been |
| 278 | * encrypted, and will also need to be wiped. |
Kenny Root | 3785e39 | 2011-01-18 15:14:32 -0800 | [diff] [blame] | 279 | */ |
Ben Komalo | 2a32192 | 2011-09-07 16:42:34 -0700 | [diff] [blame] | 280 | boolean isExtStorageEmulated = Environment.isExternalStorageEmulated(); |
| 281 | if (isExtStorageEmulated |
| 282 | || (!Environment.isExternalStorageRemovable() && isExtStorageEncrypted())) { |
Kenny Root | 3785e39 | 2011-01-18 15:14:32 -0800 | [diff] [blame] | 283 | mExternalStorageContainer.setVisibility(View.GONE); |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 284 | |
Kenny Root | 3785e39 | 2011-01-18 15:14:32 -0800 | [diff] [blame] | 285 | final View externalOption = mContentView.findViewById(R.id.erase_external_option_text); |
| 286 | externalOption.setVisibility(View.GONE); |
| 287 | |
| 288 | final View externalAlsoErased = mContentView.findViewById(R.id.also_erases_external); |
| 289 | externalAlsoErased.setVisibility(View.VISIBLE); |
Ben Komalo | 2a32192 | 2011-09-07 16:42:34 -0700 | [diff] [blame] | 290 | |
| 291 | // If it's not emulated, it is on a separate partition but it means we're doing |
| 292 | // a force wipe due to encryption. |
| 293 | mExternalStorage.setChecked(!isExtStorageEmulated); |
Kenny Root | 3785e39 | 2011-01-18 15:14:32 -0800 | [diff] [blame] | 294 | } else { |
| 295 | mExternalStorageContainer.setOnClickListener(new View.OnClickListener() { |
| 296 | |
| 297 | @Override |
| 298 | public void onClick(View v) { |
| 299 | mExternalStorage.toggle(); |
| 300 | } |
| 301 | }); |
| 302 | } |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 303 | |
Jeff Davidson | f1c13fa | 2017-05-19 17:03:32 -0700 | [diff] [blame] | 304 | if (showWipeEuicc()) { |
Qingxi Li | c8a2b04 | 2018-01-11 11:35:07 -0800 | [diff] [blame] | 305 | if (showWipeEuiccCheckbox()) { |
| 306 | TextView title = mContentView.findViewById(R.id.erase_esim_title); |
| 307 | title.setText(R.string.erase_esim_storage); |
| 308 | mEsimStorageContainer.setVisibility(View.VISIBLE); |
| 309 | mEsimStorageContainer.setOnClickListener(new View.OnClickListener() { |
| 310 | @Override |
| 311 | public void onClick(View v) { |
| 312 | mEsimStorage.toggle(); |
| 313 | } |
| 314 | }); |
| 315 | } else { |
| 316 | final View esimAlsoErased = mContentView.findViewById(R.id.also_erases_esim); |
| 317 | esimAlsoErased.setVisibility(View.VISIBLE); |
qingxi | 072f286 | 2017-04-11 18:28:40 -0700 | [diff] [blame] | 318 | |
Qingxi Li | c8a2b04 | 2018-01-11 11:35:07 -0800 | [diff] [blame] | 319 | final View noCancelMobilePlan = mContentView.findViewById( |
| 320 | R.id.no_cancel_mobile_plan); |
| 321 | noCancelMobilePlan.setVisibility(View.VISIBLE); |
| 322 | mEsimStorage.setChecked(true /* checked */); |
| 323 | } |
qingxi | 072f286 | 2017-04-11 18:28:40 -0700 | [diff] [blame] | 324 | } |
| 325 | |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 326 | final UserManager um = (UserManager) getActivity().getSystemService(Context.USER_SERVICE); |
| 327 | loadAccountList(um); |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 328 | final StringBuffer contentDescription = new StringBuffer(); |
| 329 | final View masterClearContainer = mContentView.findViewById(R.id.master_clear_container); |
Julia Reynolds | ce25af4 | 2015-07-08 16:56:31 -0400 | [diff] [blame] | 330 | getContentDescription(masterClearContainer, contentDescription); |
| 331 | masterClearContainer.setContentDescription(contentDescription); |
jackqdyulei | 0b3edc7 | 2016-12-13 17:07:08 -0800 | [diff] [blame] | 332 | |
| 333 | // Set the status of initiateButton based on scrollview |
| 334 | mScrollView.setOnScrollChangeListener(new OnScrollChangeListener() { |
| 335 | @Override |
| 336 | public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, |
| 337 | int oldScrollY) { |
| 338 | if (v instanceof ScrollView && hasReachedBottom((ScrollView) v)) { |
| 339 | mInitiateButton.setEnabled(true); |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 340 | mScrollView.setOnScrollChangeListener(null); |
jackqdyulei | 0b3edc7 | 2016-12-13 17:07:08 -0800 | [diff] [blame] | 341 | } |
| 342 | } |
| 343 | }); |
| 344 | |
| 345 | // Set the initial state of the initiateButton |
Doris Ling | 1f49715 | 2018-02-22 16:33:07 -0800 | [diff] [blame] | 346 | mScrollView.getViewTreeObserver().addOnGlobalLayoutListener(this); |
jackqdyulei | 0b3edc7 | 2016-12-13 17:07:08 -0800 | [diff] [blame] | 347 | } |
| 348 | |
Jeff Davidson | f1c13fa | 2017-05-19 17:03:32 -0700 | [diff] [blame] | 349 | /** |
Jeff Davidson | a0b8472 | 2017-07-26 17:38:41 -0700 | [diff] [blame] | 350 | * Whether to show strings indicating that the eUICC will be wiped. |
Jeff Davidson | f1c13fa | 2017-05-19 17:03:32 -0700 | [diff] [blame] | 351 | * |
Jeff Davidson | a0b8472 | 2017-07-26 17:38:41 -0700 | [diff] [blame] | 352 | * <p>We show the strings on any device which supports eUICC as long as the eUICC was ever |
Jeff Davidson | 4ba7478 | 2017-06-30 18:02:13 -0700 | [diff] [blame] | 353 | * provisioned (that is, at least one profile was ever downloaded onto it). |
Jeff Davidson | f1c13fa | 2017-05-19 17:03:32 -0700 | [diff] [blame] | 354 | */ |
| 355 | @VisibleForTesting |
| 356 | boolean showWipeEuicc() { |
| 357 | Context context = getContext(); |
| 358 | if (!isEuiccEnabled(context)) { |
| 359 | return false; |
| 360 | } |
| 361 | ContentResolver cr = context.getContentResolver(); |
Qingxi Li | e0681db | 2018-03-14 16:00:47 -0700 | [diff] [blame] | 362 | return Settings.Global.getInt(cr, Settings.Global.EUICC_PROVISIONED, 0) != 0 |
| 363 | || Settings.Global.getInt( |
| 364 | cr, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0; |
Jeff Davidson | f1c13fa | 2017-05-19 17:03:32 -0700 | [diff] [blame] | 365 | } |
| 366 | |
| 367 | @VisibleForTesting |
Qingxi Li | c8a2b04 | 2018-01-11 11:35:07 -0800 | [diff] [blame] | 368 | boolean showWipeEuiccCheckbox() { |
| 369 | return SystemProperties |
| 370 | .getBoolean(KEY_SHOW_ESIM_RESET_CHECKBOX, false /* def */); |
| 371 | } |
| 372 | |
| 373 | @VisibleForTesting |
Jeff Davidson | f1c13fa | 2017-05-19 17:03:32 -0700 | [diff] [blame] | 374 | protected boolean isEuiccEnabled(Context context) { |
| 375 | EuiccManager euiccManager = (EuiccManager) context.getSystemService(Context.EUICC_SERVICE); |
| 376 | return euiccManager.isEnabled(); |
| 377 | } |
| 378 | |
jackqdyulei | 0b3edc7 | 2016-12-13 17:07:08 -0800 | [diff] [blame] | 379 | @VisibleForTesting |
| 380 | boolean hasReachedBottom(final ScrollView scrollView) { |
| 381 | if (scrollView.getChildCount() < 1) { |
| 382 | return true; |
| 383 | } |
| 384 | |
| 385 | final View view = scrollView.getChildAt(0); |
| 386 | final int diff = view.getBottom() - (scrollView.getHeight() + scrollView.getScrollY()); |
| 387 | |
| 388 | return diff <= 0; |
Julia Reynolds | ce25af4 | 2015-07-08 16:56:31 -0400 | [diff] [blame] | 389 | } |
| 390 | |
| 391 | private void getContentDescription(View v, StringBuffer description) { |
Jason Monk | fda7741 | 2016-05-06 14:28:09 -0400 | [diff] [blame] | 392 | if (v.getVisibility() != View.VISIBLE) { |
| 393 | return; |
| 394 | } |
Julia Reynolds | ce25af4 | 2015-07-08 16:56:31 -0400 | [diff] [blame] | 395 | if (v instanceof ViewGroup) { |
| 396 | ViewGroup vGroup = (ViewGroup) v; |
| 397 | for (int i = 0; i < vGroup.getChildCount(); i++) { |
| 398 | View nextChild = vGroup.getChildAt(i); |
| 399 | getContentDescription(nextChild, description); |
| 400 | } |
| 401 | } else if (v instanceof TextView) { |
| 402 | TextView vText = (TextView) v; |
| 403 | description.append(vText.getText()); |
| 404 | description.append(","); // Allow Talkback to pause between sections. |
| 405 | } |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 406 | } |
| 407 | |
Ben Komalo | 2a32192 | 2011-09-07 16:42:34 -0700 | [diff] [blame] | 408 | private boolean isExtStorageEncrypted() { |
| 409 | String state = SystemProperties.get("vold.decrypt"); |
| 410 | return !"".equals(state); |
| 411 | } |
| 412 | |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 413 | private void loadAccountList(final UserManager um) { |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 414 | View accountsLabel = mContentView.findViewById(R.id.accounts_label); |
| 415 | LinearLayout contents = (LinearLayout)mContentView.findViewById(R.id.accounts); |
Amith Yamasani | 3f45de5 | 2011-09-22 14:34:17 -0700 | [diff] [blame] | 416 | contents.removeAllViews(); |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 417 | |
| 418 | Context context = getActivity(); |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 419 | final List<UserInfo> profiles = um.getProfiles(UserHandle.myUserId()); |
| 420 | final int profilesSize = profiles.size(); |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 421 | |
| 422 | AccountManager mgr = AccountManager.get(context); |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 423 | |
| 424 | LayoutInflater inflater = (LayoutInflater)context.getSystemService( |
| 425 | Context.LAYOUT_INFLATER_SERVICE); |
| 426 | |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 427 | int accountsCount = 0; |
| 428 | for (int profileIndex = 0; profileIndex < profilesSize; profileIndex++) { |
| 429 | final UserInfo userInfo = profiles.get(profileIndex); |
| 430 | final int profileId = userInfo.id; |
| 431 | final UserHandle userHandle = new UserHandle(profileId); |
| 432 | Account[] accounts = mgr.getAccountsAsUser(profileId); |
| 433 | final int N = accounts.length; |
| 434 | if (N == 0) { |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 435 | continue; |
| 436 | } |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 437 | accountsCount += N; |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 438 | |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 439 | AuthenticatorDescription[] descs = AccountManager.get(context) |
| 440 | .getAuthenticatorTypesAsUser(profileId); |
| 441 | final int M = descs.length; |
| 442 | |
Bartosz Fabianowski | 30ba868 | 2017-04-19 11:51:43 +0200 | [diff] [blame] | 443 | if (profilesSize > 1) { |
| 444 | View titleView = Utils.inflateCategoryHeader(inflater, contents); |
| 445 | final TextView titleText = (TextView) titleView.findViewById(android.R.id.title); |
| 446 | titleText.setText(userInfo.isManagedProfile() ? R.string.category_work |
| 447 | : R.string.category_personal); |
| 448 | contents.addView(titleView); |
| 449 | } |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 450 | |
| 451 | for (int i = 0; i < N; i++) { |
| 452 | Account account = accounts[i]; |
| 453 | AuthenticatorDescription desc = null; |
| 454 | for (int j = 0; j < M; j++) { |
| 455 | if (account.type.equals(descs[j].type)) { |
| 456 | desc = descs[j]; |
| 457 | break; |
| 458 | } |
| 459 | } |
| 460 | if (desc == null) { |
| 461 | Log.w(TAG, "No descriptor for account name=" + account.name |
| 462 | + " type=" + account.type); |
| 463 | continue; |
| 464 | } |
| 465 | Drawable icon = null; |
| 466 | try { |
| 467 | if (desc.iconId != 0) { |
Zoltan Szatmary-Ban | 546790c | 2014-12-02 17:22:10 +0000 | [diff] [blame] | 468 | Context authContext = context.createPackageContextAsUser(desc.packageName, |
| 469 | 0, userHandle); |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 470 | icon = context.getPackageManager().getUserBadgedIcon( |
| 471 | authContext.getDrawable(desc.iconId), userHandle); |
| 472 | } |
| 473 | } catch (PackageManager.NameNotFoundException e) { |
Rubin Xu | d1ce82a | 2015-06-08 17:21:19 +0100 | [diff] [blame] | 474 | Log.w(TAG, "Bad package name for account type " + desc.type); |
| 475 | } catch (Resources.NotFoundException e) { |
| 476 | Log.w(TAG, "Invalid icon id for account type " + desc.type, e); |
| 477 | } |
| 478 | if (icon == null) { |
| 479 | icon = context.getPackageManager().getDefaultActivityIcon(); |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 480 | } |
| 481 | |
Fan Zhang | 6b2bb39 | 2016-09-28 09:07:44 -0700 | [diff] [blame] | 482 | View child = inflater.inflate(R.layout.master_clear_account, contents, false); |
| 483 | ((ImageView) child.findViewById(android.R.id.icon)).setImageDrawable(icon); |
| 484 | ((TextView) child.findViewById(android.R.id.title)).setText(account.name); |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 485 | contents.addView(child); |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 486 | } |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 487 | } |
| 488 | |
Zoltan Szatmary-Ban | 7cc1b9e | 2014-10-24 18:03:18 +0100 | [diff] [blame] | 489 | if (accountsCount > 0) { |
| 490 | accountsLabel.setVisibility(View.VISIBLE); |
| 491 | contents.setVisibility(View.VISIBLE); |
| 492 | } |
| 493 | // Checking for all other users and their profiles if any. |
| 494 | View otherUsers = mContentView.findViewById(R.id.other_users_present); |
| 495 | final boolean hasOtherUsers = (um.getUserCount() - profilesSize) > 0; |
| 496 | otherUsers.setVisibility(hasOtherUsers ? View.VISIBLE : View.GONE); |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 497 | } |
| 498 | |
| 499 | @Override |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 500 | public View onCreateView(LayoutInflater inflater, ViewGroup container, |
| 501 | Bundle savedInstanceState) { |
Christine Franks | 1478222 | 2017-01-23 16:44:02 -0800 | [diff] [blame] | 502 | final Context context = getContext(); |
Philip P. Moltmann | e3f7211 | 2018-08-28 15:01:43 -0700 | [diff] [blame^] | 503 | final EnforcedAdmin admin = RestrictedLockUtilsInternal.checkIfRestrictionEnforced(context, |
Christine Franks | 1478222 | 2017-01-23 16:44:02 -0800 | [diff] [blame] | 504 | UserManager.DISALLOW_FACTORY_RESET, UserHandle.myUserId()); |
| 505 | final UserManager um = UserManager.get(context); |
Philip P. Moltmann | e3f7211 | 2018-08-28 15:01:43 -0700 | [diff] [blame^] | 506 | final boolean disallow = !um.isAdminUser() || RestrictedLockUtilsInternal |
| 507 | .hasBaseUserRestriction(context, UserManager.DISALLOW_FACTORY_RESET, |
| 508 | UserHandle.myUserId()); |
Christine Franks | a09eb38 | 2017-06-23 14:28:21 -0700 | [diff] [blame] | 509 | if (disallow && !Utils.isDemoUser(context)) { |
Julia Reynolds | 2c53933 | 2014-06-11 12:56:02 -0400 | [diff] [blame] | 510 | return inflater.inflate(R.layout.master_clear_disallowed_screen, null); |
Sudheer Shanka | 7dbbe13 | 2016-02-16 14:19:32 +0000 | [diff] [blame] | 511 | } else if (admin != null) { |
arangelov | e35badd | 2017-10-27 13:51:28 +0100 | [diff] [blame] | 512 | new ActionDisabledByAdminDialogHelper(getActivity()) |
| 513 | .prepareDialogBuilder(UserManager.DISALLOW_FACTORY_RESET, admin) |
| 514 | .setOnDismissListener(__ -> getActivity().finish()) |
| 515 | .show(); |
| 516 | return new View(getContext()); |
Julia Reynolds | 2c53933 | 2014-06-11 12:56:02 -0400 | [diff] [blame] | 517 | } |
| 518 | |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 519 | mContentView = inflater.inflate(R.layout.master_clear, null); |
Joe Onorato | b51886d | 2010-11-08 18:25:51 -0800 | [diff] [blame] | 520 | |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 521 | establishInitialState(); |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 522 | return mContentView; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 523 | } |
Chris Wren | 8a963ba | 2015-03-20 10:29:14 -0400 | [diff] [blame] | 524 | |
| 525 | @Override |
Fan Zhang | 6507613 | 2016-08-08 10:25:13 -0700 | [diff] [blame] | 526 | public int getMetricsCategory() { |
Chris Wren | 9d1bfd1 | 2016-01-26 18:04:01 -0500 | [diff] [blame] | 527 | return MetricsEvent.MASTER_CLEAR; |
Chris Wren | 8a963ba | 2015-03-20 10:29:14 -0400 | [diff] [blame] | 528 | } |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 529 | } |