summaryrefslogtreecommitdiff
path: root/telephony/java/android/service
diff options
context:
space:
mode:
authorAlex Lin <wwl@google.com>2019-11-05 12:52:11 -0800
committerAlex Lin <wwl@google.com>2020-01-31 14:05:58 -0800
commitd0c492f00f10627886d4ad31e0618c77b69ca7e5 (patch)
treeb365dea105838a04f48356efca0ecc9a22afde1e /telephony/java/android/service
parent62eb925376a79ee73af9a8c842ab14ccc07f36a2 (diff)
Add public API for EuiccService log dump
Add public APi to EuiccService which allows the connected LPA to dump out the logs when a bug report is triggered. Bug: 62881779 Test: manually tested by extracting bug report to see if the logs are present and atest EuiccServiceTest Change-Id: I0869b95d12ab87a5e2a255015549191040d9daa7 Merged-In: I0869b95d12ab87a5e2a255015549191040d9daa7
Diffstat (limited to 'telephony/java/android/service')
-rw-r--r--telephony/java/android/service/euicc/EuiccService.java26
-rw-r--r--telephony/java/android/service/euicc/IEuiccService.aidl2
2 files changed, 28 insertions, 0 deletions
diff --git a/telephony/java/android/service/euicc/EuiccService.java b/telephony/java/android/service/euicc/EuiccService.java
index bc6a9e848e2a..ef11f469d9a0 100644
--- a/telephony/java/android/service/euicc/EuiccService.java
+++ b/telephony/java/android/service/euicc/EuiccService.java
@@ -34,6 +34,8 @@ import android.telephony.euicc.EuiccInfo;
import android.telephony.euicc.EuiccManager.OtaStatus;
import android.util.Log;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.concurrent.LinkedBlockingQueue;
@@ -583,6 +585,13 @@ public abstract class EuiccService extends Service {
public abstract int onRetainSubscriptionsForFactoryReset(int slotId);
/**
+ * Dump to a provided printWriter.
+ */
+ public void dump(@NonNull PrintWriter printWriter) {
+ printWriter.println("The connected LPA does not implement EuiccService#dump()");
+ }
+
+ /**
* Wrapper around IEuiccService that forwards calls to implementations of {@link EuiccService}.
*/
private class IEuiccServiceWrapper extends IEuiccService.Stub {
@@ -834,5 +843,22 @@ public abstract class EuiccService extends Service {
}
});
}
+
+ @Override
+ public void dump(IEuiccServiceDumpResultCallback callback) throws RemoteException {
+ mExecutor.execute(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ final StringWriter sw = new StringWriter();
+ final PrintWriter pw = new PrintWriter(sw);
+ EuiccService.this.dump(pw);
+ callback.onComplete(sw.toString());
+ } catch (RemoteException e) {
+ // Can't communicate with the phone process; ignore.
+ }
+ }
+ });
+ }
}
}
diff --git a/telephony/java/android/service/euicc/IEuiccService.aidl b/telephony/java/android/service/euicc/IEuiccService.aidl
index 2acc47aae919..bb7b569f17f9 100644
--- a/telephony/java/android/service/euicc/IEuiccService.aidl
+++ b/telephony/java/android/service/euicc/IEuiccService.aidl
@@ -29,6 +29,7 @@ import android.service.euicc.IOtaStatusChangedCallback;
import android.service.euicc.IRetainSubscriptionsForFactoryResetCallback;
import android.service.euicc.ISwitchToSubscriptionCallback;
import android.service.euicc.IUpdateSubscriptionNicknameCallback;
+import android.service.euicc.IEuiccServiceDumpResultCallback;
import android.telephony.euicc.DownloadableSubscription;
import android.os.Bundle;
@@ -56,4 +57,5 @@ oneway interface IEuiccService {
int slotIndex, int options, in IEraseSubscriptionsCallback callback);
void retainSubscriptionsForFactoryReset(
int slotId, in IRetainSubscriptionsForFactoryResetCallback callback);
+ void dump(in IEuiccServiceDumpResultCallback callback);
} \ No newline at end of file