From 71afa1c7d1e1f49af56c24bdc64d30d80cf1ea68 Mon Sep 17 00:00:00 2001 From: Evan Charlton Date: Tue, 16 Sep 2014 09:18:40 -0700 Subject: Pass Context to InCall ObjectFactory When calling InCall's ObjectFactory to create Intents, pass along the current Context. Bug: 17523252 Change-Id: I301df3c046d6e2bd5ddf4b3501a567cd23c0471f --- InCallUI/src/com/android/incallui/CallCardPresenter.java | 2 +- InCallUI/src/com/android/incallui/InCallPresenter.java | 2 +- InCallUI/src/com/android/incalluibind/ObjectFactory.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 3baa07267..b8189a7c7 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -352,7 +352,7 @@ public class CallCardPresenter extends Presenter } public void onCallStateButtonTouched() { - Intent broadcastIntent = ObjectFactory.getCallStateButtonBroadcastIntent(); + Intent broadcastIntent = ObjectFactory.getCallStateButtonBroadcastIntent(mContext); if (broadcastIntent != null) { Log.d(this, "Sending call state button broadcast: ", broadcastIntent); mContext.sendBroadcast(broadcastIntent, Manifest.permission.READ_PHONE_STATE); diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index 3342c7d6b..c7a512266 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -603,7 +603,7 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener { mProximitySensor.onInCallShowing(showing); } - Intent broadcastIntent = ObjectFactory.getUiReadyBroadcastIntent(); + Intent broadcastIntent = ObjectFactory.getUiReadyBroadcastIntent(mContext); if (broadcastIntent != null) { broadcastIntent.putExtra(EXTRA_FIRST_TIME_SHOWN, !mIsActivityPreviouslyStarted); diff --git a/InCallUI/src/com/android/incalluibind/ObjectFactory.java b/InCallUI/src/com/android/incalluibind/ObjectFactory.java index c64e98efb..a2adc102f 100644 --- a/InCallUI/src/com/android/incalluibind/ObjectFactory.java +++ b/InCallUI/src/com/android/incalluibind/ObjectFactory.java @@ -16,16 +16,17 @@ package com.android.incalluibind; +import android.content.Context; import android.content.Intent; public class ObjectFactory { /** @return An {@link Intent} to be broadcast when the InCallUI is visible. */ - public static Intent getUiReadyBroadcastIntent() { return null; } + public static Intent getUiReadyBroadcastIntent(Context context) { return null; } /** * @return An {@link Intent} to be broadcast when the call state button in the InCallUI is * touched while in a call. */ - public static Intent getCallStateButtonBroadcastIntent() { return null; } + public static Intent getCallStateButtonBroadcastIntent(Context context) { return null; } } -- cgit v1.2.3