From 23dc241d5e4641ee2acd4b5f7865c66d9f58c9f1 Mon Sep 17 00:00:00 2001 From: Evan Charlton Date: Wed, 3 Sep 2014 10:07:03 -0700 Subject: [PATCH] Remove startActivityFromInCall API Rip out the startActivityFromInCall API until we can replace it with something better. Bug: 16988478 Change-Id: Ib7b0493353262d9e795d78b78a98dd29e7a3f88e --- api/current.txt | 6 ++---- telecomm/java/android/telecomm/Call.java | 19 ----------------- .../java/android/telecomm/Connection.java | 15 ------------- .../android/telecomm/ConnectionService.java | 6 ------ .../telecomm/ConnectionServiceAdapter.java | 9 -------- .../ConnectionServiceAdapterServant.java | 21 +------------------ .../java/android/telecomm/InCallService.java | 18 ---------------- telecomm/java/android/telecomm/Phone.java | 8 ------- .../android/telecomm/RemoteConnection.java | 17 --------------- .../telecomm/RemoteConnectionService.java | 6 ------ .../telecomm/IConnectionServiceAdapter.aidl | 2 -- .../internal/telecomm/IInCallService.aidl | 2 -- 12 files changed, 3 insertions(+), 126 deletions(-) diff --git a/api/current.txt b/api/current.txt index 5607d08af5968..9c1c2b4e1f80b 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28241,7 +28241,6 @@ package android.telecomm { method public final void setRequestingRingback(boolean); method public final void setRinging(); method public final void setStatusHints(android.telecomm.StatusHints); - method public final void startActivityFromInCall(android.app.PendingIntent); method public static java.lang.String stateToString(int); field public static final int STATE_ACTIVE = 4; // 0x4 field public static final int STATE_DIALING = 3; // 0x3 @@ -28419,7 +28418,6 @@ package android.telecomm { method public void onParentChanged(android.telecomm.RemoteConnection, android.telecomm.RemoteConnection); method public void onPostDialWait(android.telecomm.RemoteConnection, java.lang.String); method public void onRequestingRingback(android.telecomm.RemoteConnection, boolean); - method public void onStartActivityFromInCall(android.telecomm.RemoteConnection, android.app.PendingIntent); method public void onStateChanged(android.telecomm.RemoteConnection, int); method public void onStatusHintsChanged(android.telecomm.RemoteConnection, android.telecomm.StatusHints); } @@ -28850,6 +28848,8 @@ package android.telephony { method public void updateMmsSendStatus(int, boolean); method public void updateSmsSendStatus(int, boolean); method public boolean updateStoredMessageStatus(android.net.Uri, android.content.ContentValues); + field public static final java.lang.String MESSAGE_STATUS_READ = "read"; + field public static final java.lang.String MESSAGE_STATUS_SEEN = "seen"; field public static final java.lang.String MMS_CONFIG_ALIAS_ENABLED = "aliasEnabled"; field public static final java.lang.String MMS_CONFIG_ALIAS_MAX_CHARS = "aliasMaxChars"; field public static final java.lang.String MMS_CONFIG_ALIAS_MIN_CHARS = "aliasMinChars"; @@ -28878,8 +28878,6 @@ package android.telephony { field public static final java.lang.String MMS_CONFIG_UA_PROF_TAG_NAME = "uaProfTagName"; field public static final java.lang.String MMS_CONFIG_UA_PROF_URL = "uaProfUrl"; field public static final java.lang.String MMS_CONFIG_USER_AGENT = "userAgent"; - field public static final java.lang.String MESSAGE_STATUS_READ = "read"; - field public static final java.lang.String MESSAGE_STATUS_SEEN = "seen"; field public static final int MMS_ERROR_HTTP_FAILURE = 4; // 0x4 field public static final int MMS_ERROR_INVALID_APN = 2; // 0x2 field public static final int MMS_ERROR_UNABLE_CONNECT_MMS = 3; // 0x3 diff --git a/telecomm/java/android/telecomm/Call.java b/telecomm/java/android/telecomm/Call.java index 7c596c1fcc092..5bf0855667166 100644 --- a/telecomm/java/android/telecomm/Call.java +++ b/telecomm/java/android/telecomm/Call.java @@ -346,14 +346,6 @@ public final class Call { */ public void onVideoCallChanged(Call call, InCallService.VideoCall videoCall) {} - /** - * Launches an activity for this connection on top of the in-call UI. - * - * @param call The {@code Call} invoking this method. - * @param intent The intent to use to start the activity. - */ - public void onStartActivity(Call call, PendingIntent intent) {} - /** * Invoked when the {@code Call} is destroyed. Clients should refrain from cleaning * up their UI for the {@code Call} in response to state transitions. Specifically, @@ -752,11 +744,6 @@ public final class Call { firePostDialWait(mRemainingPostDialSequence); } - /** {@hide} */ - final void internalStartActivity(PendingIntent intent) { - fireStartActivity(intent); - } - /** {@hide} */ final void internalSetDisconnected() { if (mState != Call.STATE_DISCONNECTED) { @@ -809,12 +796,6 @@ public final class Call { } } - private void fireStartActivity(PendingIntent intent) { - for (Listener listener : mListeners) { - listener.onStartActivity(this, intent); - } - } - private void fireCallDestroyed() { for (Listener listener : mListeners) { listener.onCallDestroyed(this); diff --git a/telecomm/java/android/telecomm/Connection.java b/telecomm/java/android/telecomm/Connection.java index f3496593b7a6d..4d6e267c668fd 100644 --- a/telecomm/java/android/telecomm/Connection.java +++ b/telecomm/java/android/telecomm/Connection.java @@ -81,7 +81,6 @@ public abstract class Connection { Connection c, VideoProvider videoProvider) {} public void onAudioModeIsVoipChanged(Connection c, boolean isVoip) {} public void onStatusHintsChanged(Connection c, StatusHints statusHints) {} - public void onStartActivityFromInCall(Connection c, PendingIntent intent) {} public void onConferenceableConnectionsChanged( Connection c, List conferenceableConnections) {} public void onConferenceChanged(Connection c, Conference conference) {} @@ -941,20 +940,6 @@ public abstract class Connection { } } - /** - * Launches an activity for this connection on top of the in-call UI. - * - * @param intent The intent to use to start the activity. - */ - public final void startActivityFromInCall(PendingIntent intent) { - if (!intent.isActivity()) { - throw new IllegalArgumentException("Activity intent required."); - } - for (Listener l : mListeners) { - l.onStartActivityFromInCall(this, intent); - } - } - /** * Notifies this Connection that the {@link #getAudioState()} property has a new value. * diff --git a/telecomm/java/android/telecomm/ConnectionService.java b/telecomm/java/android/telecomm/ConnectionService.java index 19cf6229a0866..17826bdd6281c 100644 --- a/telecomm/java/android/telecomm/ConnectionService.java +++ b/telecomm/java/android/telecomm/ConnectionService.java @@ -462,12 +462,6 @@ public abstract class ConnectionService extends Service { mAdapter.setStatusHints(id, statusHints); } - @Override - public void onStartActivityFromInCall(Connection c, PendingIntent intent) { - String id = mIdByConnection.get(c); - mAdapter.startActivityFromInCall(id, intent); - } - @Override public void onConferenceableConnectionsChanged( Connection connection, List conferenceableConnections) { diff --git a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java index cb6364660a687..e3dc71389162e 100644 --- a/telecomm/java/android/telecomm/ConnectionServiceAdapter.java +++ b/telecomm/java/android/telecomm/ConnectionServiceAdapter.java @@ -346,13 +346,4 @@ final class ConnectionServiceAdapter implements DeathRecipient { } } } - - void startActivityFromInCall(String callId, PendingIntent intent) { - for (IConnectionServiceAdapter adapter : mAdapters) { - try { - adapter.startActivityFromInCall(callId, intent); - } catch (RemoteException e) { - } - } - } } diff --git a/telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java index 0e1c516a042e8..21e99db0e61bf 100644 --- a/telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java +++ b/telecomm/java/android/telecomm/ConnectionServiceAdapterServant.java @@ -57,8 +57,7 @@ final class ConnectionServiceAdapterServant { private static final int MSG_SET_STATUS_HINTS = 17; private static final int MSG_SET_HANDLE = 18; private static final int MSG_SET_CALLER_DISPLAY_NAME = 19; - private static final int MSG_START_ACTIVITY_FROM_IN_CALL = 20; - private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 21; + private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20; private final IConnectionServiceAdapter mDelegate; @@ -192,16 +191,6 @@ final class ConnectionServiceAdapterServant { } break; } - case MSG_START_ACTIVITY_FROM_IN_CALL: { - SomeArgs args = (SomeArgs) msg.obj; - try { - mDelegate.startActivityFromInCall( - (String) args.arg1, (PendingIntent) args.arg2); - } finally { - args.recycle(); - } - break; - } case MSG_SET_CONFERENCEABLE_CONNECTIONS: { SomeArgs args = (SomeArgs) msg.obj; try { @@ -351,14 +340,6 @@ final class ConnectionServiceAdapterServant { mHandler.obtainMessage(MSG_SET_CALLER_DISPLAY_NAME, args).sendToTarget(); } - @Override - public final void startActivityFromInCall(String connectionId, PendingIntent intent) { - SomeArgs args = SomeArgs.obtain(); - args.arg1 = connectionId; - args.arg2 = intent; - mHandler.obtainMessage(MSG_START_ACTIVITY_FROM_IN_CALL, args).sendToTarget(); - } - @Override public final void setConferenceableConnections( String connectionId, List conferenceableConnectionIds) { diff --git a/telecomm/java/android/telecomm/InCallService.java b/telecomm/java/android/telecomm/InCallService.java index cbcee752098c5..0b009fa3e46a4 100644 --- a/telecomm/java/android/telecomm/InCallService.java +++ b/telecomm/java/android/telecomm/InCallService.java @@ -55,7 +55,6 @@ public abstract class InCallService extends Service { private static final int MSG_SET_POST_DIAL_WAIT = 4; private static final int MSG_ON_AUDIO_STATE_CHANGED = 5; private static final int MSG_BRING_TO_FOREGROUND = 6; - private static final int MSG_START_ACTIVITY = 7; /** Default Handler used to consolidate binder method calls onto a single thread. */ private final Handler mHandler = new Handler(Looper.getMainLooper()) { @@ -89,15 +88,6 @@ public abstract class InCallService extends Service { case MSG_BRING_TO_FOREGROUND: mPhone.internalBringToForeground(msg.arg1 == 1); break; - case MSG_START_ACTIVITY: - SomeArgs args = (SomeArgs) msg.obj; - try { - mPhone.internalStartActivity( - (String) args.arg1, (PendingIntent) args.arg2); - } finally { - args.recycle(); - } - break; default: break; } @@ -143,14 +133,6 @@ public abstract class InCallService extends Service { public void bringToForeground(boolean showDialpad) { mHandler.obtainMessage(MSG_BRING_TO_FOREGROUND, showDialpad ? 1 : 0, 0).sendToTarget(); } - - @Override - public void startActivity(String callId, PendingIntent intent) { - SomeArgs args = SomeArgs.obtain(); - args.arg1 = callId; - args.arg2 = intent; - mHandler.obtainMessage(MSG_START_ACTIVITY, args).sendToTarget(); - } } private Phone mPhone; diff --git a/telecomm/java/android/telecomm/Phone.java b/telecomm/java/android/telecomm/Phone.java index d90d9549802f0..8831f8f00fc4c 100644 --- a/telecomm/java/android/telecomm/Phone.java +++ b/telecomm/java/android/telecomm/Phone.java @@ -150,14 +150,6 @@ public final class Phone { fireBringToForeground(showDialpad); } - /** {@hide} */ - final void internalStartActivity(String telecommId, PendingIntent intent) { - Call call = mCallByTelecommCallId.get(telecommId); - if (call != null) { - call.internalStartActivity(intent); - } - } - /** * Called to destroy the phone and cleanup any lingering calls. * @hide diff --git a/telecomm/java/android/telecomm/RemoteConnection.java b/telecomm/java/android/telecomm/RemoteConnection.java index b7e4b2aa689ad..31afb4b67674a 100644 --- a/telecomm/java/android/telecomm/RemoteConnection.java +++ b/telecomm/java/android/telecomm/RemoteConnection.java @@ -162,16 +162,6 @@ public final class RemoteConnection { */ public void onVideoStateChanged(RemoteConnection connection, int videoState) {} - /** - * Indicates that this {@code RemoteConnection} is requesting that the in-call UI - * launch the specified activity. - * - * @param connection The {@code RemoteConnection} invoking this method. - * @param intent A {@link PendingIntent} that the {@code RemoteConnection} wishes to - * have launched on its behalf. - */ - public void onStartActivityFromInCall(RemoteConnection connection, PendingIntent intent) {} - /** * Indicates that this {@code RemoteConnection} has been destroyed. No further requests * should be made to the {@code RemoteConnection}, and references to it should be cleared. @@ -728,13 +718,6 @@ public final class RemoteConnection { } } - /** @hide */ - void startActivityFromInCall(PendingIntent intent) { - for (Listener l : mListeners) { - l.onStartActivityFromInCall(this, intent); - } - } - /** @hide */ void setConferenceableConnections(List conferenceableConnections) { mConferenceableConnections.clear(); diff --git a/telecomm/java/android/telecomm/RemoteConnectionService.java b/telecomm/java/android/telecomm/RemoteConnectionService.java index 51722fe254954..0b6badbb2d3a3 100644 --- a/telecomm/java/android/telecomm/RemoteConnectionService.java +++ b/telecomm/java/android/telecomm/RemoteConnectionService.java @@ -260,12 +260,6 @@ final class RemoteConnectionService { .setCallerDisplayName(callerDisplayName, presentation); } - @Override - public void startActivityFromInCall(String callId, PendingIntent intent) { - findConnectionForAction(callId, "startActivityFromInCall") - .startActivityFromInCall(intent); - } - @Override public IBinder asBinder() { throw new UnsupportedOperationException(); diff --git a/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl index ef1769fdc16a7..610178e9ff02b 100644 --- a/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl +++ b/telecomm/java/com/android/internal/telecomm/IConnectionServiceAdapter.aidl @@ -76,6 +76,4 @@ oneway interface IConnectionServiceAdapter { void setCallerDisplayName(String callId, String callerDisplayName, int presentation); void setConferenceableConnections(String callId, in List conferenceableCallIds); - - void startActivityFromInCall(String callId, in PendingIntent intent); } diff --git a/telecomm/java/com/android/internal/telecomm/IInCallService.aidl b/telecomm/java/com/android/internal/telecomm/IInCallService.aidl index 5d4992f652307..23dbaf47025cb 100644 --- a/telecomm/java/com/android/internal/telecomm/IInCallService.aidl +++ b/telecomm/java/com/android/internal/telecomm/IInCallService.aidl @@ -43,6 +43,4 @@ oneway interface IInCallService { void onAudioStateChanged(in AudioState audioState); void bringToForeground(boolean showDialpad); - - void startActivity(String callId, in PendingIntent intent); }