| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app; |
| 18 |
|
| 19 |
import android.content.Intent; |
| 20 |
import android.os.Parcel; |
| 21 |
import android.os.Parcelable; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public class ServiceStartArgs implements Parcelable { |
| 28 |
final public boolean taskRemoved; |
| 29 |
final public int startId; |
| 30 |
final public int flags; |
| 31 |
final public Intent args; |
| 32 |
|
| 33 |
public ServiceStartArgs(boolean _taskRemoved, int _startId, int _flags, Intent _args) { |
| 34 |
taskRemoved = _taskRemoved; |
| 35 |
startId = _startId; |
| 36 |
flags = _flags; |
| 37 |
args = _args; |
| 38 |
} |
| 39 |
|
| 40 |
public String toString() { |
| 41 |
return "ServiceStartArgs{taskRemoved=" + taskRemoved + ", startId=" + startId |
| 42 |
+ ", flags=0x" + Integer.toHexString(flags) + ", args=" + args + "}"; |
| 43 |
} |
| 44 |
|
| 45 |
public int describeContents() { |
| 46 |
return 0; |
| 47 |
} |
| 48 |
|
| 49 |
public void writeToParcel(Parcel out, int flags) { |
| 50 |
out.writeInt(taskRemoved ? 1 : 0); |
| 51 |
out.writeInt(startId); |
| 52 |
out.writeInt(flags); |
| 53 |
if (args != null) { |
| 54 |
out.writeInt(1); |
| 55 |
args.writeToParcel(out, 0); |
| 56 |
} else { |
| 57 |
out.writeInt(0); |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
public static final @android.annotation.NonNull Parcelable.Creator<ServiceStartArgs> CREATOR |
| 62 |
= new Parcelable.Creator<ServiceStartArgs>() { |
| 63 |
public ServiceStartArgs createFromParcel(Parcel in) { |
| 64 |
return new ServiceStartArgs(in); |
| 65 |
} |
| 66 |
|
| 67 |
public ServiceStartArgs[] newArray(int size) { |
| 68 |
return new ServiceStartArgs[size]; |
| 69 |
} |
| 70 |
}; |
| 71 |
|
| 72 |
public ServiceStartArgs(Parcel in) { |
| 73 |
taskRemoved = in.readInt() != 0; |
| 74 |
startId = in.readInt(); |
| 75 |
flags = in.readInt(); |
| 76 |
if (in.readInt() != 0) { |
| 77 |
args = Intent.CREATOR.createFromParcel(in); |
| 78 |
} else { |
| 79 |
args = null; |
| 80 |
} |
| 81 |
} |
| 82 |
} |