diff options
author | Evan Charlton <evanc@google.com> | 2014-09-11 21:26:37 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-11 21:26:37 +0000 |
commit | dbd311a0364490c2cd72bc9fde09196351749707 (patch) | |
tree | b6b58d49cd471e6f853b0ba4296e81c0ee835db1 | |
parent | 7e22b5a079452264e6d33f3ec28d6bbf9cb19db3 (diff) | |
parent | aa1f22f61ce5f0b1bdca898725956a081cf9ecb9 (diff) |
Merge "Send a broadcast when InCallUI is visible" into lmp-dev
-rw-r--r-- | InCallUI/src/com/android/incallui/InCallPresenter.java | 12 | ||||
-rw-r--r-- | InCallUI/src/com/android/incalluibind/ObjectFactory.java | 27 |
2 files changed, 39 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java index 1d0ec8762..ad78708cc 100644 --- a/InCallUI/src/com/android/incallui/InCallPresenter.java +++ b/InCallUI/src/com/android/incallui/InCallPresenter.java @@ -16,6 +16,7 @@ package com.android.incallui; +import android.Manifest; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; @@ -30,6 +31,8 @@ import android.view.View; import com.google.common.base.Preconditions; +import com.android.incalluibind.ObjectFactory; + import java.util.Collections; import java.util.List; import java.util.Locale; @@ -48,6 +51,9 @@ import java.util.concurrent.CopyOnWriteArrayList; */ public class InCallPresenter implements CallList.Listener, InCallPhoneListener { + private static final String EXTRA_FIRST_TIME_SHOWN = + "com.android.incallui.intent.extra.FIRST_TIME_SHOWN"; + private static InCallPresenter sInCallPresenter; /** @@ -598,6 +604,12 @@ public class InCallPresenter implements CallList.Listener, InCallPhoneListener { } if (showing) { + Intent broadcastIntent = ObjectFactory.getUiReadyBroadcastIntent(); + if (broadcastIntent != null) { + broadcastIntent.putExtra(EXTRA_FIRST_TIME_SHOWN, !mIsActivityPreviouslyStarted); + mContext.sendBroadcast(broadcastIntent, Manifest.permission.READ_PHONE_STATE); + } + mIsActivityPreviouslyStarted = true; } } diff --git a/InCallUI/src/com/android/incalluibind/ObjectFactory.java b/InCallUI/src/com/android/incalluibind/ObjectFactory.java new file mode 100644 index 000000000..5813ce9e6 --- /dev/null +++ b/InCallUI/src/com/android/incalluibind/ObjectFactory.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.incalluibind; + +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; + } +} |