Example usage for android.os Parcel dataPosition

List of usage examples for android.os Parcel dataPosition

Introduction

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

Prototype

public final int dataPosition() 

Source Link

Document

Returns the current position in the parcel data.

Usage

From source file:org.droid2droid.internal.AbstractRemoteAndroidImpl.java

protected final void updateData(Parcel data) // TODO: a placer plutot cot serveur
{
    if (UPDATE_PARCEL) {
        int v = VERSION.SDK_INT;
        data.setDataPosition(0);//from  w  ww  .  j  a  v  a2  s.  c  o m
        if (v >= 10) // Gingerbread_MR1+
        {
            data.readInt();
        }
        String enforceInterfaceName = data.readString(); // Read the interface name (see Parcel.cpp)
        assert (enforceInterfaceName != null);
        byte[] bufDatas = data.marshall(); // Return all the buffer (with the specific enforceInterface
        int startDatas = data.dataPosition(); // Position after the first string

        // Create a new one with interface name + buffers
        Parcel p = Parcel.obtain();
        p.setDataPosition(0);
        p.writeString(enforceInterfaceName);
        int sizeInterface = p.dataPosition();
        byte[] bufInterface = p.marshall(); // Part of buffer only for the string
        p.recycle();

        // Extract the rest of the buffer
        byte[] result = new byte[sizeInterface + bufDatas.length - startDatas];
        System.arraycopy(bufInterface, 0, result, 0, sizeInterface);
        System.arraycopy(bufDatas, startDatas, result, sizeInterface, bufDatas.length - startDatas);
        data.unmarshall(result, 0, result.length);
    }
}

From source file:com.google.android.gms.internal.fw.java

public fv m622D(Parcel parcel) {
    int j = C0065a.m92j(parcel);
    Set hashSet = new HashSet();
    int i = 0;// w  ww.  ja  va  2s. c om
    String str = null;
    C0595a c0595a = null;
    String str2 = null;
    String str3 = null;
    int i2 = 0;
    C0598b c0598b = null;
    String str4 = null;
    String str5 = null;
    int i3 = 0;
    String str6 = null;
    C0599c c0599c = null;
    boolean z = false;
    String str7 = null;
    C0600d c0600d = null;
    String str8 = null;
    int i4 = 0;
    List list = null;
    List list2 = null;
    int i5 = 0;
    int i6 = 0;
    String str9 = null;
    String str10 = null;
    List list3 = null;
    boolean z2 = false;
    while (parcel.dataPosition() < j) {
        int i7 = C0065a.m90i(parcel);
        switch (C0065a.m107y(i7)) {
        case DetectedActivity.ON_BICYCLE /*1*/:
            i = C0065a.m86f(parcel, i7);
            hashSet.add(Integer.valueOf(1));
            break;
        case DetectedActivity.ON_FOOT /*2*/:
            str = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(2));
            break;
        case DetectedActivity.STILL /*3*/:
            C0595a c0595a2 = (C0595a) C0065a.m77a(parcel, i7, C0595a.CREATOR);
            hashSet.add(Integer.valueOf(3));
            c0595a = c0595a2;
            break;
        case DetectedActivity.UNKNOWN /*4*/:
            str2 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(4));
            break;
        case DetectedActivity.TILTING /*5*/:
            str3 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(5));
            break;
        case GamesClient.STATUS_NETWORK_ERROR_OPERATION_FAILED /*6*/:
            i2 = C0065a.m86f(parcel, i7);
            hashSet.add(Integer.valueOf(6));
            break;
        case GamesClient.STATUS_LICENSE_CHECK_FAILED /*7*/:
            C0598b c0598b2 = (C0598b) C0065a.m77a(parcel, i7, C0598b.CREATOR);
            hashSet.add(Integer.valueOf(7));
            c0598b = c0598b2;
            break;
        case GamesClient.STATUS_APP_MISCONFIGURED /*8*/:
            str4 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(8));
            break;
        case ConnectionResult.SERVICE_INVALID /*9*/:
            str5 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(9));
            break;
        case ConnectionResult.DATE_INVALID /*12*/:
            i3 = C0065a.m86f(parcel, i7);
            hashSet.add(Integer.valueOf(12));
            break;
        case 14:
            str6 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(14));
            break;
        case ViewDragHelper.EDGE_ALL /*15*/:
            C0599c c0599c2 = (C0599c) C0065a.m77a(parcel, i7, C0599c.CREATOR);
            hashSet.add(Integer.valueOf(15));
            c0599c = c0599c2;
            break;
        case TransportMediator.FLAG_KEY_MEDIA_PAUSE /*16*/:
            z = C0065a.m83c(parcel, i7);
            hashSet.add(Integer.valueOf(16));
            break;
        case 18:
            str7 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(18));
            break;
        case TimeUtils.HUNDRED_DAY_FIELD_LEN /*19*/:
            C0600d c0600d2 = (C0600d) C0065a.m77a(parcel, i7, C0600d.CREATOR);
            hashSet.add(Integer.valueOf(19));
            c0600d = c0600d2;
            break;
        case 20:
            str8 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(20));
            break;
        case 21:
            i4 = C0065a.m86f(parcel, i7);
            hashSet.add(Integer.valueOf(21));
            break;
        case 22:
            list = C0065a.m82c(parcel, i7, C0601f.CREATOR);
            hashSet.add(Integer.valueOf(22));
            break;
        case 23:
            list2 = C0065a.m82c(parcel, i7, C0602g.CREATOR);
            hashSet.add(Integer.valueOf(23));
            break;
        case 24:
            i5 = C0065a.m86f(parcel, i7);
            hashSet.add(Integer.valueOf(24));
            break;
        case 25:
            i6 = C0065a.m86f(parcel, i7);
            hashSet.add(Integer.valueOf(25));
            break;
        case 26:
            str9 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(26));
            break;
        case 27:
            str10 = C0065a.m94l(parcel, i7);
            hashSet.add(Integer.valueOf(27));
            break;
        case 28:
            list3 = C0065a.m82c(parcel, i7, C0603h.CREATOR);
            hashSet.add(Integer.valueOf(28));
            break;
        case 29:
            z2 = C0065a.m83c(parcel, i7);
            hashSet.add(Integer.valueOf(29));
            break;
        default:
            C0065a.m80b(parcel, i7);
            break;
        }
    }
    if (parcel.dataPosition() == j) {
        return new fv(hashSet, i, str, c0595a, str2, str3, i2, c0598b, str4, str5, i3, str6, c0599c, z, str7,
                c0600d, str8, i4, list, list2, i5, i6, str9, str10, list3, z2);
    }
    throw new C0064a("Overread allowed size end=" + j, parcel);
}

From source file:com.google.android.gms.internal.fr.java

public fq m618B(Parcel parcel) {
    int j = C0065a.m92j(parcel);
    Set hashSet = new HashSet();
    int i = 0;/* w  w  w. j  a  v  a 2  s . c om*/
    fq fqVar = null;
    List list = null;
    fq fqVar2 = null;
    String str = null;
    String str2 = null;
    String str3 = null;
    List list2 = null;
    int i2 = 0;
    List list3 = null;
    fq fqVar3 = null;
    List list4 = null;
    String str4 = null;
    String str5 = null;
    fq fqVar4 = null;
    String str6 = null;
    String str7 = null;
    String str8 = null;
    List list5 = null;
    String str9 = null;
    String str10 = null;
    String str11 = null;
    String str12 = null;
    String str13 = null;
    String str14 = null;
    String str15 = null;
    String str16 = null;
    String str17 = null;
    fq fqVar5 = null;
    String str18 = null;
    String str19 = null;
    String str20 = null;
    String str21 = null;
    fq fqVar6 = null;
    double d = 0.0d;
    fq fqVar7 = null;
    double d2 = 0.0d;
    String str22 = null;
    fq fqVar8 = null;
    List list6 = null;
    String str23 = null;
    String str24 = null;
    String str25 = null;
    String str26 = null;
    fq fqVar9 = null;
    String str27 = null;
    String str28 = null;
    String str29 = null;
    fq fqVar10 = null;
    String str30 = null;
    String str31 = null;
    String str32 = null;
    String str33 = null;
    String str34 = null;
    String str35 = null;
    while (parcel.dataPosition() < j) {
        int i3 = C0065a.m90i(parcel);
        fq fqVar11;
        switch (C0065a.m107y(i3)) {
        case DetectedActivity.ON_BICYCLE /*1*/:
            i = C0065a.m86f(parcel, i3);
            hashSet.add(Integer.valueOf(1));
            break;
        case DetectedActivity.ON_FOOT /*2*/:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(2));
            fqVar = fqVar11;
            break;
        case DetectedActivity.STILL /*3*/:
            list = C0065a.m106x(parcel, i3);
            hashSet.add(Integer.valueOf(3));
            break;
        case DetectedActivity.UNKNOWN /*4*/:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(4));
            fqVar2 = fqVar11;
            break;
        case DetectedActivity.TILTING /*5*/:
            str = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(5));
            break;
        case GamesClient.STATUS_NETWORK_ERROR_OPERATION_FAILED /*6*/:
            str2 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(6));
            break;
        case GamesClient.STATUS_LICENSE_CHECK_FAILED /*7*/:
            str3 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(7));
            break;
        case GamesClient.STATUS_APP_MISCONFIGURED /*8*/:
            list2 = C0065a.m82c(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(8));
            break;
        case ConnectionResult.SERVICE_INVALID /*9*/:
            i2 = C0065a.m86f(parcel, i3);
            hashSet.add(Integer.valueOf(9));
            break;
        case ConnectionResult.DEVELOPER_ERROR /*10*/:
            list3 = C0065a.m82c(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(10));
            break;
        case ConnectionResult.LICENSE_CHECK_FAILED /*11*/:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(11));
            fqVar3 = fqVar11;
            break;
        case ConnectionResult.DATE_INVALID /*12*/:
            list4 = C0065a.m82c(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(12));
            break;
        case C0048R.styleable.MapAttrs_zOrderOnTop /*13*/:
            str4 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(13));
            break;
        case 14:
            str5 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(14));
            break;
        case ViewDragHelper.EDGE_ALL /*15*/:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(15));
            fqVar4 = fqVar11;
            break;
        case TransportMediator.FLAG_KEY_MEDIA_PAUSE /*16*/:
            str6 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(16));
            break;
        case 17:
            str7 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(17));
            break;
        case 18:
            str8 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(18));
            break;
        case TimeUtils.HUNDRED_DAY_FIELD_LEN /*19*/:
            list5 = C0065a.m82c(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(19));
            break;
        case 20:
            str9 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(20));
            break;
        case 21:
            str10 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(21));
            break;
        case 22:
            str11 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(22));
            break;
        case 23:
            str12 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(23));
            break;
        case 24:
            str13 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(24));
            break;
        case 25:
            str14 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(25));
            break;
        case 26:
            str15 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(26));
            break;
        case 27:
            str16 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(27));
            break;
        case 28:
            str17 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(28));
            break;
        case 29:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(29));
            fqVar5 = fqVar11;
            break;
        case 30:
            str18 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(30));
            break;
        case 31:
            str19 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(31));
            break;
        case TransportMediator.FLAG_KEY_MEDIA_STOP /*32*/:
            str20 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(32));
            break;
        case 33:
            str21 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(33));
            break;
        case 34:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(34));
            fqVar6 = fqVar11;
            break;
        case 36:
            d = C0065a.m91j(parcel, i3);
            hashSet.add(Integer.valueOf(36));
            break;
        case 37:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(37));
            fqVar7 = fqVar11;
            break;
        case 38:
            d2 = C0065a.m91j(parcel, i3);
            hashSet.add(Integer.valueOf(38));
            break;
        case 39:
            str22 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(39));
            break;
        case 40:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(40));
            fqVar8 = fqVar11;
            break;
        case 41:
            list6 = C0065a.m82c(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(41));
            break;
        case 42:
            str23 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(42));
            break;
        case 43:
            str24 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(43));
            break;
        case 44:
            str25 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(44));
            break;
        case 45:
            str26 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(45));
            break;
        case 46:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(46));
            fqVar9 = fqVar11;
            break;
        case 47:
            str27 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(47));
            break;
        case 48:
            str28 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(48));
            break;
        case 49:
            str29 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(49));
            break;
        case AdSize.PORTRAIT_AD_HEIGHT /*50*/:
            fqVar11 = (fq) C0065a.m77a(parcel, i3, fq.CREATOR);
            hashSet.add(Integer.valueOf(50));
            fqVar10 = fqVar11;
            break;
        case 51:
            str30 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(51));
            break;
        case 52:
            str31 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(52));
            break;
        case 53:
            str32 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(53));
            break;
        case 54:
            str33 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(54));
            break;
        case 55:
            str34 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(55));
            break;
        case 56:
            str35 = C0065a.m94l(parcel, i3);
            hashSet.add(Integer.valueOf(56));
            break;
        default:
            C0065a.m80b(parcel, i3);
            break;
        }
    }
    if (parcel.dataPosition() == j) {
        return new fq(hashSet, i, fqVar, list, fqVar2, str, str2, str3, list2, i2, list3, fqVar3, list4, str4,
                str5, fqVar4, str6, str7, str8, list5, str9, str10, str11, str12, str13, str14, str15, str16,
                str17, fqVar5, str18, str19, str20, str21, fqVar6, d, fqVar7, d2, str22, fqVar8, list6, str23,
                str24, str25, str26, fqVar9, str27, str28, str29, fqVar10, str30, str31, str32, str33, str34,
                str35);
    }
    throw new C0064a("Overread allowed size end=" + j, parcel);
}