Example usage for android.os Parcel readString

List of usage examples for android.os Parcel readString

Introduction

In this page you can find the example usage for android.os Parcel readString.

Prototype

public final String readString() 

Source Link

Document

Read a string value from the parcel at the current dataPosition().

Usage

From source file:com.android.emailcommon.provider.HostAuth.java

/**
 * Supports Parcelable//from www.  jav a 2  s .  c o m
 */
public HostAuth(Parcel in) {
    mBaseUri = CONTENT_URI;
    mId = in.readLong();
    mProtocol = in.readString();
    mAddress = in.readString();
    mPort = in.readInt();
    mFlags = in.readInt();
    mLogin = in.readString();
    mPassword = in.readString();
    mDomain = in.readString();
    mClientCertAlias = in.readString();
    if ((mFlags & FLAG_OAUTH) != 0) {
        // TODO: This is nasty, but to be compatible with backward Exchange, we can't make any
        // change to the parcelable format. But we need Credential objects to be here.
        // So... only parcel or unparcel Credentials if the OAUTH flag is set. This will never
        // be set on HostAuth going to or coming from Exchange.
        mCredentialKey = in.readLong();
        mCredential = new Credential(in);
        if (mCredential.equals(Credential.EMPTY)) {
            mCredential = null;
        }
    } else {
        mCredentialKey = -1;
    }
}

From source file:com.scvngr.levelup.core.net.LevelUpResponse.java

/**
 * Constructor for parceling.//from   w  ww  .  j  a v  a  2s  .c o  m
 *
 * @param in the parcel to read from.
 */
public LevelUpResponse(@NonNull final Parcel in) {
    super(in);
    mStatus = LevelUpStatus.valueOf(in.readString());

    mServerErrors = new ArrayList<>();
    in.readTypedList(mServerErrors, Error.CREATOR);
    mServerErrorReadError = (Exception) in.readSerializable();
    mOriginalResponse = in.readParcelable(LevelUpResponse.class.getClassLoader());

    checkRep();
}

From source file:net.issarlk.androbunny.inkbunny.Submission.java

public Submission(Parcel in) {
    if (in.readLong() != Submission.serialVersionUID) {
        throw new RuntimeException("Wrong UID");
    }/*  w  w  w. j  a  v  a2s  .c  o  m*/
    this.id = in.readInt();
    this.hidden = in.readInt();
    this.user = User.CREATOR.createFromParcel(in);
    this.create_datetime = in.readString();
    this.create_datetime_usertime = in.readString();
    this.file_name = in.readString();
    this.thumbnails = new Thumbnail[in.readInt()];
    for (int i = this.thumbnails.length - 1; i >= 0; i--) {
        if (in.readInt() == 1) {
            this.thumbnails[i] = Thumbnail.CREATOR.createFromParcel(in);
        }
    }
    this.title = in.readString();
    this.deleted = in.readInt();
    this.s_public = in.readInt();
    this.mimetype = in.readString();
    this.rating = Rating.CREATOR.createFromParcel(in);
    this.submission_type = SubmissionType.CREATOR.createFromParcel(in);
    this.digitalsales = in.readInt();
    this.printsales = in.readInt();
    this.guest_block = in.readInt();

    // Full info
    if (in.readInt() == 1) {
        this.keywords = new Keyword[in.readInt()];
        for (int i = this.keywords.length - 1; i >= 0; i--) {
            this.keywords[i] = Keyword.CREATOR.createFromParcel(in);
        }
        this.scraps = in.readInt();
        this.favorite = in.readInt();
        this.favorites_count = in.readInt();
        this.comments_count = in.readInt();
        this.files = new File[in.readInt()];
        for (int i = this.files.length - 1; i >= 0; i--) {
            this.files[i] = File.CREATOR.createFromParcel(in);
        }
        this.file_urls = new URI[3];
        for (int i = 0; i < 3; i++) {
            String tmp = in.readString();
            if (tmp != null) {
                try {
                    this.file_urls[FULL] = new URI(tmp);
                } catch (URISyntaxException e) {
                    Log.e(TAG, e.toString());
                }
            }
        }
    }

    //Description      
    if (in.readInt() == 1) {
        this.description = in.readString();
    }

    //Writing
    if (in.readInt() == 1) {
        this.writing = in.readString();
    }
}

From source file:com.kevinquan.android.location.SimpleRecordedLocation.java

public SimpleRecordedLocation(Parcel in) {
    this();/*ww  w  . ja  v  a 2s.  co m*/
    mLatitude = in.readDouble();
    mLongitude = in.readDouble();
    mAccuracy = in.readFloat();
    mAltitude = in.readDouble();
    mBearing = in.readFloat();
    mSpeed = in.readFloat();
    mRecordedAt = in.readLong();
    mProvider = LocationProviderType.fromValue(in.readString());
}

From source file:com.amossys.hooker.common.InterceptEvent.java

/**
 * Read and write functions to handle the parameters list.
 * @param in/*from w w  w .ja va2 s  .c om*/
 */
private void readParametersList(Parcel in) {
    int size = in.readInt();
    if (size != 0) {
        for (int i = 0; i < size; i++) {
            String key = in.readString();
            String value = in.readString();
            parameters.add(new AbstractMap.SimpleEntry<String, String>(key, value));
        }
    }
}

From source file:com.amossys.hooker.common.InterceptEvent.java

/**
 * Read and write function to handle the data map.
 * @param in/*from w w w  . jav  a2 s .  c o  m*/
 */
private void readDataMap(Parcel in) {
    int size = in.readInt();
    if (size != 0) {
        for (int i = 0; i < size; i++) {
            String key = in.readString();
            String value = in.readString();
            data.put(key, value);
        }
    }
}

From source file:edu.umich.flowfence.common.QMDetails.java

public void readFromParcel(Parcel source) {
    final int length = source.readInt();
    final int endPos = source.dataPosition() + length;

    if (localLOGV) {
        Log.v(TAG, "Unparceling, length " + length);
    }//from  w  ww  . jav  a2 s  .com

    if (source.dataPosition() < endPos) {
        descriptor = QMDescriptor.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Descriptor: " + descriptor);
        }
    }
    if (source.dataPosition() < endPos) {
        resultType = source.readString();
        if (localLOGV) {
            Log.v(TAG, "Result type: " + resultType);
        }
    }
    if (source.dataPosition() < endPos) {
        paramInfo = source.createTypedArrayList(ParamInfo.CREATOR);
        if (paramInfo != null) {
            if (localLOGV) {
                Log.v(TAG, "Param info (size " + paramInfo.size() + "):");
                for (ParamInfo pi : paramInfo) {
                    Log.v(TAG, "    " + pi);
                }
            }
            paramInfo = Collections.unmodifiableList(paramInfo);
        } else if (localLOGV) {
            Log.v(TAG, "Param info (null)");
        }
    }
    if (source.dataPosition() < endPos) {
        requiredTaints = TaintSet.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Required taints: " + requiredTaints);
        }
    }
    if (source.dataPosition() < endPos) {
        optionalTaints = TaintSet.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Optional taints: " + optionalTaints);
        }
    }
    if (source.dataPosition() < endPos) {
        if (localLOGD) {
            Log.d(TAG, "Excess data at end of parcel");
        }
        source.setDataPosition(endPos);
    }
}

From source file:edu.umich.oasis.common.SodaDetails.java

public void readFromParcel(Parcel source) {
    final int length = source.readInt();
    final int endPos = source.dataPosition() + length;

    if (localLOGV) {
        Log.v(TAG, "Unparceling, length " + length);
    }/* w w w  . j av a  2s .  c o m*/

    if (source.dataPosition() < endPos) {
        descriptor = SodaDescriptor.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Descriptor: " + descriptor);
        }
    }
    if (source.dataPosition() < endPos) {
        resultType = source.readString();
        if (localLOGV) {
            Log.v(TAG, "Result type: " + resultType);
        }
    }
    if (source.dataPosition() < endPos) {
        paramInfo = source.createTypedArrayList(ParamInfo.CREATOR);
        if (paramInfo != null) {
            if (localLOGV) {
                Log.v(TAG, "Param info (size " + paramInfo.size() + "):");
                for (ParamInfo pi : paramInfo) {
                    Log.v(TAG, "    " + pi);
                }
            }
            paramInfo = Collections.unmodifiableList(paramInfo);
        } else if (localLOGV) {
            Log.v(TAG, "Param info (null)");
        }
    }
    if (source.dataPosition() < endPos) {
        requiredTaints = TaintSet.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Required taints: " + requiredTaints);
        }
    }
    if (source.dataPosition() < endPos) {
        optionalTaints = TaintSet.readFromParcel(source);
        if (localLOGV) {
            Log.v(TAG, "Optional taints: " + optionalTaints);
        }
    }
    if (source.dataPosition() < endPos) {
        if (localLOGD) {
            Log.d(TAG, "Excess data at end of parcel");
        }
        source.setDataPosition(endPos);
    }
}

From source file:com.sayar.requests.RequestArguments.java

@SuppressWarnings("unchecked")
private RequestArguments(final Parcel bundle) {
    this.method = RequestMethod.fromValue(bundle.readString());

    this.url = bundle.readString();

    this.userAgent = bundle.readString();

    this.parseAs = bundle.readString();

    final Bundle params = bundle.readBundle();
    this.params = (Map<String, String>) params.getSerializable("map");

    final Bundle headers = bundle.readBundle();
    this.headers = (Map<String, String>) headers.getSerializable("map");
}

From source file:com.mindmeapp.extensions.ExtensionData.java

private ExtensionData(Parcel in) {
    int parcelableVersion = in.readInt();

    this.mVisible = (in.readInt() != 0);

    this.mIcon = in.readInt();
    String iconUriString = in.readString();
    this.mIconUri = TextUtils.isEmpty(iconUriString) ? null : Uri.parse(iconUriString);

    this.mStatusToDisplay = in.readString();
    if (TextUtils.isEmpty(this.mStatusToDisplay)) {
        this.mStatusToDisplay = null;
    }// w  ww  . java2s .  c  o m
    this.mStatusToSpeak = in.readString();
    if (TextUtils.isEmpty(this.mStatusToSpeak)) {
        this.mStatusToSpeak = null;
    }
    this.mLanguageToSpeak = (Locale) in.readSerializable();
    this.mViewsToDisplay = in.readParcelable(RemoteViews.class.getClassLoader());

    this.mContentDescription = in.readString();
    if (TextUtils.isEmpty(this.mContentDescription)) {
        this.mContentDescription = null;
    }

    this.mBackground = in.readInt();
    String backgroundUriString = in.readString();
    this.mBackgroundUri = TextUtils.isEmpty(backgroundUriString) ? null : Uri.parse(backgroundUriString);
}