public FragmentState(Parcel paramParcel)
 {
   this.mClassName = paramParcel.readString();
   this.mIndex = paramParcel.readInt();
   int j;
   label31: int k;
   if (paramParcel.readInt() != 0)
   {
     j = i;
     this.mFromLayout = j;
     this.mFragmentId = paramParcel.readInt();
     this.mContainerId = paramParcel.readInt();
     this.mTag = paramParcel.readString();
     if (paramParcel.readInt() == 0)
       break label110;
     k = i;
     label70: this.mRetainInstance = k;
     if (paramParcel.readInt() == 0)
       break label116;
   }
   while (true)
   {
     this.mDetached = i;
     this.mArguments = paramParcel.readBundle();
     this.mSavedFragmentState = paramParcel.readBundle();
     return;
     j = 0;
     break label31:
     label110: k = 0;
     break label70:
     label116: i = 0;
   }
 }
Beispiel #2
0
 public FragmentState(Parcel paramParcel) {
   this.mClassName = paramParcel.readString();
   this.mIndex = paramParcel.readInt();
   if (paramParcel.readInt() != 0) {
     bool1 = true;
     this.mFromLayout = bool1;
     this.mFragmentId = paramParcel.readInt();
     this.mContainerId = paramParcel.readInt();
     this.mTag = paramParcel.readString();
     if (paramParcel.readInt() == 0) break label110;
     bool1 = true;
     label69:
     this.mRetainInstance = bool1;
     if (paramParcel.readInt() == 0) break label115;
   }
   label110:
   label115:
   for (boolean bool1 = bool2; ; bool1 = false) {
     this.mDetached = bool1;
     this.mArguments = paramParcel.readBundle();
     this.mSavedFragmentState = paramParcel.readBundle();
     return;
     bool1 = false;
     break;
     bool1 = false;
     break label69;
   }
 }
 @Override
 public TipSuggestion createFromParcel(android.os.Parcel in) {
   TipSuggestion instance =
       new TipSuggestion(
           com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR
               .createFromParcel(in)
               .unwrap());
   instance.bundle = in.readBundle(getClass().getClassLoader());
   instance.changeLog = in.readBundle();
   return instance;
 }
 @Override
 public Item createFromParcel(android.os.Parcel in) {
   Item instance =
       new Item(
           com.clover.sdk.v3.JsonParcelHelper.ObjectWrapper.CREATOR
               .createFromParcel(in)
               .unwrap());
   instance.genClient.setBundle(in.readBundle(getClass().getClassLoader()));
   instance.genClient.setChangeLog(in.readBundle());
   return instance;
 }
  @Test
  public void testReadWriteBundle() {
    Bundle b1 = new Bundle();
    b1.putString("hello", "world");
    parcel.writeBundle(b1);
    Bundle b2 = parcel.readBundle();

    assertEquals(b1, b2);
    assertEquals("world", b2.getString("hello"));

    parcel.writeBundle(b1);
    b2 = parcel.readBundle(null /* ClassLoader */);
    assertEquals(b1, b2);
    assertEquals("world", b2.getString("hello"));
  }
        @Override
        public MyLocation createFromParcel(Parcel source) {
          Bundle bundle = source.readBundle();

          return new MyLocation(
              bundle.getDouble(PARCELABLE_LATITUDE), bundle.getDouble(PARCELABLE_LONGITUDE));
        }
 private RemoteInput(Parcel in) {
   mResultKey = in.readString();
   mLabel = in.readCharSequence();
   mChoices = in.readCharSequenceArray();
   mFlags = in.readInt();
   mExtras = in.readBundle();
 }
  private PrintJobInfo(@NonNull Parcel parcel) {
    mId = parcel.readParcelable(null);
    mLabel = parcel.readString();
    mPrinterId = parcel.readParcelable(null);
    mPrinterName = parcel.readString();
    mState = parcel.readInt();
    mAppId = parcel.readInt();
    mTag = parcel.readString();
    mCreationTime = parcel.readLong();
    mCopies = parcel.readInt();
    Parcelable[] parcelables = parcel.readParcelableArray(null);
    if (parcelables != null) {
      mPageRanges = new PageRange[parcelables.length];
      for (int i = 0; i < parcelables.length; i++) {
        mPageRanges[i] = (PageRange) parcelables[i];
      }
    }
    mAttributes = (PrintAttributes) parcel.readParcelable(null);
    mDocumentInfo = (PrintDocumentInfo) parcel.readParcelable(null);
    mProgress = parcel.readFloat();
    mStatus = parcel.readCharSequence();
    mStatusRes = parcel.readInt();
    mStatusResAppPackageName = parcel.readCharSequence();
    mCanceling = (parcel.readInt() == 1);
    mAdvancedOptions = parcel.readBundle();

    if (mAdvancedOptions != null) {
      Preconditions.checkArgument(!mAdvancedOptions.containsKey(null));
    }
  }
 private LogcatReaderLoader(Parcel in) {
   this.recordingMode = in.readInt() == 1;
   this.multiple = in.readInt() == 1;
   Bundle bundle = in.readBundle();
   for (String key : bundle.keySet()) {
     lastLines.put(key, bundle.getString(key));
   }
 }
Beispiel #10
0
 public void readFromParcel(Parcel parcel) {
   packageName = parcel.readString();
   value = parcel.readString();
   flag = parcel.readInt();
   desc = parcel.readString();
   type = parcel.readInt();
   bundle = parcel.readBundle();
 }
 public void readFromParcel(Parcel in) {
   id = in.readLong();
   titleRes = in.readInt();
   title = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
   summaryRes = in.readInt();
   summary = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
   breadCrumbTitleRes = in.readInt();
   breadCrumbTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
   breadCrumbShortTitleRes = in.readInt();
   breadCrumbShortTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
   iconRes = in.readInt();
   fragment = in.readString();
   fragmentArguments = in.readBundle();
   if (in.readInt() != 0) {
     intent = Intent.CREATOR.createFromParcel(in);
   }
   extras = in.readBundle();
 }
    private SavedState(Parcel in) {
      super(in);

      Bundle bundle = in.readBundle();
      message = bundle.getString(MESSAGE_KEY);
      refreshing = bundle.getBoolean(REFRESHING_KEY);
      loading = bundle.getBoolean(LOADING_KEY);
      resources = (ArrayList<Resource>) bundle.getSerializable(RESOURCES_KEY);
    }
Beispiel #13
0
  public RssFeed(Parcel source) {

    Bundle data = source.readBundle();
    title = data.getString("title");
    link = data.getString("link");
    description = data.getString("description");
    language = data.getString("language");
    rssItems = data.getParcelableArrayList("rssItems");
  }
Beispiel #14
0
 private JmRosterEntry(Parcel p) {
   Bundle objectBundle = p.readBundle();
   mName = objectBundle.getString("name");
   mUser = objectBundle.getString("user");
   mStatus = objectBundle.getString("status");
   mType = objectBundle.getString("type");
   mPresenceStatus = objectBundle.getString("presence_status");
   mPresenceMode = objectBundle.getString("presence_mode");
 }
    @Override
    protected synchronized boolean onTransact(int code, Parcel data, Parcel reply, int flags) {
      DATABASE_NAME = getString(R.string.db_name);
      DATABASE_TABLE = getString(R.string.db_table);
      if (code == BDB_SERVICE_CODE) {
        Bundle bundle = data.readBundle();
        String command = bundle.getString("COMMAND");
        Log.i(TAG, "COMMAND=" + command);
        if (command.equals("ADD")) {
          String title = bundle.getString("TITLE");
          String isbn = bundle.getString("ISBN");
          String price = bundle.getString("PRICE");
          Log.i(TAG, "TITLE=" + command);
          Log.i(TAG, "ISBN=" + isbn);
          Log.i(TAG, "PRICE=" + price);
          bundle = new Bundle();
          if (doAdd(title, isbn, price)) bundle.putString("STATUS", "succeed");
          else bundle.putString("STATUS", "failed");
          reply.writeBundle(bundle);
        } else if (command.equals("SUM")) {
          String[][] dbdata = getData();
          // int sumprice = sumPrice();
          bundle = new Bundle();
          if (dbdata == null) {
            bundle.putString("STATUS", "failed");
            bundle.putStringArray("ID", null);
            bundle.putStringArray("TITLE", null);
            bundle.putStringArray("ISBN", null);
            bundle.putStringArray("PRICE", null);
            bundle.putString("TOTAL", "0");
          } else { // if(sumprice!=0){
            bundle.putString("STATUS", "succeed");
            bundle.putStringArray("ID", dbdata[0]);
            bundle.putStringArray("TITLE", dbdata[1]);
            bundle.putStringArray("ISBN", dbdata[2]);
            bundle.putStringArray("PRICE", dbdata[3]);
            // bundle.putString("TOTAL", Integer.toString(sumprice));
          } /*else if(sumprice==0){
            	bundle.putString("STATUS", "no data");
            	bundle.putStringArray("ID", dbdata[0]);
            	bundle.putStringArray("TITLE", dbdata[1]);
            	bundle.putStringArray("ISBN", dbdata[2]);
            	bundle.putStringArray("PRICE", dbdata[3]);
            	bundle.putString("TOTAL", Integer.toString(sumprice));
            }*/
          reply.writeBundle(bundle);
        }

        return true;
      } else {
        Log.e(
            getClass().getSimpleName(),
            "Transaction code should be " + BDB_SERVICE_CODE + ";" + " received instead " + code);
        return false;
      }
    }
  private Distribution(Parcel in) {

    distribution = new HashMap<String, Double>();
    Bundle bundle = in.readBundle();
    for (String key : bundle.keySet()) {
      distribution.put(key, bundle.getDouble(key));
    }
    best = in.readString();
    minDistance = in.readDouble();
  }
 // 读数据恢复数据
 @Override
 public MusicAlbumInfo createFromParcel(Parcel source) {
   MusicAlbumInfo info = new MusicAlbumInfo();
   Bundle bundle = source.readBundle();
   info.album_name = bundle.getString(KEY_ALBUM_NAME);
   info.album_art = bundle.getString(KEY_ALBUM_ART);
   info.number_of_songs = bundle.getInt(KEY_NUMBER_OF_SONGS);
   info.album_id = bundle.getInt(KEY_ALBUM_ID);
   return info;
 }
Beispiel #18
0
 @Override
 protected void readFromParcel(Parcel in) {
   super.readFromParcel(in);
   sendNotification = in.readByte() != 0;
   notificationText = in.readString();
   sendContent = in.readByte() != 0;
   content = in.readString();
   contentUrl = in.readString();
   metadata = in.readBundle();
 }
Beispiel #19
0
 @Override
 public ParcableMovie createFromParcel(Parcel source) {
   Bundle bundle = source.readBundle();
   return new ParcableMovie(
       bundle.getString(KEY_ID),
       bundle.getString(KEY_TITLE_NAME),
       bundle.getString(KEY_POSTER_IMAGE),
       bundle.getString(KEY_SYNOPSIS),
       bundle.getFloat(KEY_USER_RATING),
       bundle.getString(KEY_RELEASE_DATE));
 }
 @SuppressWarnings("Recycle")
 protected void readSyncState() throws ContactsStorageException {
   @Cleanup("recycle")
   Parcel parcel = Parcel.obtain();
   byte[] raw = getSyncState();
   syncState.clear();
   if (raw != null) {
     parcel.unmarshall(raw, 0, raw.length);
     parcel.setDataPosition(0);
     syncState.putAll(parcel.readBundle());
   }
 }
 public ParcelableCardEntity(Parcel src) {
   name = src.readString();
   users = src.createTypedArray(ParcelableUser.CREATOR);
   final Bundle bundle = src.readBundle(ParcelableBindingValue.class.getClassLoader());
   for (String key : bundle.keySet()) {
     if (values == null) {
       values = new HashMap<>();
     }
     final ParcelableBindingValue value = bundle.getParcelable(key);
     values.put(key, value);
   }
 }
 @SuppressWarnings("unchecked")
 public RepositorySessionImpl(Parcel o) {
   this.baseUrl = o.readString();
   this.userIdentifier = o.readString();
   this.password = o.readString();
   this.rootNode = o.readParcelable(FolderImpl.class.getClassLoader());
   this.repositoryInfo = (RepositoryInfo) o.readSerializable();
   this.cmisSession = (Session) o.readSerializable();
   Bundle b = o.readBundle();
   this.userParameters = (Map<String, Serializable>) b.getSerializable("userParameters");
   create();
 }
Beispiel #23
0
        @Override
        public SphereUser createFromParcel(Parcel source) {
          // read the bundle containing key value pairs from the parcel
          Bundle bundle = source.readBundle();

          SphereUser user = new SphereUser();
          user.mFullName = bundle.getString(FULL_NAME);
          user.mTagLine = bundle.getString(TAG_LINE);
          user.mUserId = bundle.getString(USER_ID);
          user.mUserPhotoFile = new ParseFile(bundle.getByteArray(USER_PHOTO_FILE));

          return user;
        }
        public Address createFromParcel(Parcel in) {
          String language = in.readString();
          String country = in.readString();
          Locale locale =
              country.length() > 0 ? new Locale(language, country) : new Locale(language);
          Address a = new Address(locale);

          int N = in.readInt();
          if (N > 0) {
            a.mAddressLines = new HashMap<Integer, String>(N);
            for (int i = 0; i < N; i++) {
              int index = in.readInt();
              String line = in.readString();
              a.mAddressLines.put(index, line);
              a.mMaxAddressLineIndex = Math.max(a.mMaxAddressLineIndex, index);
            }
          } else {
            a.mAddressLines = null;
            a.mMaxAddressLineIndex = -1;
          }
          a.mFeatureName = in.readString();
          a.mAdminArea = in.readString();
          a.mSubAdminArea = in.readString();
          a.mLocality = in.readString();
          a.mSubLocality = in.readString();
          a.mThoroughfare = in.readString();
          a.mSubThoroughfare = in.readString();
          a.mPremises = in.readString();
          a.mPostalCode = in.readString();
          a.mCountryCode = in.readString();
          a.mCountryName = in.readString();
          a.mHasLatitude = in.readInt() == 0 ? false : true;
          if (a.mHasLatitude) {
            a.mLatitude = in.readDouble();
          }
          a.mHasLongitude = in.readInt() == 0 ? false : true;
          if (a.mHasLongitude) {
            a.mLongitude = in.readDouble();
          }
          a.mPhone = in.readString();
          a.mUrl = in.readString();
          a.mExtras = in.readBundle();
          return a;
        }
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedAppState) {
    super.onCreate(savedAppState);

    applicationState =
        (null == savedAppState)
            ? new AppState(/* ... */ )
            : (AppState) savedAppState.getSerializable(APP_STATE);

    setContentView(R.layout.main);

    Bundle bundle = new Bundle();
    bundle.putFloat(APP_STATE, 3.14159F);

    Parcel p = Parcel.obtain();
    p.writeBundle(bundle);

    p.setDataPosition(0);
    bundle = p.readBundle();
    bundle.getInt(APP_STATE);
  }
 private Bundle loadCrashState() {
   if (!shouldRestore()) {
     return null;
   }
   Bundle state = null;
   Parcel parcel = Parcel.obtain();
   FileInputStream fin = null;
   try {
     File stateFile = new File(mContext.getCacheDir(), STATE_FILE);
     fin = new FileInputStream(stateFile);
     ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
     byte[] buffer = new byte[BUFFER_SIZE];
     int read;
     while ((read = fin.read(buffer)) > 0) {
       dataStream.write(buffer, 0, read);
     }
     byte[] data = dataStream.toByteArray();
     parcel.unmarshall(data, 0, data.length);
     parcel.setDataPosition(0);
     state = parcel.readBundle();
     if (state != null && !state.isEmpty()) {
       return state;
     }
   } catch (FileNotFoundException e) {
     // No state to recover
   } catch (Throwable e) {
     Log.w(LOGTAG, "Failed to recover state!", e);
   } finally {
     parcel.recycle();
     if (fin != null) {
       try {
         fin.close();
       } catch (IOException e) {
       }
     }
   }
   return null;
 }
 public void a(Parcel paramParcel) {
   a = JsonUtil.fromBundle(paramParcel.readBundle(), MediaCategory.class);
   b = paramParcel.readInt();
 }
 Message(Parcel in) {
   data = in.readBundle();
   type = setType();
 }
 private FollowState(Parcel in) {
   this.state = in.readInt();
   modeParams = in.readBundle();
   int tmpMode = in.readInt();
   this.mode = tmpMode == -1 ? null : FollowType.values()[tmpMode];
 }
 private RadioMetadata(Parcel in) {
   mBundle = in.readBundle();
 }