Update ActivityId to implement Parcelable
This API change is safe because all constructors of ActivityId were hidden, so we can mark this class as final and update it to implement the Parcelable interface. Test: atest CtsAssistTestCases:ActivityIdTest Bug: 215589465 Change-Id: I4f233b4cf93e0bdd40ed371fad151e6fe6c104c7
This commit is contained in:
@@ -1380,7 +1380,10 @@ package android.app.ambientcontext {
|
||||
|
||||
package android.app.assist {
|
||||
|
||||
public class ActivityId {
|
||||
public final class ActivityId implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.app.assist.ActivityId> CREATOR;
|
||||
}
|
||||
|
||||
public static class AssistStructure.ViewNode {
|
||||
|
||||
@@ -567,9 +567,13 @@ package android.app.admin {
|
||||
|
||||
package android.app.assist {
|
||||
|
||||
public class ActivityId {
|
||||
public final class ActivityId implements android.os.Parcelable {
|
||||
ctor public ActivityId(int, @Nullable android.os.IBinder);
|
||||
method public int describeContents();
|
||||
method public int getTaskId();
|
||||
method @Nullable public android.os.IBinder getToken();
|
||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||
field @NonNull public static final android.os.Parcelable.Creator<android.app.assist.ActivityId> CREATOR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.os.IBinder;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.service.contentcapture.ContentCaptureService;
|
||||
import android.view.contentcapture.ContentCaptureContext;
|
||||
import android.view.translation.UiTranslationManager;
|
||||
@@ -38,7 +39,8 @@ import com.android.internal.annotations.Immutable;
|
||||
*/
|
||||
@Immutable
|
||||
@SystemApi
|
||||
public class ActivityId {
|
||||
@TestApi
|
||||
public final class ActivityId implements Parcelable {
|
||||
|
||||
/**
|
||||
* The identifier of the task this activity is in.
|
||||
@@ -53,6 +55,7 @@ public class ActivityId {
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public ActivityId(int taskId, @Nullable IBinder activityId) {
|
||||
mTaskId = taskId;
|
||||
mActivityId = activityId;
|
||||
@@ -87,13 +90,39 @@ public class ActivityId {
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void writeToParcel(@NonNull Parcel dest, int parcelableFlags) {
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
dest.writeInt(mTaskId);
|
||||
dest.writeStrongBinder(mActivityId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates {@link ActivityId} instances from parcels.
|
||||
*/
|
||||
@NonNull
|
||||
public static final Parcelable.Creator<ActivityId> CREATOR =
|
||||
new Parcelable.Creator<ActivityId>() {
|
||||
@Override
|
||||
public ActivityId createFromParcel(Parcel parcel) {
|
||||
return new ActivityId(parcel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivityId[] newArray(int size) {
|
||||
return new ActivityId[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ActivityId { taskId = " + mTaskId + ", activityId = " + mActivityId + " }";
|
||||
|
||||
Reference in New Issue
Block a user