Merge "Add public API for EuiccService log dump" am: f22d8eac6f
Change-Id: I1dc34f7a657a522826f0a8ed02ae726d9306150e
This commit is contained in:
@@ -7733,6 +7733,7 @@ package android.service.euicc {
|
|||||||
|
|
||||||
public abstract class EuiccService extends android.app.Service {
|
public abstract class EuiccService extends android.app.Service {
|
||||||
ctor public EuiccService();
|
ctor public EuiccService();
|
||||||
|
method public void dump(@NonNull java.io.PrintWriter);
|
||||||
method @CallSuper public android.os.IBinder onBind(android.content.Intent);
|
method @CallSuper public android.os.IBinder onBind(android.content.Intent);
|
||||||
method public abstract int onDeleteSubscription(int, String);
|
method public abstract int onDeleteSubscription(int, String);
|
||||||
method public android.service.euicc.DownloadSubscriptionResult onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean, @Nullable android.os.Bundle);
|
method public android.service.euicc.DownloadSubscriptionResult onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean, @Nullable android.os.Bundle);
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 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 android.service.euicc;
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
oneway interface IEuiccServiceDumpResultCallback {
|
||||||
|
void onComplete(in String logs);
|
||||||
|
}
|
||||||
@@ -34,6 +34,8 @@ import android.telephony.euicc.EuiccInfo;
|
|||||||
import android.telephony.euicc.EuiccManager.OtaStatus;
|
import android.telephony.euicc.EuiccManager.OtaStatus;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
import java.io.StringWriter;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
@@ -582,6 +584,13 @@ public abstract class EuiccService extends Service {
|
|||||||
*/
|
*/
|
||||||
public abstract int onRetainSubscriptionsForFactoryReset(int slotId);
|
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}.
|
* Wrapper around IEuiccService that forwards calls to implementations of {@link EuiccService}.
|
||||||
*/
|
*/
|
||||||
@@ -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.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import android.service.euicc.IOtaStatusChangedCallback;
|
|||||||
import android.service.euicc.IRetainSubscriptionsForFactoryResetCallback;
|
import android.service.euicc.IRetainSubscriptionsForFactoryResetCallback;
|
||||||
import android.service.euicc.ISwitchToSubscriptionCallback;
|
import android.service.euicc.ISwitchToSubscriptionCallback;
|
||||||
import android.service.euicc.IUpdateSubscriptionNicknameCallback;
|
import android.service.euicc.IUpdateSubscriptionNicknameCallback;
|
||||||
|
import android.service.euicc.IEuiccServiceDumpResultCallback;
|
||||||
import android.telephony.euicc.DownloadableSubscription;
|
import android.telephony.euicc.DownloadableSubscription;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
@@ -56,4 +57,5 @@ oneway interface IEuiccService {
|
|||||||
int slotIndex, int options, in IEraseSubscriptionsCallback callback);
|
int slotIndex, int options, in IEraseSubscriptionsCallback callback);
|
||||||
void retainSubscriptionsForFactoryReset(
|
void retainSubscriptionsForFactoryReset(
|
||||||
int slotId, in IRetainSubscriptionsForFactoryResetCallback callback);
|
int slotId, in IRetainSubscriptionsForFactoryResetCallback callback);
|
||||||
|
void dump(in IEuiccServiceDumpResultCallback callback);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user