diff options
author | mike dooley <mdooley@google.com> | 2016-03-18 02:47:41 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-03-18 02:47:41 +0000 |
commit | 3023298a09f00b57fee6c2a3bc15c85294fa6ca4 (patch) | |
tree | aaa08f7859f8c081a68e156e318562474f69844a /InCallUI | |
parent | 301a724210cf9ed69b68c5cab92e87a7cccb73f4 (diff) | |
parent | 624f6c457596d40eff7756920e315faecaa1e075 (diff) |
Merge "Fixing bug that prevented \'Emergency call\' from being displayed" into nyc-dev
am: 624f6c4
* commit '624f6c457596d40eff7756920e315faecaa1e075':
Fixing bug that prevented 'Emergency call' from being displayed
Diffstat (limited to 'InCallUI')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java b/InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java index 6dbbfc1fb..2839fbbf0 100644 --- a/InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java +++ b/InCallUI/src/com/android/incallui/CallerInfoAsyncQuery.java @@ -352,12 +352,13 @@ public class CallerInfoAsyncQuery { @Override public void onQueryComplete(int token, Object cookie, CallerInfo ci) { Log.d(LOG_TAG, "contactsProviderQueryCompleteListener done"); - if (ci != null && ci.contactExists) { - if (listener != null) { + // If there are no other directory queries, make sure that the listener is + // notified of this result. see b/27621628 + if ((ci != null && ci.contactExists) || + !startOtherDirectoriesQuery(token, context, info, listener, cookie)) { + if (listener != null && ci != null) { listener.onQueryComplete(token, cookie, ci); } - } else { - startOtherDirectoriesQuery(token, context, info, listener, cookie); } } }; @@ -420,15 +421,13 @@ public class CallerInfoAsyncQuery { return c; } - private static void startOtherDirectoriesQuery(int token, Context context, CallerInfo info, + // Return value indicates if listener was notified. + private static boolean startOtherDirectoriesQuery(int token, Context context, CallerInfo info, OnQueryCompleteListener listener, Object cookie) { long[] directoryIds = getDirectoryIds(context); int size = directoryIds.length; if (size == 0) { - if (listener != null) { - listener.onQueryComplete(token, cookie, info); - } - return; + return false; } DirectoryQueryCompleteListenerFactory listenerFactory = @@ -448,6 +447,7 @@ public class CallerInfoAsyncQuery { listenerFactory.newListener(directoryId); startQueryInternal(token, context, info, intermediateListener, cookie, uri); } + return true; } /* Directory lookup related code - START */ |