diff options
author | Yorke Lee <yorkelee@google.com> | 2015-07-16 11:36:07 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-07-17 10:23:33 -0700 |
commit | 575ae388961252a771488c357e425fca191594b2 (patch) | |
tree | 81126e76d811d650cd1b44a59380a14ceb703891 /src/com/android/dialer/dialpad | |
parent | 3cf92c747c54fa44240be5ba78cbc8eb6e3b8cd5 (diff) |
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
Diffstat (limited to 'src/com/android/dialer/dialpad')
-rw-r--r-- | src/com/android/dialer/dialpad/DialpadFragment.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index b18069fdd..d35abd75b 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -135,6 +135,15 @@ public class DialpadFragment extends Fragment void onDialpadQueryChanged(String query); } + public interface HostInterface { + /** + * Notifies the parent activity that the space above the dialpad has been tapped with + * no query in the dialpad present. In most situations this will cause the dialpad to + * be dismissed, unless there happens to be content showing. + */ + boolean onDialpadSpacerTouchWithEmptyQuery(); + } + private static final boolean DEBUG = DialtactsActivity.DEBUG; // This is the amount of screen the dialpad fragment takes up when fully displayed @@ -385,7 +394,9 @@ public class DialpadFragment extends Fragment @Override public boolean onTouch(View v, MotionEvent event) { if (isDigitsEmpty()) { - hideAndClearDialpad(true); + if (getActivity() != null) { + return ((HostInterface) getActivity()).onDialpadSpacerTouchWithEmptyQuery(); + } return true; } return false; |