summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Bird <sbird@cyngn.com>2016-02-03 15:23:53 -0800
committerRichard MacGregor <rmacgregor@cyngn.com>2016-04-08 10:42:50 -0700
commit96733b9865d3a57cd7893e4d2c00ba7546e760bc (patch)
treee04cd21c98b3adcd0126d127dd7567b8a3d12a3f
parent57e3b009c05595617c068c1be0b3fa0a10817576 (diff)
downloadandroid_packages_apps_PhoneCommon-96733b9865d3a57cd7893e4d2c00ba7546e760bc.tar.gz
android_packages_apps_PhoneCommon-96733b9865d3a57cd7893e4d2c00ba7546e760bc.tar.bz2
android_packages_apps_PhoneCommon-96733b9865d3a57cd7893e4d2c00ba7546e760bc.zip
Add Login intent for credits bar
Change-Id: I50b682d854a8a8c0a1b6b80cd29c025fc6416f7b
-rw-r--r--src-ambient/incall/CallMethodHelper.java18
-rw-r--r--src-ambient/incall/CallMethodInfo.java7
-rw-r--r--src/com/android/phone/common/dialpad/DialpadView.java6
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();
}