| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.hardware.location; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.SystemApi; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
|
| 24 |
import libcore.util.EmptyArray; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
@SystemApi |
| 36 |
@Deprecated |
| 37 |
public class NanoAppInstanceInfo implements Parcelable { |
| 38 |
private String mPublisher = "Unknown"; |
| 39 |
private String mName = "Unknown"; |
| 40 |
|
| 41 |
private int mHandle; |
| 42 |
private long mAppId; |
| 43 |
private int mAppVersion; |
| 44 |
private int mContexthubId; |
| 45 |
|
| 46 |
private int mNeededReadMemBytes = 0; |
| 47 |
private int mNeededWriteMemBytes = 0; |
| 48 |
private int mNeededExecMemBytes = 0; |
| 49 |
|
| 50 |
private int[] mNeededSensors = EmptyArray.INT; |
| 51 |
private int[] mOutputEvents = EmptyArray.INT; |
| 52 |
|
| 53 |
public NanoAppInstanceInfo() { |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
public NanoAppInstanceInfo(int handle, long appId, int appVersion, int contextHubId) { |
| 60 |
mHandle = handle; |
| 61 |
mAppId = appId; |
| 62 |
mAppVersion = appVersion; |
| 63 |
mContexthubId = contextHubId; |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
public String getPublisher() { |
| 72 |
return mPublisher; |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
public String getName() { |
| 81 |
return mName; |
| 82 |
} |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
public long getAppId() { |
| 90 |
return mAppId; |
| 91 |
} |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
public int getAppVersion() { |
| 99 |
return mAppVersion; |
| 100 |
} |
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
public int getNeededReadMemBytes() { |
| 108 |
return mNeededReadMemBytes; |
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
public int getNeededWriteMemBytes() { |
| 117 |
return mNeededWriteMemBytes; |
| 118 |
} |
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
public int getNeededExecMemBytes() { |
| 126 |
return mNeededExecMemBytes; |
| 127 |
} |
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
@NonNull |
| 135 |
public int[] getNeededSensors() { |
| 136 |
return mNeededSensors; |
| 137 |
} |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
@NonNull |
| 145 |
public int[] getOutputEvents() { |
| 146 |
return mOutputEvents; |
| 147 |
} |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
public int getContexthubId() { |
| 155 |
return mContexthubId; |
| 156 |
} |
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
|
| 163 |
public int getHandle() { |
| 164 |
return mHandle; |
| 165 |
} |
| 166 |
|
| 167 |
private NanoAppInstanceInfo(Parcel in) { |
| 168 |
mPublisher = in.readString(); |
| 169 |
mName = in.readString(); |
| 170 |
|
| 171 |
mHandle = in.readInt(); |
| 172 |
mAppId = in.readLong(); |
| 173 |
mAppVersion = in.readInt(); |
| 174 |
mContexthubId = in.readInt(); |
| 175 |
mNeededReadMemBytes = in.readInt(); |
| 176 |
mNeededWriteMemBytes = in.readInt(); |
| 177 |
mNeededExecMemBytes = in.readInt(); |
| 178 |
|
| 179 |
int neededSensorsLength = in.readInt(); |
| 180 |
mNeededSensors = new int[neededSensorsLength]; |
| 181 |
in.readIntArray(mNeededSensors); |
| 182 |
|
| 183 |
int outputEventsLength = in.readInt(); |
| 184 |
mOutputEvents = new int[outputEventsLength]; |
| 185 |
in.readIntArray(mOutputEvents); |
| 186 |
} |
| 187 |
|
| 188 |
public int describeContents() { |
| 189 |
return 0; |
| 190 |
} |
| 191 |
|
| 192 |
public void writeToParcel(Parcel out, int flags) { |
| 193 |
out.writeString(mPublisher); |
| 194 |
out.writeString(mName); |
| 195 |
|
| 196 |
out.writeInt(mHandle); |
| 197 |
out.writeLong(mAppId); |
| 198 |
out.writeInt(mAppVersion); |
| 199 |
out.writeInt(mContexthubId); |
| 200 |
out.writeInt(mNeededReadMemBytes); |
| 201 |
out.writeInt(mNeededWriteMemBytes); |
| 202 |
out.writeInt(mNeededExecMemBytes); |
| 203 |
|
| 204 |
|
| 205 |
out.writeInt(mNeededSensors.length); |
| 206 |
out.writeIntArray(mNeededSensors); |
| 207 |
out.writeInt(mOutputEvents.length); |
| 208 |
out.writeIntArray(mOutputEvents); |
| 209 |
} |
| 210 |
|
| 211 |
public static final @android.annotation.NonNull Parcelable.Creator<NanoAppInstanceInfo> CREATOR |
| 212 |
= new Parcelable.Creator<NanoAppInstanceInfo>() { |
| 213 |
public NanoAppInstanceInfo createFromParcel(Parcel in) { |
| 214 |
return new NanoAppInstanceInfo(in); |
| 215 |
} |
| 216 |
|
| 217 |
public NanoAppInstanceInfo[] newArray(int size) { |
| 218 |
return new NanoAppInstanceInfo[size]; |
| 219 |
} |
| 220 |
}; |
| 221 |
|
| 222 |
@NonNull |
| 223 |
@Override |
| 224 |
public String toString() { |
| 225 |
String retVal = "handle : " + mHandle; |
| 226 |
retVal += ", Id : 0x" + Long.toHexString(mAppId); |
| 227 |
retVal += ", Version : 0x" + Integer.toHexString(mAppVersion); |
| 228 |
|
| 229 |
return retVal; |
| 230 |
} |
| 231 |
} |