blob: 919592905c8cf7b6f4e3d1bd2d8d5febab0ae024 [file] [log] [blame]
Santos Cordon7d4ddf62013-07-10 11:58:08 -07001/*
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.phone;
18
Tyler Gunn1acf54a2018-03-28 14:15:34 -070019import static android.telephony.ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
20
Chihhang Chuangd301d9a2018-06-05 15:29:06 +080021import android.animation.Animator;
22import android.animation.AnimatorListenerAdapter;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070023import android.app.Activity;
24import android.app.AlertDialog;
25import android.app.Dialog;
Lucas Dupineb9c5702017-05-10 16:57:09 -070026import android.app.WallpaperManager;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070027import android.content.BroadcastReceiver;
28import android.content.Context;
29import android.content.Intent;
30import android.content.IntentFilter;
Lucas Dupineb9c5702017-05-10 16:57:09 -070031import android.graphics.Point;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070032import android.media.AudioManager;
33import android.media.ToneGenerator;
34import android.net.Uri;
Tyler Gunn1acf54a2018-03-28 14:15:34 -070035import android.os.AsyncTask;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070036import android.os.Bundle;
Jonathan Basseric31f1f32015-05-12 10:13:03 -070037import android.os.PersistableBundle;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070038import android.provider.Settings;
Tyler Gunn4d45d1c2014-09-12 22:17:53 -070039import android.telecom.PhoneAccount;
Tyler Gunnca7dfef2018-03-27 18:50:05 +000040import android.telecom.TelecomManager;
Jonathan Basseri3649bdb2015-04-30 22:39:11 -070041import android.telephony.CarrierConfigManager;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070042import android.telephony.PhoneNumberUtils;
Tyler Gunn1acf54a2018-03-28 14:15:34 -070043import android.telephony.ServiceState;
Santos Cordone137eed2015-06-23 15:34:47 -070044import android.telephony.SubscriptionManager;
Tyler Gunn1acf54a2018-03-28 14:15:34 -070045import android.telephony.TelephonyManager;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070046import android.text.Editable;
Hall Liubdc9c882016-05-25 15:25:28 -070047import android.text.InputType;
Hall Liudc274312016-03-01 16:34:45 -080048import android.text.Spannable;
49import android.text.SpannableString;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070050import android.text.TextUtils;
51import android.text.TextWatcher;
52import android.text.method.DialerKeyListener;
Ihab Awadf7c1a5a2014-12-08 19:24:23 -080053import android.text.style.TtsSpan;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070054import android.util.Log;
Tyler Gunn1acf54a2018-03-28 14:15:34 -070055import android.util.TypedValue;
Yorke Lee116dd072015-08-31 11:38:39 -070056import android.view.HapticFeedbackConstants;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070057import android.view.KeyEvent;
Andrew Leed5631e82014-10-08 16:03:58 -070058import android.view.MenuItem;
Adrian Roos1c4b47f2015-04-13 14:53:32 -070059import android.view.MotionEvent;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070060import android.view.View;
Chihhang Chuang4f2b7812018-06-07 16:25:27 +080061import android.view.ViewGroup;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070062import android.view.WindowManager;
Chihhang Chuang4f2b7812018-06-07 16:25:27 +080063import android.widget.TextView;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070064
Lucas Dupinaf9e9912017-06-22 12:39:39 -070065import com.android.internal.colorextraction.ColorExtractor;
66import com.android.internal.colorextraction.ColorExtractor.GradientColors;
67import com.android.internal.colorextraction.drawable.GradientDrawable;
Yorke Lee23a70732014-08-14 17:12:01 -070068import com.android.phone.common.dialpad.DialpadKeyButton;
Sai Cheemalapati14462b62014-06-18 13:53:56 -070069import com.android.phone.common.util.ViewUtil;
Tyler Gunn1acf54a2018-03-28 14:15:34 -070070import com.android.phone.common.widget.ResizingTextEditText;
Santos Cordon7d4ddf62013-07-10 11:58:08 -070071
Chihhang Chuang4f2b7812018-06-07 16:25:27 +080072import java.util.ArrayList;
73import java.util.List;
74
Santos Cordon7d4ddf62013-07-10 11:58:08 -070075/**
76 * EmergencyDialer is a special dialer that is used ONLY for dialing emergency calls.
77 *
78 * It's a simplified version of the regular dialer (i.e. the TwelveKeyDialer
79 * activity from apps/Contacts) that:
80 * 1. Allows ONLY emergency calls to be dialed
81 * 2. Disallows voicemail functionality
82 * 3. Uses the FLAG_SHOW_WHEN_LOCKED window manager flag to allow this
83 * activity to stay in front of the keyguard.
84 *
85 * TODO: Even though this is an ultra-simplified version of the normal
86 * dialer, there's still lots of code duplication between this class and
87 * the TwelveKeyDialer class from apps/Contacts. Could the common code be
88 * moved into a shared base class that would live in the framework?
89 * Or could we figure out some way to move *this* class into apps/Contacts
90 * also?
Chihhang Chuangd301d9a2018-06-05 15:29:06 +080091 *
92 * TODO: Implement emergency dialer shortcut.
Chihhang Chuang4f2b7812018-06-07 16:25:27 +080093 * Emergency dialer shortcut offer a local emergency number list. Directly clicking a call button
94 * to place an emergency phone call without entering numbers from dialpad.
Chihhang Chuangd301d9a2018-06-05 15:29:06 +080095 * TODO item:
Chihhang Chuang4f2b7812018-06-07 16:25:27 +080096 * 1.integrate emergency phone number table.
Santos Cordon7d4ddf62013-07-10 11:58:08 -070097 */
98public class EmergencyDialer extends Activity implements View.OnClickListener,
Yorke Lee23a70732014-08-14 17:12:01 -070099 View.OnLongClickListener, View.OnKeyListener, TextWatcher,
Chihhang Chuang4f2b7812018-06-07 16:25:27 +0800100 DialpadKeyButton.OnPressedListener, ColorExtractor.OnColorsChangedListener,
101 EmergencyShortcutButton.OnConfirmClickListener {
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700102 // Keys used with onSaveInstanceState().
103 private static final String LAST_NUMBER = "lastNumber";
104
105 // Intent action for this activity.
106 public static final String ACTION_DIAL = "com.android.phone.EmergencyDialer.DIAL";
107
108 // List of dialer button IDs.
109 private static final int[] DIALER_KEYS = new int[] {
110 R.id.one, R.id.two, R.id.three,
111 R.id.four, R.id.five, R.id.six,
112 R.id.seven, R.id.eight, R.id.nine,
113 R.id.star, R.id.zero, R.id.pound };
114
115 // Debug constants.
116 private static final boolean DBG = false;
117 private static final String LOG_TAG = "EmergencyDialer";
118
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700119 /** The length of DTMF tones in milliseconds */
120 private static final int TONE_LENGTH_MS = 150;
121
122 /** The DTMF tone volume relative to other sounds in the stream */
123 private static final int TONE_RELATIVE_VOLUME = 80;
124
125 /** Stream type used to play the DTMF tones off call, and mapped to the volume control keys */
126 private static final int DIAL_TONE_STREAM_TYPE = AudioManager.STREAM_DTMF;
127
128 private static final int BAD_EMERGENCY_NUMBER_DIALOG = 0;
129
Lucas Dupineb9c5702017-05-10 16:57:09 -0700130 /** 90% opacity, different from other gradients **/
131 private static final int BACKGROUND_GRADIENT_ALPHA = 230;
132
Tyler Gunn1acf54a2018-03-28 14:15:34 -0700133 ResizingTextEditText mDigits;
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700134 private View mDialButton;
135 private View mDelete;
Chihhang Chuangd301d9a2018-06-05 15:29:06 +0800136 private View mEmergencyShortcutView;
137 private View mDialpadView;
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700138
Chihhang Chuang4f2b7812018-06-07 16:25:27 +0800139 private List<EmergencyShortcutButton> mEmergencyShortcutButtonList;
140
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700141 private ToneGenerator mToneGenerator;
142 private Object mToneGeneratorLock = new Object();
143
144 // determines if we want to playback local DTMF tones.
145 private boolean mDTMFToneEnabled;
146
Adrian Roos1c4b47f2015-04-13 14:53:32 -0700147 private EmergencyActionGroup mEmergencyActionGroup;
148
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700149 // close activity when screen turns off
150 private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
151 @Override
152 public void onReceive(Context context, Intent intent) {
153 if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) {
Adrian Roos061c7232015-04-21 12:37:07 -0700154 finishAndRemoveTask();
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700155 }
156 }
157 };
158
159 private String mLastNumber; // last number we tried to dial. Used to restore error dialog.
160
Lucas Dupineb9c5702017-05-10 16:57:09 -0700161 // Background gradient
162 private ColorExtractor mColorExtractor;
163 private GradientDrawable mBackgroundGradient;
164 private boolean mSupportsDarkText;
165
Tyler Gunn1acf54a2018-03-28 14:15:34 -0700166 private boolean mIsWfcEmergencyCallingWarningEnabled;
167 private float mDefaultDigitsTextSize;
168
Chihhang Chuangd301d9a2018-06-05 15:29:06 +0800169 private boolean mAreEmergencyDialerShortcutsEnabled;
170
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700171 @Override
172 public void beforeTextChanged(CharSequence s, int start, int count, int after) {
173 // Do nothing
174 }
175
176 @Override
177 public void onTextChanged(CharSequence input, int start, int before, int changeCount) {
Tyler Gunn1acf54a2018-03-28 14:15:34 -0700178 maybeChangeHintSize();
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700179 }
180
181 @Override
182 public void afterTextChanged(Editable input) {
183 // Check for special sequences, in particular the "**04" or "**05"
184 // sequences that allow you to enter PIN or PUK-related codes.
185 //
186 // But note we *don't* allow most other special sequences here,
187 // like "secret codes" (*#*#<code>#*#*) or IMEI display ("*#06#"),
188 // since those shouldn't be available if the device is locked.
189 //
190 // So we call SpecialCharSequenceMgr.handleCharsForLockedDevice()
191 // here, not the regular handleChars() method.
192 if (SpecialCharSequenceMgr.handleCharsForLockedDevice(this, input.toString(), this)) {
193 // A special sequence was entered, clear the digits
194 mDigits.getText().clear();
195 }
196
197 updateDialAndDeleteButtonStateEnabledAttr();
Ihab Awadf7c1a5a2014-12-08 19:24:23 -0800198 updateTtsSpans();
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700199 }
200
201 @Override
202 protected void onCreate(Bundle icicle) {
203 super.onCreate(icicle);
204
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700205 // Allow this activity to be displayed in front of the keyguard / lockscreen.
206 WindowManager.LayoutParams lp = getWindow().getAttributes();
207 lp.flags |= WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
Santos Cordonfc309812013-08-20 18:33:16 -0700208
209 // When no proximity sensor is available, use a shorter timeout.
Christine Chen07fae162013-09-19 15:05:56 -0700210 // TODO: Do we enable this for non proximity devices any more?
Santos Cordonfc309812013-08-20 18:33:16 -0700211 // lp.userActivityTimeout = USER_ACTIVITY_TIMEOUT_WHEN_NO_PROX_SENSOR;
212
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700213 getWindow().setAttributes(lp);
214
Lucas Dupineb9c5702017-05-10 16:57:09 -0700215 mColorExtractor = new ColorExtractor(this);
Lucas Dupin94b566f2017-05-28 11:45:52 -0700216 GradientColors lockScreenColors = mColorExtractor.getColors(WallpaperManager.FLAG_LOCK,
217 ColorExtractor.TYPE_EXTRA_DARK);
Lucas Dupineb9c5702017-05-10 16:57:09 -0700218 updateTheme(lockScreenColors.supportsDarkText());
219
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700220 setContentView(R.layout.emergency_dialer);
221
Tyler Gunn1acf54a2018-03-28 14:15:34 -0700222 mDigits = (ResizingTextEditText) findViewById(R.id.digits);
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700223 mDigits.setKeyListener(DialerKeyListener.getInstance());
224 mDigits.setOnClickListener(this);
225 mDigits.setOnKeyListener(this);
226 mDigits.setLongClickable(false);
Hall Liubdc9c882016-05-25 15:25:28 -0700227 mDigits.setInputType(InputType.TYPE_NULL);
Tyler Gunn1acf54a2018-03-28 14:15:34 -0700228 mDefaultDigitsTextSize = mDigits.getScaledTextSize();
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700229 maybeAddNumberFormatting();
230
Lucas Dupineb9c5702017-05-10 16:57:09 -0700231 mBackgroundGradient = new GradientDrawable(this);
232 Point displaySize = new Point();
233 ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
234 .getDefaultDisplay().getSize(displaySize);
235 mBackgroundGradient.setScreenSize(displaySize.x, displaySize.y);
236 mBackgroundGradient.setAlpha(BACKGROUND_GRADIENT_ALPHA);
237 getWindow().setBackgroundDrawable(mBackgroundGradient);
238
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700239 // Check for the presence of the keypad
240 View view = findViewById(R.id.one);
241 if (view != null) {
242 setupKeypad();
243 }
244
245 mDelete = findViewById(R.id.deleteButton);
246 mDelete.setOnClickListener(this);
247 mDelete.setOnLongClickListener(this);
248
Sai Cheemalapati14462b62014-06-18 13:53:56 -0700249 mDialButton = findViewById(R.id.floating_action_button);
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700250
251 // Check whether we should show the onscreen "Dial" button and co.
Jonathan Basserie619a4c2015-06-26 14:52:26 -0700252 // Read carrier config through the public API because PhoneGlobals is not available when we
253 // run as a secondary user.
254 CarrierConfigManager configMgr =
255 (CarrierConfigManager) getSystemService(Context.CARRIER_CONFIG_SERVICE);
256 PersistableBundle carrierConfig =
Shishir Agrawald3480e02016-01-25 13:05:49 -0800257 configMgr.getConfigForSubId(SubscriptionManager.getDefaultVoiceSubscriptionId());
Tyler Gunn1acf54a2018-03-28 14:15:34 -0700258
Jonathan Basseri9504c6b2015-06-04 14:23:32 -0700259 if (carrierConfig.getBoolean(CarrierConfigManager.KEY_SHOW_ONSCREEN_DIAL_BUTTON_BOOL)) {
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700260 mDialButton.setOnClickListener(this);
261 } else {
262 mDialButton.setVisibility(View.GONE);
263 }
Tyler Gunn1acf54a2018-03-28 14:15:34 -0700264 mIsWfcEmergencyCallingWarningEnabled = carrierConfig.getInt(
265 CarrierConfigManager.KEY_EMERGENCY_NOTIFICATION_DELAY_INT) > -1;
266 maybeShowWfcEmergencyCallingWarning();
267
Adrian Roosc9fdb6c2015-05-25 15:10:21 -0700268 ViewUtil.setupFloatingActionButton(mDialButton, getResources());
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700269
270 if (icicle != null) {
271 super.onRestoreInstanceState(icicle);
272 }
273
274 // Extract phone number from intent
275 Uri data = getIntent().getData();
Jay Shrauner137458b2014-09-05 14:27:25 -0700276 if (data != null && (PhoneAccount.SCHEME_TEL.equals(data.getScheme()))) {
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700277 String number = PhoneNumberUtils.getNumberFromIntent(getIntent(), this);
278 if (number != null) {
279 mDigits.setText(number);
280 }
281 }
282
283 // if the mToneGenerator creation fails, just continue without it. It is
284 // a local audio signal, and is not as important as the dtmf tone itself.
285 synchronized (mToneGeneratorLock) {
286 if (mToneGenerator == null) {
287 try {
288 mToneGenerator = new ToneGenerator(DIAL_TONE_STREAM_TYPE, TONE_RELATIVE_VOLUME);
289 } catch (RuntimeException e) {
290 Log.w(LOG_TAG, "Exception caught while creating local tone generator: " + e);
291 mToneGenerator = null;
292 }
293 }
294 }
295
296 final IntentFilter intentFilter = new IntentFilter();
297 intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
298 registerReceiver(mBroadcastReceiver, intentFilter);
299
Adrian Roos1c4b47f2015-04-13 14:53:32 -0700300 mEmergencyActionGroup = (EmergencyActionGroup) findViewById(R.id.emergency_action_group);
Chihhang Chuangd301d9a2018-06-05 15:29:06 +0800301
302 mAreEmergencyDialerShortcutsEnabled = Settings.Global.getInt(getContentResolver(),
303 Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED, 0) != 0;
304
305 if (mAreEmergencyDialerShortcutsEnabled) {
306 setupEmergencyShortcutsView();
307 }
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700308 }
309
310 @Override
311 protected void onDestroy() {
312 super.onDestroy();
313 synchronized (mToneGeneratorLock) {
314 if (mToneGenerator != null) {
315 mToneGenerator.release();
316 mToneGenerator = null;
317 }
318 }
319 unregisterReceiver(mBroadcastReceiver);
320 }
321
322 @Override
323 protected void onRestoreInstanceState(Bundle icicle) {
324 mLastNumber = icicle.getString(LAST_NUMBER);
325 }
326
327 @Override
328 protected void onSaveInstanceState(Bundle outState) {
329 super.onSaveInstanceState(outState);
330 outState.putString(LAST_NUMBER, mLastNumber);
331 }
332
333 /**
334 * Explicitly turn off number formatting, since it gets in the way of the emergency
335 * number detector
336 */
337 protected void maybeAddNumberFormatting() {
338 // Do nothing.
339 }
340
341 @Override
342 protected void onPostCreate(Bundle savedInstanceState) {
343 super.onPostCreate(savedInstanceState);
344
345 // This can't be done in onCreate(), since the auto-restoring of the digits
346 // will play DTMF tones for all the old digits if it is when onRestoreSavedInstanceState()
347 // is called. This method will be called every time the activity is created, and
348 // will always happen after onRestoreSavedInstanceState().
349 mDigits.addTextChangedListener(this);
350 }
351
352 private void setupKeypad() {
353 // Setup the listeners for the buttons
354 for (int id : DIALER_KEYS) {
Yorke Lee23a70732014-08-14 17:12:01 -0700355 final DialpadKeyButton key = (DialpadKeyButton) findViewById(id);
356 key.setOnPressedListener(this);
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700357 }
358
359 View view = findViewById(R.id.zero);
360 view.setOnLongClickListener(this);
361 }
362
Chihhang Chuangd301d9a2018-06-05 15:29:06 +0800363 @Override
364 public void onBackPressed() {
365 // If emergency dialer shortcut is enabled and Dialpad view is visible, pressing the
366 // back key will back to display FasterEmergencyDialer view.
367 // Otherwise, it would finish the activity.
368 if (mAreEmergencyDialerShortcutsEnabled && mDialpadView != null
369 && mDialpadView.getVisibility() == View.VISIBLE) {
370 switchView(mEmergencyShortcutView, mDialpadView, true);
371 return;
372 }
373 super.onBackPressed();
374 }
375
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700376 /**
377 * handle key events
378 */
379 @Override
380 public boolean onKeyDown(int keyCode, KeyEvent event) {
381 switch (keyCode) {
382 // Happen when there's a "Call" hard button.
383 case KeyEvent.KEYCODE_CALL: {
384 if (TextUtils.isEmpty(mDigits.getText().toString())) {
385 // if we are adding a call from the InCallScreen and the phone
386 // number entered is empty, we just close the dialer to expose
387 // the InCallScreen under it.
388 finish();
389 } else {
390 // otherwise, we place the call.
391 placeCall();
392 }
393 return true;
394 }
395 }
396 return super.onKeyDown(keyCode, event);
397 }
398
399 private void keyPressed(int keyCode) {
Yorke Lee116dd072015-08-31 11:38:39 -0700400 mDigits.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700401 KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
402 mDigits.onKeyDown(keyCode, event);
403 }
404
405 @Override
406 public boolean onKey(View view, int keyCode, KeyEvent event) {
407 switch (view.getId()) {
408 case R.id.digits:
409 // Happen when "Done" button of the IME is pressed. This can happen when this
410 // Activity is forced into landscape mode due to a desk dock.
411 if (keyCode == KeyEvent.KEYCODE_ENTER
412 && event.getAction() == KeyEvent.ACTION_UP) {
413 placeCall();
414 return true;
415 }
416 break;
417 }
418 return false;
419 }
420
421 @Override
Adrian Roos1c4b47f2015-04-13 14:53:32 -0700422 public boolean dispatchTouchEvent(MotionEvent ev) {
Chihhang Chuang4f2b7812018-06-07 16:25:27 +0800423 onPreTouchEvent(ev);
Adrian Roos1c4b47f2015-04-13 14:53:32 -0700424 boolean handled = super.dispatchTouchEvent(ev);
Chihhang Chuang4f2b7812018-06-07 16:25:27 +0800425 onPostTouchEvent(ev);
Adrian Roos1c4b47f2015-04-13 14:53:32 -0700426 return handled;
427 }
428
429 @Override
Chihhang Chuang4f2b7812018-06-07 16:25:27 +0800430 public void onConfirmClick(EmergencyShortcutButton button) {
431 if (button == null) return;
432
433 String phoneNumber = button.getPhoneNumber();
434
435 if (!TextUtils.isEmpty(phoneNumber)) {
436 Log.d(LOG_TAG, "dial emergency number: " + phoneNumber);
437 TelecomManager tm = (TelecomManager) getSystemService(TELECOM_SERVICE);
438 tm.placeCall(Uri.fromParts(PhoneAccount.SCHEME_TEL, phoneNumber, null), null);
439 } else {
440 Log.d(LOG_TAG, "emergency number is empty");
441 }
442 }
443
444 @Override
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700445 public void onClick(View view) {
446 switch (view.getId()) {
Yorke Lee23a70732014-08-14 17:12:01 -0700447 case R.id.deleteButton: {
448 keyPressed(KeyEvent.KEYCODE_DEL);
449 return;
450 }
451 case R.id.floating_action_button: {
Yorke Lee116dd072015-08-31 11:38:39 -0700452 view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
Yorke Lee23a70732014-08-14 17:12:01 -0700453 placeCall();
454 return;
455 }
456 case R.id.digits: {
457 if (mDigits.length() != 0) {
458 mDigits.setCursorVisible(true);
459 }
460 return;
461 }
Chihhang Chuangd301d9a2018-06-05 15:29:06 +0800462 case R.id.floating_action_button_dialpad: {
463 switchView(mDialpadView, mEmergencyShortcutView, true);
464 return;
465 }
466 case R.id.emergency_info_button: {
467 Intent intent = (Intent) view.getTag(R.id.tag_intent);
468 if (intent != null) {
469 startActivity(intent);
470 }
471 return;
472 }
Yorke Lee23a70732014-08-14 17:12:01 -0700473 }
474 }
475
476 @Override
477 public void onPressed(View view, boolean pressed) {
478 if (!pressed) {
479 return;
480 }
481 switch (view.getId()) {
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700482 case R.id.one: {
483 playTone(ToneGenerator.TONE_DTMF_1);
484 keyPressed(KeyEvent.KEYCODE_1);
485 return;
486 }
487 case R.id.two: {
488 playTone(ToneGenerator.TONE_DTMF_2);
489 keyPressed(KeyEvent.KEYCODE_2);
490 return;
491 }
492 case R.id.three: {
493 playTone(ToneGenerator.TONE_DTMF_3);
494 keyPressed(KeyEvent.KEYCODE_3);
495 return;
496 }
497 case R.id.four: {
498 playTone(ToneGenerator.TONE_DTMF_4);
499 keyPressed(KeyEvent.KEYCODE_4);
500 return;
501 }
502 case R.id.five: {
503 playTone(ToneGenerator.TONE_DTMF_5);
504 keyPressed(KeyEvent.KEYCODE_5);
505 return;
506 }
507 case R.id.six: {
508 playTone(ToneGenerator.TONE_DTMF_6);
509 keyPressed(KeyEvent.KEYCODE_6);
510 return;
511 }
512 case R.id.seven: {
513 playTone(ToneGenerator.TONE_DTMF_7);
514 keyPressed(KeyEvent.KEYCODE_7);
515 return;
516 }
517 case R.id.eight: {
518 playTone(ToneGenerator.TONE_DTMF_8);
519 keyPressed(KeyEvent.KEYCODE_8);
520 return;
521 }
522 case R.id.nine: {
523 playTone(ToneGenerator.TONE_DTMF_9);
524 keyPressed(KeyEvent.KEYCODE_9);
525 return;
526 }
527 case R.id.zero: {
528 playTone(ToneGenerator.TONE_DTMF_0);
529 keyPressed(KeyEvent.KEYCODE_0);
530 return;
531 }
532 case R.id.pound: {
533 playTone(ToneGenerator.TONE_DTMF_P);
534 keyPressed(KeyEvent.KEYCODE_POUND);
535 return;
536 }
537 case R.id.star: {
538 playTone(ToneGenerator.TONE_DTMF_S);
539 keyPressed(KeyEvent.KEYCODE_STAR);
540 return;
541 }
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700542 }
543 }
544
545 /**
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700546 * called for long touch events
547 */
548 @Override
549 public boolean onLongClick(View view) {
550 int id = view.getId();
551 switch (id) {
552 case R.id.deleteButton: {
553 mDigits.getText().clear();
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700554 return true;
555 }
556 case R.id.zero: {
Yorke Lee91311662014-10-24 14:50:45 -0700557 removePreviousDigitIfPossible();
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700558 keyPressed(KeyEvent.KEYCODE_PLUS);
559 return true;
560 }
561 }
562 return false;
563 }
564
565 @Override
Lucas Dupineb9c5702017-05-10 16:57:09 -0700566 protected void onStart() {
567 super.onStart();
568
569 mColorExtractor.addOnColorsChangedListener(this);
Lucas Dupin94b566f2017-05-28 11:45:52 -0700570 GradientColors lockScreenColors = mColorExtractor.getColors(WallpaperManager.FLAG_LOCK,
571 ColorExtractor.TYPE_EXTRA_DARK);
Lucas Dupineb9c5702017-05-10 16:57:09 -0700572 // Do not animate when view isn't visible yet, just set an initial state.
573 mBackgroundGradient.setColors(lockScreenColors, false);
574 updateTheme(lockScreenColors.supportsDarkText());
575 }
576
577 @Override
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700578 protected void onResume() {
579 super.onResume();
580
581 // retrieve the DTMF tone play back setting.
582 mDTMFToneEnabled = Settings.System.getInt(getContentResolver(),
583 Settings.System.DTMF_TONE_WHEN_DIALING, 1) == 1;
584
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700585 // if the mToneGenerator creation fails, just continue without it. It is
586 // a local audio signal, and is not as important as the dtmf tone itself.
587 synchronized (mToneGeneratorLock) {
588 if (mToneGenerator == null) {
589 try {
590 mToneGenerator = new ToneGenerator(AudioManager.STREAM_DTMF,
591 TONE_RELATIVE_VOLUME);
592 } catch (RuntimeException e) {
593 Log.w(LOG_TAG, "Exception caught while creating local tone generator: " + e);
594 mToneGenerator = null;
595 }
596 }
597 }
598
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700599 updateDialAndDeleteButtonStateEnabledAttr();
600 }
601
602 @Override
603 public void onPause() {
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700604 super.onPause();
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700605 }
606
Lucas Dupineb9c5702017-05-10 16:57:09 -0700607 @Override
608 protected void onStop() {
609 super.onStop();
610
611 mColorExtractor.removeOnColorsChangedListener(this);
612 }
613
614 /**
615 * Sets theme based on gradient colors
616 * @param supportsDarkText true if gradient supports dark text
617 */
618 private void updateTheme(boolean supportsDarkText) {
619 if (mSupportsDarkText == supportsDarkText) {
620 return;
621 }
622 mSupportsDarkText = supportsDarkText;
623
624 // We can't change themes after inflation, in this case we'll have to recreate
625 // the whole activity.
626 if (mBackgroundGradient != null) {
627 recreate();
628 return;
629 }
630
631 int vis = getWindow().getDecorView().getSystemUiVisibility();
632 if (supportsDarkText) {
633 vis |= View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
634 vis |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
635 setTheme(R.style.EmergencyDialerThemeDark);
636 } else {
637 vis &= View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
638 vis &= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
639 setTheme(R.style.EmergencyDialerTheme);
640 }
641 getWindow().getDecorView().setSystemUiVisibility(vis);
642 }
643
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700644 /**
645 * place the call, but check to make sure it is a viable number.
646 */
647 private void placeCall() {
648 mLastNumber = mDigits.getText().toString();
Wei Huang6904b142017-04-21 19:06:40 +0900649
650 // Convert into emergency number according to emergency conversion map.
651 // If conversion map is not defined (this is default), this method does
652 // nothing and just returns input number.
653 mLastNumber = PhoneNumberUtils.convertToEmergencyNumber(this, mLastNumber);
654
Yorke Lee36bb2542014-06-05 08:09:52 -0700655 if (PhoneNumberUtils.isLocalEmergencyNumber(this, mLastNumber)) {
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700656 if (DBG) Log.d(LOG_TAG, "placing call to " + mLastNumber);
657
658 // place the call if it is a valid number
659 if (mLastNumber == null || !TextUtils.isGraphic(mLastNumber)) {
660 // There is no number entered.
661 playTone(ToneGenerator.TONE_PROP_NACK);
662 return;
663 }
Tyler Gunnca7dfef2018-03-27 18:50:05 +0000664 TelecomManager tm = (TelecomManager) getSystemService(TELECOM_SERVICE);
665 tm.placeCall(Uri.fromParts(PhoneAccount.SCHEME_TEL, mLastNumber, null), null);
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700666 } else {
667 if (DBG) Log.d(LOG_TAG, "rejecting bad requested number " + mLastNumber);
668
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700669 showDialog(BAD_EMERGENCY_NUMBER_DIALOG);
670 }
Yorke Lee9b341512014-10-17 11:36:41 -0700671 mDigits.getText().delete(0, mDigits.getText().length());
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700672 }
673
674 /**
675 * Plays the specified tone for TONE_LENGTH_MS milliseconds.
676 *
677 * The tone is played locally, using the audio stream for phone calls.
678 * Tones are played only if the "Audible touch tones" user preference
679 * is checked, and are NOT played if the device is in silent mode.
680 *
681 * @param tone a tone code from {@link ToneGenerator}
682 */
683 void playTone(int tone) {
684 // if local tone playback is disabled, just return.
685 if (!mDTMFToneEnabled) {
686 return;
687 }
688
689 // Also do nothing if the phone is in silent mode.
690 // We need to re-check the ringer mode for *every* playTone()
691 // call, rather than keeping a local flag that's updated in
692 // onResume(), since it's possible to toggle silent mode without
693 // leaving the current activity (via the ENDCALL-longpress menu.)
694 AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
695 int ringerMode = audioManager.getRingerMode();
696 if ((ringerMode == AudioManager.RINGER_MODE_SILENT)
697 || (ringerMode == AudioManager.RINGER_MODE_VIBRATE)) {
698 return;
699 }
700
701 synchronized (mToneGeneratorLock) {
702 if (mToneGenerator == null) {
703 Log.w(LOG_TAG, "playTone: mToneGenerator == null, tone: " + tone);
704 return;
705 }
706
707 // Start the new tone (will stop any playing tone)
708 mToneGenerator.startTone(tone, TONE_LENGTH_MS);
709 }
710 }
711
712 private CharSequence createErrorMessage(String number) {
713 if (!TextUtils.isEmpty(number)) {
Hall Liudc274312016-03-01 16:34:45 -0800714 String errorString = getString(R.string.dial_emergency_error, number);
715 int startingPosition = errorString.indexOf(number);
716 int endingPosition = startingPosition + number.length();
717 Spannable result = new SpannableString(errorString);
718 PhoneNumberUtils.addTtsSpan(result, startingPosition, endingPosition);
719 return result;
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700720 } else {
721 return getText(R.string.dial_emergency_empty_error).toString();
722 }
723 }
724
725 @Override
726 protected Dialog onCreateDialog(int id) {
727 AlertDialog dialog = null;
728 if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
729 // construct dialog
Lucas Dupin0d666f92017-06-01 14:04:48 -0700730 dialog = new AlertDialog.Builder(this, R.style.EmergencyDialerAlertDialogTheme)
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700731 .setTitle(getText(R.string.emergency_enable_radio_dialog_title))
732 .setMessage(createErrorMessage(mLastNumber))
733 .setPositiveButton(R.string.ok, null)
734 .setCancelable(true).create();
735
736 // blur stuff behind the dialog
737 dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
Tyler Gunn75638602018-03-29 13:48:29 -0700738 setShowWhenLocked(true);
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700739 }
740 return dialog;
741 }
742
743 @Override
744 protected void onPrepareDialog(int id, Dialog dialog) {
745 super.onPrepareDialog(id, dialog);
746 if (id == BAD_EMERGENCY_NUMBER_DIALOG) {
747 AlertDialog alert = (AlertDialog) dialog;
748 alert.setMessage(createErrorMessage(mLastNumber));
749 }
750 }
751
Andrew Leed5631e82014-10-08 16:03:58 -0700752 @Override
753 public boolean onOptionsItemSelected(MenuItem item) {
754 final int itemId = item.getItemId();
755 if (itemId == android.R.id.home) {
756 onBackPressed();
757 return true;
758 }
759 return super.onOptionsItemSelected(item);
760 }
761
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700762 /**
763 * Update the enabledness of the "Dial" and "Backspace" buttons if applicable.
764 */
765 private void updateDialAndDeleteButtonStateEnabledAttr() {
766 final boolean notEmpty = mDigits.length() != 0;
767
Santos Cordon7d4ddf62013-07-10 11:58:08 -0700768 mDelete.setEnabled(notEmpty);
769 }
Yorke Lee91311662014-10-24 14:50:45 -0700770
771 /**
772 * Remove the digit just before the current position. Used by various long pressed callbacks
773 * to remove the digit that was populated as a result of the short click.
774 */
775 private void removePreviousDigitIfPossible() {
776 final int currentPosition = mDigits.getSelectionStart();
777 if (currentPosition > 0) {
778 mDigits.setSelection(currentPosition);
779 mDigits.getText().delete(currentPosition - 1, currentPosition);
780 }
781 }
Ihab Awadf7c1a5a2014-12-08 19:24:23 -0800782
783 /**
784 * Update the text-to-speech annotations in the edit field.
785 */
786 private void updateTtsSpans() {
787 for (Object o : mDigits.getText().getSpans(0, mDigits.getText().length(), TtsSpan.class)) {
788 mDigits.getText().removeSpan(o);
789 }
790 PhoneNumberUtils.ttsSpanAsPhoneNumber(mDigits.getText(), 0, mDigits.getText().length());
791 }
Lucas Dupineb9c5702017-05-10 16:57:09 -0700792
793 @Override
Lucas Dupin94b566f2017-05-28 11:45:52 -0700794 public void onColorsChanged(ColorExtractor extractor, int which) {
Lucas Dupineb9c5702017-05-10 16:57:09 -0700795 if ((which & WallpaperManager.FLAG_LOCK) != 0) {
Lucas Dupin94b566f2017-05-28 11:45:52 -0700796 GradientColors colors = extractor.getColors(WallpaperManager.FLAG_LOCK,
797 ColorExtractor.TYPE_EXTRA_DARK);
Lucas Dupineb9c5702017-05-10 16:57:09 -0700798 mBackgroundGradient.setColors(colors);
799 updateTheme(colors.supportsDarkText());
800 }
801 }
Tyler Gunn1acf54a2018-03-28 14:15:34 -0700802
803 /**
804 * Where a carrier requires a warning that emergency calling is not available while on WFC,
805 * add hint text above the dial pad which warns the user of this case.
806 */
807 private void maybeShowWfcEmergencyCallingWarning() {
808 if (!mIsWfcEmergencyCallingWarningEnabled) {
809 Log.i(LOG_TAG, "maybeShowWfcEmergencyCallingWarning: warning disabled by carrier.");
810 return;
811 }
812
813 // Use an async task rather than calling into Telephony on UI thread.
814 AsyncTask<Void, Void, Boolean> showWfcWarningTask = new AsyncTask<Void, Void, Boolean>() {
815 @Override
816 protected Boolean doInBackground(Void... voids) {
817 TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
818 boolean isWfcAvailable = tm.isWifiCallingAvailable();
819 ServiceState ss = tm.getServiceState();
820 boolean isCellAvailable =
821 ss.getRilVoiceRadioTechnology() != RIL_RADIO_TECHNOLOGY_UNKNOWN;
822 Log.i(LOG_TAG, "showWfcWarningTask: isWfcAvailable=" + isWfcAvailable
823 + " isCellAvailable=" + isCellAvailable
824 + "(rat=" + ss.getRilVoiceRadioTechnology() + ")");
825 return isWfcAvailable && !isCellAvailable;
826 }
827
828 @Override
829 protected void onPostExecute(Boolean result) {
830 if (result.booleanValue()) {
831 Log.i(LOG_TAG, "showWfcWarningTask: showing ecall warning");
832 mDigits.setHint(R.string.dial_emergency_calling_not_available);
833 } else {
834 Log.i(LOG_TAG, "showWfcWarningTask: hiding ecall warning");
835 mDigits.setHint("");
836 }
837 maybeChangeHintSize();
838 }
839 };
840 showWfcWarningTask.execute((Void) null);
841 }
842
843 /**
844 * Where a hint is applied and there are no digits dialed, disable autoresize of the dial digits
845 * edit view and set the font size to a smaller size appropriate for the emergency calling
846 * warning.
847 */
848 private void maybeChangeHintSize() {
849 if (TextUtils.isEmpty(mDigits.getHint())
850 || !TextUtils.isEmpty(mDigits.getText().toString())) {
851 // No hint or there are dialed digits, so use default size.
852 mDigits.setTextSize(TypedValue.COMPLEX_UNIT_SP, mDefaultDigitsTextSize);
853 // By default, the digits view auto-resizes to fit the text it contains, so
854 // enable that now.
855 mDigits.setResizeEnabled(true);
856 Log.i(LOG_TAG, "no hint - setting to " + mDigits.getScaledTextSize());
857 } else {
858 // Hint present and no dialed digits, set custom font size appropriate for the warning.
859 mDigits.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(
860 R.dimen.emergency_call_warning_size));
861 // Since we're populating this with a static text string, disable auto-resize.
862 mDigits.setResizeEnabled(false);
863 Log.i(LOG_TAG, "hint - setting to " + mDigits.getScaledTextSize());
864 }
865 }
Chihhang Chuangd301d9a2018-06-05 15:29:06 +0800866
867 private void setupEmergencyShortcutsView() {
868 mEmergencyShortcutView = findViewById(R.id.emergency_dialer_shortcuts);
869 mDialpadView = findViewById(R.id.emergency_dialer);
870
871 final View dialpadButton = findViewById(R.id.floating_action_button_dialpad);
872 dialpadButton.setOnClickListener(this);
873
874 final View emergencyInfoButton = findViewById(R.id.emergency_info_button);
875 emergencyInfoButton.setOnClickListener(this);
876
877 // EmergencyActionGroup is replaced by EmergencyInfoGroup.
878 mEmergencyActionGroup.setVisibility(View.GONE);
879
880 // Setup dialpad title.
881 final View emergencyDialpadTitle = findViewById(R.id.emergency_dialpad_title_container);
882 emergencyDialpadTitle.setVisibility(View.VISIBLE);
883
Chihhang Chuang4f2b7812018-06-07 16:25:27 +0800884 // TODO: Integrating emergency phone number table will get location information.
885 // Using null to present no location status.
886 setLocationInfo(null);
887
888 mEmergencyShortcutButtonList = new ArrayList<>();
889 setupEmergencyCallShortcutButton();
890
Chihhang Chuangd301d9a2018-06-05 15:29:06 +0800891 switchView(mEmergencyShortcutView, mDialpadView, false);
892 }
893
Chihhang Chuang4f2b7812018-06-07 16:25:27 +0800894 private void setLocationInfo(String country) {
895 final View locationInfo = findViewById(R.id.location_info);
896
897 if (TextUtils.isEmpty(country)) {
898 locationInfo.setVisibility(View.INVISIBLE);
899 } else {
900 final TextView location = (TextView) locationInfo.findViewById(R.id.location_text);
901 location.setText(country);
902 locationInfo.setVisibility(View.VISIBLE);
903 }
904 }
905
906 // TODO: Integrate emergency phone number table.
907 // Using default layout(no location, phone number is 112, description is Emergency,
908 // and icon is cross shape) until integrating emergency phone number table.
909 private void setupEmergencyCallShortcutButton() {
910 final ViewGroup shortcutButtonContainer = findViewById(
911 R.id.emergency_shortcut_buttons_container);
912 shortcutButtonContainer.setClipToOutline(true);
913
914 final EmergencyShortcutButton button =
915 (EmergencyShortcutButton) getLayoutInflater().inflate(
916 R.layout.emergency_shortcut_button,
917 shortcutButtonContainer, false);
918
919 button.setPhoneNumber("112");
920 button.setPhoneDescription("Emergency");
921 button.setPhoneTypeIcon(R.drawable.ic_emergency_number_24);
922 button.setOnConfirmClickListener(this);
923
924 shortcutButtonContainer.addView(button);
925 mEmergencyShortcutButtonList.add(button);
926
927 //Set emergency number title for numerous buttons.
928 if (shortcutButtonContainer.getChildCount() > 1) {
929 final TextView emergencyNumberTitle = findViewById(R.id.emergency_number_title);
930 emergencyNumberTitle.setText(getString(R.string.numerous_emergency_numbers_title));
931 }
932 }
933
934 /**
935 * Called by the activity before a touch event is dispatched to the view hierarchy.
936 */
937 private void onPreTouchEvent(MotionEvent event) {
938 mEmergencyActionGroup.onPreTouchEvent(event);
939
940 if (mEmergencyShortcutButtonList != null) {
941 for (EmergencyShortcutButton button : mEmergencyShortcutButtonList) {
942 button.onPreTouchEvent(event);
943 }
944 }
945 }
946
947 /**
948 * Called by the activity after a touch event is dispatched to the view hierarchy.
949 */
950 private void onPostTouchEvent(MotionEvent event) {
951 mEmergencyActionGroup.onPostTouchEvent(event);
952
953 if (mEmergencyShortcutButtonList != null) {
954 for (EmergencyShortcutButton button : mEmergencyShortcutButtonList) {
955 button.onPostTouchEvent(event);
956 }
957 }
958 }
959
Chihhang Chuangd301d9a2018-06-05 15:29:06 +0800960 /**
961 * Switch two view.
962 *
963 * @param displayView the view would be displayed.
964 * @param hideView the view would be hidden.
965 * @param hasAnimation is {@code true} when the view should be displayed with animation.
966 */
967 private void switchView(View displayView, View hideView, boolean hasAnimation) {
968 if (displayView == null || hideView == null) {
969 return;
970 }
971
972 if (displayView.getVisibility() == View.VISIBLE) {
973 return;
974 }
975
976 if (hasAnimation) {
977 crossfade(hideView, displayView);
978 } else {
979 hideView.setVisibility(View.GONE);
980 displayView.setVisibility(View.VISIBLE);
981 }
982 }
983
984 /**
985 * Fade out and fade in animation between two view transition.
986 */
987 private void crossfade(View fadeOutView, View fadeInView) {
988 if (fadeOutView == null || fadeInView == null) {
989 return;
990 }
991 final int shortAnimationDuration = getResources().getInteger(
992 android.R.integer.config_shortAnimTime);
993
994 fadeInView.setAlpha(0f);
995 fadeInView.setVisibility(View.VISIBLE);
996
997 fadeInView.animate()
998 .alpha(1f)
999 .setDuration(shortAnimationDuration)
1000 .setListener(null);
1001
1002 fadeOutView.animate()
1003 .alpha(0f)
1004 .setDuration(shortAnimationDuration)
1005 .setListener(new AnimatorListenerAdapter() {
1006 @Override
1007 public void onAnimationEnd(Animator animation) {
1008 fadeOutView.setVisibility(View.GONE);
1009 }
1010 });
1011 }
Santos Cordon7d4ddf62013-07-10 11:58:08 -07001012}