diff options
author | Yorke Lee <yorkelee@google.com> | 2014-11-17 17:58:01 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-17 17:58:01 +0000 |
commit | f3e9baec89617ce7fde64f2947734e0a39b7bc09 (patch) | |
tree | 31a54d80f702a3b1c90b98255fa2a8827fb82f91 | |
parent | 8280c02815bcfac43117a68690533716a3b5a936 (diff) | |
parent | d17df980c1ac7bd3711857c623e32d5e7c631f0a (diff) |
am d17df980: am fa14d610: Merge "Add string for redial" into lmp-mr1-dev
* commit 'd17df980c1ac7bd3711857c623e32d5e7c631f0a':
Add string for redial
Move ToneGenerator recreation/release to onStart/onStop
-rw-r--r-- | res/values/strings.xml | 19 | ||||
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 49 |
2 files changed, 46 insertions, 22 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 317e578af..b645f2711 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -538,11 +538,26 @@ [CHAR LIMIT=21] --> <string name="favorites_menu_all_contacts">ALL CONTACTS</string> - <!-- Button text for the "call back" button displayed underneath an entry in the call log. - Tapping causes a call to be placed to the caller represented by the call log entry. + <!-- Button text for the "call back" button displayed underneath an entry in the call log. This + is used to describe the action of calling a phone number that the user previously received + an incoming call from. Tapping causes a call to be placed to the number represented by the + call log entry. [CHAR LIMIT=30] --> <string name="call_log_action_call_back">CALL BACK</string> + <!-- BUTTON text for the "call" button displayed underneath an entry in the call log. This + is used to describe the action of calling a phone number. Tapping causes a call to be + placed to the number represented by the call log entry. + [CHAR LIMIT=30] --> + <string name="call_log_action_redial">CALL</string> + + <!-- BUTTON text for the "redial" button displayed underneath an entry in the call log. This + is used to describe the action of calling a phone number that the user previously made an + outgoing call to. Tapping causes a call to be placed to the number represented by the call + log entry. + [CHAR LIMIT=30] --> + <string name="call_log_action_redial">REDIAL</string> + <!-- Button text for the "video call" button displayed underneath an entry in the call log. Tapping causes a video call to be placed to the caller represented by the call log entry. [CHAR LIMIT=30] --> diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 6daa89cd1..321207682 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -565,6 +565,28 @@ public class DialpadFragment extends Fragment } @Override + public void onStart() { + super.onStart(); + // if the mToneGenerator creation fails, just continue without it. It is + // a local audio signal, and is not as important as the dtmf tone itself. + final long start = System.currentTimeMillis(); + synchronized (mToneGeneratorLock) { + if (mToneGenerator == null) { + try { + mToneGenerator = new ToneGenerator(DIAL_TONE_STREAM_TYPE, TONE_RELATIVE_VOLUME); + } catch (RuntimeException e) { + Log.w(TAG, "Exception caught while creating local tone generator: " + e); + mToneGenerator = null; + } + } + } + final long total = System.currentTimeMillis() - start; + if (total > 50) { + Log.i(TAG, "Time for ToneGenerator creation: " + total); + } + }; + + @Override public void onResume() { super.onResume(); @@ -592,20 +614,6 @@ public class DialpadFragment extends Fragment stopWatch.lap("hptc"); - // if the mToneGenerator creation fails, just continue without it. It is - // a local audio signal, and is not as important as the dtmf tone itself. - synchronized (mToneGeneratorLock) { - if (mToneGenerator == null) { - try { - mToneGenerator = new ToneGenerator(DIAL_TONE_STREAM_TYPE, TONE_RELATIVE_VOLUME); - } catch (RuntimeException e) { - Log.w(TAG, "Exception caught while creating local tone generator: " + e); - mToneGenerator = null; - } - } - } - stopWatch.lap("tg"); - mPressedDialpadKeys.clear(); configureScreenFromIntent(getActivity()); @@ -657,12 +665,6 @@ public class DialpadFragment extends Fragment stopTone(); mPressedDialpadKeys.clear(); - synchronized (mToneGeneratorLock) { - if (mToneGenerator != null) { - mToneGenerator.release(); - mToneGenerator = null; - } - } // TODO: I wonder if we should not check if the AsyncTask that // lookup the last dialed number has completed. mLastNumberDialed = EMPTY_NUMBER; // Since we are going to query again, free stale number. @@ -674,6 +676,13 @@ public class DialpadFragment extends Fragment public void onStop() { super.onStop(); + synchronized (mToneGeneratorLock) { + if (mToneGenerator != null) { + mToneGenerator.release(); + mToneGenerator = null; + } + } + if (mClearDigitsOnStop) { mClearDigitsOnStop = false; clearDialpad(); |