diff options
| -rw-r--r-- | src-ambient/incall/CallMethodHelper.java | 18 | ||||
| -rw-r--r-- | src-ambient/incall/CallMethodInfo.java | 7 | ||||
| -rw-r--r-- | src/com/android/phone/common/dialpad/DialpadView.java | 6 |
3 files changed, 27 insertions, 4 deletions
diff --git a/src-ambient/incall/CallMethodHelper.java b/src-ambient/incall/CallMethodHelper.java index b99ac3f..b055ce3 100644 --- a/src-ambient/incall/CallMethodHelper.java +++ b/src-ambient/incall/CallMethodHelper.java @@ -90,7 +90,7 @@ public class CallMethodHelper { // To prevent multiple broadcasts and force us to wait for all items to be complete // this is the count of callbacks we should get for each item. Increase this if we add more. - private static int EXPECTED_RESULT_CALLBACKS = 9; + private static int EXPECTED_RESULT_CALLBACKS = 10; // Keeps track of the number of callbacks we have from AmbientCore. Reset this to 0 // immediately after all callbacks are accounted for. @@ -451,6 +451,7 @@ public class CallMethodHelper { getCallMethodMimeType(cn); getCallMethodVideoCallableMimeType(cn); getCallMethodAuthenticated(cn); + getLoginIntent(cn); getSettingsIntent(cn); getCreditInfo(cn); getManageCreditsIntent(cn); @@ -754,4 +755,19 @@ public class CallMethodHelper { } }); } + + private static void getLoginIntent(final ComponentName cn) { + getInstance().mInCallApi.getLoginIntent(getInstance().mClient, cn) + .setResultCallback(new ResultCallback<PendingIntentResult>() { + @Override + public void onResult(PendingIntentResult pendingIntentResult) { + CallMethodInfo cmi = getCallMethodIfExists(cn); + if (cmi != null) { + cmi.mLoginIntent = pendingIntentResult.intent; + mCallMethodInfos.put(cn, cmi); + maybeBroadcastToSubscribers(); + } + } + }); + } } diff --git a/src-ambient/incall/CallMethodInfo.java b/src-ambient/incall/CallMethodInfo.java index 602e411..f98e811 100644 --- a/src-ambient/incall/CallMethodInfo.java +++ b/src-ambient/incall/CallMethodInfo.java @@ -70,6 +70,7 @@ public class CallMethodInfo { public PendingIntent mManageCreditIntent; public CreditInfo mProviderCreditInfo; public float mCreditWarn = 0.0f; + public PendingIntent mLoginIntent; private static CallMethodInfo sEmergencyCallMethod; @@ -79,7 +80,8 @@ public class CallMethodInfo { mColor, mStatus, mIsAuthenticated, mMimeType, mVideoCallableMimeType, mSubscriptionButtonText, mCreditButtonText, mT9HintDescription, mSettingsIntent, mBrandIcon, mSingleColorBrandIcon, mBadgeIcon, mLoginIcon, mActionOneIcon, - mActionTwoIcon, pluginResources, mActionOneText, mActionTwoText, mIsInCallProvider); + mActionTwoIcon, pluginResources, mActionOneText, mActionTwoText, mIsInCallProvider, + mLoginIntent); } public static final String TAG = "CallMethodInfo"; @@ -116,7 +118,8 @@ public class CallMethodInfo { && Objects.equal(this.pluginResources, info.pluginResources) && Objects.equal(this.mActionOneText, info.mActionOneText) && Objects.equal(this.mActionTwoText, info.mActionTwoText) - && Objects.equal(this.mIsInCallProvider, info.mIsInCallProvider); + && Objects.equal(this.mIsInCallProvider, info.mIsInCallProvider) + && Objects.equal(this.mLoginIntent, info.mLoginIntent); } return false; } diff --git a/src/com/android/phone/common/dialpad/DialpadView.java b/src/com/android/phone/common/dialpad/DialpadView.java index aae7a43..8d73e82 100644 --- a/src/com/android/phone/common/dialpad/DialpadView.java +++ b/src/com/android/phone/common/dialpad/DialpadView.java @@ -294,7 +294,11 @@ public class DialpadView extends LinearLayout { @Override public void onClick(View view) { try { - p.send(); + if (p != null) { + p.send(); + } else { + Log.wtf(TAG, "The intent we attempted to fire was null"); + } } catch (PendingIntent.CanceledException e) { e.printStackTrace(); } |
