Move android.telecom.Response to internal impl
Resolve the hidden reference to Response in Call and
RespondViaSmsManager by moving the implementation into Telecom.
Flag: Not flaggable; just refactoring the location of the class.
Bug: 308489282
Bug: 311773409
Test: m
Change-Id: Ie610ddafd7e97e39c24ec7721eb9148a4a5c36dc
diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/telecom/Call.java
index 8b9d07d..341d77e 100644
--- a/src/com/android/server/telecom/Call.java
+++ b/src/com/android/server/telecom/Call.java
@@ -58,7 +58,6 @@
import android.telecom.ParcelableConnection;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccountHandle;
-import android.telecom.Response;
import android.telecom.StatusHints;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
@@ -3778,7 +3777,7 @@
Log.d(this, "maybeLoadCannedSmsResponses: starting task to load messages");
mCannedSmsResponsesLoadingStarted = true;
mCallsManager.getRespondViaSmsManager().loadCannedTextMessages(
- new Response<Void, List<String>>() {
+ new CallsManager.Response<Void, List<String>>() {
@Override
public void onResult(Void request, List<String>... result) {
if (result.length > 0) {
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java
index 22d8a02..5231a8a 100755
--- a/src/com/android/server/telecom/CallsManager.java
+++ b/src/com/android/server/telecom/CallsManager.java
@@ -224,6 +224,29 @@
void performAction();
}
+ /**
+ * @hide
+ */
+ public interface Response<IN, OUT> {
+
+ /**
+ * Provide a set of results.
+ *
+ * @param request The original request.
+ * @param result The results.
+ */
+ void onResult(IN request, OUT... result);
+
+ /**
+ * Indicates the inability to provide results.
+ *
+ * @param request The original request.
+ * @param code An integer code indicating the reason for failure.
+ * @param msg A message explaining the reason for failure.
+ */
+ void onError(IN request, int code, String msg);
+ }
+
private static final String TAG = "CallsManager";
/**
diff --git a/src/com/android/server/telecom/RespondViaSmsManager.java b/src/com/android/server/telecom/RespondViaSmsManager.java
index 1d42db4..2dcd093 100644
--- a/src/com/android/server/telecom/RespondViaSmsManager.java
+++ b/src/com/android/server/telecom/RespondViaSmsManager.java
@@ -27,7 +27,6 @@
import android.content.res.Resources;
import android.telecom.Connection;
import android.telecom.Log;
-import android.telecom.Response;
import android.telephony.PhoneNumberUtils;
import android.telephony.SmsManager;
import android.telephony.SubscriptionManager;
@@ -92,7 +91,7 @@
* the main thread.
* @param context The context.
*/
- public void loadCannedTextMessages(final Response<Void, List<String>> response,
+ public void loadCannedTextMessages(final CallsManager.Response<Void, List<String>> response,
final Context context) {
new Thread() {
@Override