Merge "Update ActivityId to implement Parcelable"
This commit is contained in:
committed by
Android (Google) Code Review
commit
d8ef185f33
@@ -1395,7 +1395,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 {
|
||||
|
||||
@@ -569,9 +569,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