From 575ae388961252a771488c357e425fca191594b2 Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Thu, 16 Jul 2015 11:36:07 -0700 Subject: Add permission prompts for contacts and dialpad search Update the following fragments to handle denied permissions -Contacts Search (Contacts and Location) -Dialpad Search (Phone) Tweak and remove some of the onTouch listener logic as they are no longer valid with the new UI. Instead of intercepting the touches when the query is empty and returning to the main dialer activity, allow the fragments to remain on screen if the permission request UI is showing. Modify signature of onEmptyViewActionButtonClicked to remove unused permissions parameter. Bug: 22174668 Change-Id: I96d00f2ab45df936dca602ac025f723638ac02c4 --- src/com/android/dialer/DialtactsActivity.java | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/com/android/dialer/DialtactsActivity.java') diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 85197a530..98f34b57d 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -103,6 +103,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O DialpadFragment.OnDialpadQueryChangedListener, OnListFragmentScrolledListener, CallLogFragment.HostInterface, + DialpadFragment.HostInterface, ListsFragment.HostInterface, SpeedDialFragment.HostInterface, SearchFragment.HostInterface, @@ -486,8 +487,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } }); - setupActivityOverlay(); - Trace.endSection(); Trace.beginSection(TAG + " initialize smart dialing"); @@ -497,19 +496,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O Trace.endSection(); } - private void setupActivityOverlay() { - final View activityOverlay = findViewById(R.id.activity_overlay); - activityOverlay.setOnTouchListener(new OnTouchListener() { - @Override - public boolean onTouch(View v, MotionEvent event) { - if (!mIsDialpadShown) { - maybeExitSearchUi(); - } - return false; - } - }); - } - @Override protected void onResume() { Trace.beginSection(TAG + " onResume"); @@ -1147,7 +1133,16 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O } catch (Exception ignored) { // Skip any exceptions for this piece of code } + } + @Override + public boolean onDialpadSpacerTouchWithEmptyQuery() { + if (mInDialpadSearch && mSmartDialSearchFragment != null + && !mSmartDialSearchFragment.isShowingPermissionRequest()) { + hideDialpadFragment(true /* animate */, true /* clearDialpad */); + return true; + } + return false; } @Override -- cgit v1.2.3