Beispiel #1
0
 public static void writeToParcel(Parcel out, Map obj) {
   if (obj != null) {
     out.writeInt(EXIST_SEPARATOR);
     out.writeMap(obj);
   } else {
     out.writeInt(NON_SEPARATOR);
   }
 }
  @Test
  public void testReadWriteMap() throws Exception {
    HashMap<String, String> original = new HashMap<String, String>();
    original.put("key", "value");
    parcel.writeMap(original);
    HashMap<String, String> rehydrated = parcel.readHashMap(null);

    assertEquals("value", rehydrated.get("key"));
  }
 public void writeToParcel(Parcel dest, int flags) {
   dest.writeInt(mStatus);
   dest.writeString(mStatusText);
   dest.writeByteArray(mAvatarData);
   dest.writeString(mAvatarType);
   dest.writeInt(mClientType);
   dest.writeMap(mExtendedInfo);
   dest.writeString(mResource);
 }
 public final void bindApplication(
     String packageName,
     ApplicationInfo info,
     List<ProviderInfo> providers,
     ComponentName testName,
     String profileName,
     ParcelFileDescriptor profileFd,
     boolean autoStopProfiler,
     Bundle testArgs,
     IInstrumentationWatcher testWatcher,
     int debugMode,
     boolean restrictedBackupMode,
     boolean persistent,
     Configuration config,
     CompatibilityInfo compatInfo,
     Map<String, IBinder> services,
     Bundle coreSettings)
     throws RemoteException {
   Parcel data = Parcel.obtain();
   data.writeInterfaceToken(IApplicationThread.descriptor);
   data.writeString(packageName);
   info.writeToParcel(data, 0);
   data.writeTypedList(providers);
   if (testName == null) {
     data.writeInt(0);
   } else {
     data.writeInt(1);
     testName.writeToParcel(data, 0);
   }
   data.writeString(profileName);
   if (profileFd != null) {
     data.writeInt(1);
     profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
   } else {
     data.writeInt(0);
   }
   data.writeInt(autoStopProfiler ? 1 : 0);
   data.writeBundle(testArgs);
   data.writeStrongInterface(testWatcher);
   data.writeInt(debugMode);
   data.writeInt(restrictedBackupMode ? 1 : 0);
   data.writeInt(persistent ? 1 : 0);
   config.writeToParcel(data, 0);
   compatInfo.writeToParcel(data, 0);
   data.writeMap(services);
   data.writeBundle(coreSettings);
   mRemote.transact(BIND_APPLICATION_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
   data.recycle();
 }
 @Override
 public void writeToParcel(Parcel dest, int arg1) {
   dest.writeInt(geometryType);
   dest.writeInt(horizontalAlign);
   dest.writeInt(index);
   dest.writeMap(itemData);
   dest.writeInt(lineColor);
   dest.writeInt(lineWidth);
   dest.writeString(mapItemClass);
   dest.writeInt(offsetX);
   dest.writeInt(offsetY);
   dest.writeInt(symbol);
   dest.writeInt(verticalAlign);
   dest.writeString(query);
   dest.writeList(mapPoints);
   dest.writeList(contents);
 }
 @Override
 public void writeToParcel(Parcel out, int flags) {
   out.writeInt(action);
   out.writeInt(userMode);
   out.writeStringArray(acceptMimes);
   out.writeInt(userSortOrder);
   out.writeInt(allowMultiple ? 1 : 0);
   out.writeInt(showSize ? 1 : 0);
   out.writeInt(localOnly ? 1 : 0);
   out.writeInt(forceAdvanced ? 1 : 0);
   out.writeInt(showAdvanced ? 1 : 0);
   out.writeInt(stackTouched ? 1 : 0);
   out.writeInt(restored ? 1 : 0);
   DurableUtils.writeToParcel(out, stack);
   out.writeString(currentSearch);
   out.writeMap(dirState);
 }
Beispiel #7
0
 public final void a(Map map, long l, String s, List list)
 {
     Parcel parcel;
     Parcel parcel1;
     parcel = Parcel.obtain();
     parcel1 = Parcel.obtain();
     parcel.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
     parcel.writeMap(map);
     parcel.writeLong(l);
     parcel.writeString(s);
     parcel.writeTypedList(list);
     a.transact(1, parcel, parcel1, 0);
     parcel1.readException();
     parcel1.recycle();
     parcel.recycle();
     return;
     map;
     parcel1.recycle();
     parcel.recycle();
     throw map;
 }
 public void onResponseReceived(long l, Map map, byte abyte0[])
     throws RemoteException
 {
     Parcel parcel;
     Parcel parcel1;
     parcel = Parcel.obtain();
     parcel1 = Parcel.obtain();
     parcel.writeInterfaceToken("com.amazon.dcp.sso.IWebserviceCallback");
     parcel.writeLong(l);
     parcel.writeMap(map);
     parcel.writeByteArray(abyte0);
     mRemote.transact(1, parcel, parcel1, 0);
     parcel1.readException();
     parcel1.recycle();
     parcel.recycle();
     return;
     map;
     parcel1.recycle();
     parcel.recycle();
     throw map;
 }
 @Override
 public void writeToParcel(Parcel dest, int flags) {
   dest.writeMap(map);
 }