diff options
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 26 | ||||
-rw-r--r-- | src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java | 3 |
2 files changed, 28 insertions, 1 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index dbff276e5..3ca04df01 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -158,6 +158,8 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O */ private SmartDialSearchFragment mSmartDialSearchFragment; + private boolean mIsVisible; + /** * Animation that slides in. */ @@ -563,6 +565,25 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } @Override + protected void onStart() { + super.onStart(); + mIsVisible = true; + } + + @Override + protected void onStop() { + mIsVisible = false; + super.onStop(); + } + + /** + * Returns true when the Activity is currently visible (between onStart and onStop). + */ + /* package */ boolean isVisible() { + return mIsVisible; + } + + @Override protected void onPause() { if (mClearSearchOnPause) { hideDialpadAndSearchUi(); @@ -576,6 +597,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override protected void onSaveInstanceState(Bundle outState) { + mIsVisible = false; super.onSaveInstanceState(outState); outState.putString(KEY_SEARCH_QUERY, mSearchQuery); outState.putBoolean(KEY_IN_REGULAR_SEARCH_UI, mInRegularSearch); @@ -648,6 +670,10 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O @Override public boolean onMenuItemClick(MenuItem item) { + if (!isVisible()) { + return true; + } + switch (item.getItemId()) { case R.id.menu_history: // Use explicit CallLogActivity intent instead of ACTION_VIEW + diff --git a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java index e0f2a9891..f86fc5539 100644 --- a/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java +++ b/src/com/android/dialer/voicemail/VoicemailPlaybackLayout.java @@ -323,6 +323,7 @@ public class VoicemailPlaybackLayout extends LinearLayout mStateText.setText(getString(R.string.voicemail_playback_error)); } + @Override public void onSpeakerphoneOn(boolean on) { if (on) { mPlaybackSpeakerphone.setImageResource(R.drawable.ic_volume_up_24dp); @@ -360,7 +361,7 @@ public class VoicemailPlaybackLayout extends LinearLayout @Override public void setFetchContentTimeout() { - disableUiElements(); + mStartStopButton.setEnabled(true); mStateText.setText(getString(R.string.voicemail_fetching_timout)); } |