Java Code Examples for android.os.Parcel#readLongArray()

The following examples show how to use android.os.Parcel#readLongArray() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WifiBatteryStats.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
public void readFromParcel(Parcel in) {
  mLoggingDurationMs = in.readLong();
  mKernelActiveTimeMs = in.readLong();
  mNumPacketsTx = in.readLong();
  mNumBytesTx = in.readLong();
  mNumPacketsRx = in.readLong();
  mNumBytesRx = in.readLong();
  mSleepTimeMs = in.readLong();
  mScanTimeMs = in.readLong();
  mIdleTimeMs = in.readLong();
  mRxTimeMs = in.readLong();
  mTxTimeMs = in.readLong();
  mEnergyConsumedMaMs = in.readLong();
  mNumAppScanRequest = in.readLong();
  in.readLongArray(mTimeInStateMs);
  in.readLongArray(mTimeInRxSignalStrengthLevelMs);
  in.readLongArray(mTimeInSupplicantStateMs);
}
 
Example 2
Source File: LogHistory.java    From testing-samples with Apache License 2.0 6 votes vote down vote up
private LogHistory(Parcel in) {
    // First, read the size of the arrays that contain the data.
    int length = in.readInt();

    // Create the arrays to store the data.
    String[] texts = new String[length];
    long[] timestamps = new long[length];

    // Read the arrays in a specific order.
    in.readStringArray(texts);
    in.readLongArray(timestamps);

    // The lengths of both arrays should match or the data is corrupted.
    if (texts.length != timestamps.length) {
        throw new IllegalStateException("Error reading from saved state.");
    }

    // Reset the data container and update the data.
    mData.clear();
    for (int i = 0; i < texts.length; i++) {
        Pair<String, Long> pair = new Pair<>(texts[i], timestamps[i]);
        mData.add(pair);
    }
}
 
Example 3
Source File: TopicModel.java    From v2ex-daily-android with Apache License 2.0 6 votes vote down vote up
private TopicModel(Parcel in){
    int[] ints= new int[2];
    in.readIntArray(ints);
    id = ints[0];
    replies = ints[1];
    String[] strings = new String[4];
    in.readStringArray(strings);
    title = strings[0];
    url = strings[1];
    content = strings[2];
    contentRendered = strings[3];
    long[] longs = new long[3];
    in.readLongArray(longs);
    created = longs[0];
    lastModified = longs[1];
    lastTouched = longs[2];
    member = (MemberModel) in.readValue(MemberModel.class.getClassLoader());
    node = (NodeModel) in.readValue(NodeModel.class.getClassLoader());
}
 
Example 4
Source File: ClientInfo.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
private ClientInfo(final Parcel in) {
    final int[] integers = new int[10];
    final long[] longs = new long[3];

    address = in.readString();
    in.readIntArray(integers);
    in.readLongArray(longs);
    connected = in.readInt() == 1;

    clientID = integers[0];
    samplesGotten = integers[1];
    samplesPut = integers[2];
    eventsGotten = integers[3];
    eventsPut = integers[4];
    lastActivity = integers[5];
    waitEvents = integers[6];
    waitSamples = integers[7];
    error = integers[8];
    diff = integers[9];

    timeLastActivity = longs[0];
    waitTimeout = longs[1];
    time = longs[2];
}
 
Example 5
Source File: ClientInfo.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
private ClientInfo(final Parcel in) {
	final int[] integers = new int[10];
	final long[] longs = new long[3];

	address = in.readString();
	in.readIntArray(integers);
	in.readLongArray(longs);
	connected = in.readInt() == 1;

	clientID = integers[0];
	samplesGotten = integers[1];
	samplesPut = integers[2];
	eventsGotten = integers[3];
	eventsPut = integers[4];
	lastActivity = integers[5];
	waitEvents = integers[6];
	waitSamples = integers[7];
	error = integers[8];
	diff = integers[9];

	timeLastActivity = longs[0];
	waitTimeout = longs[1];
	time = longs[2];
}
 
Example 6
Source File: BufferConnectionInfo.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
private BufferConnectionInfo(final Parcel in) {
    final int[] integers = new int[10];
    final long[] longs = new long[3];

    address = in.readString();
    in.readIntArray(integers);
    in.readLongArray(longs);
    connected = in.readInt() == 1;

    connectionID = integers[0];
    samplesGotten = integers[1];
    samplesPut = integers[2];
    eventsGotten = integers[3];
    eventsPut = integers[4];
    lastActivity = integers[5];
    waitEvents = integers[6];
    waitSamples = integers[7];
    error = integers[8];
    diff = integers[9];

    timeLastActivity = longs[0];
    waitTimeout = longs[1];
    time = longs[2];
}
 
Example 7
Source File: CellularBatteryStats.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public void readFromParcel(Parcel in) {
  mLoggingDurationMs = in.readLong();
  mKernelActiveTimeMs = in.readLong();
  mNumPacketsTx = in.readLong();
  mNumBytesTx = in.readLong();
  mNumPacketsRx = in.readLong();
  mNumBytesRx = in.readLong();
  mSleepTimeMs = in.readLong();
  mIdleTimeMs = in.readLong();
  mRxTimeMs = in.readLong();
  mEnergyConsumedMaMs = in.readLong();
  in.readLongArray(mTimeInRatMs);
  in.readLongArray(mTimeInRxSignalStrengthLevelMs);
  in.readLongArray(mTxTimeMs);
}
 
Example 8
Source File: GpsBatteryStats.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
public void readFromParcel(Parcel in) {
  mLoggingDurationMs = in.readLong();
  mEnergyConsumedMaMs = in.readLong();
  in.readLongArray(mTimeInGpsSignalQualityLevel);
}
 
Example 9
Source File: SyncStatusInfo.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
public SyncStatusInfo(Parcel parcel) {
    int version = parcel.readInt();
    if (version != VERSION && version != 1) {
        Log.w("SyncStatusInfo", "Unknown version: " + version);
    }
    authorityId = parcel.readInt();

    // Note we can't use Stats.writeToParcel() here because the data is persisted and we need
    // to be able to read from the old format too.
    totalStats.totalElapsedTime = parcel.readLong();
    totalStats.numSyncs = parcel.readInt();
    totalStats.numSourcePoll = parcel.readInt();
    totalStats.numSourceOther = parcel.readInt();
    totalStats.numSourceLocal = parcel.readInt();
    totalStats.numSourceUser = parcel.readInt();
    lastSuccessTime = parcel.readLong();
    lastSuccessSource = parcel.readInt();
    lastFailureTime = parcel.readLong();
    lastFailureSource = parcel.readInt();
    lastFailureMesg = parcel.readString();
    initialFailureTime = parcel.readLong();
    pending = parcel.readInt() != 0;
    initialize = parcel.readInt() != 0;
    if (version == 1) {
        periodicSyncTimes = null;
    } else {
        final int count = parcel.readInt();
        if (count < 0) {
            periodicSyncTimes = null;
        } else {
            periodicSyncTimes = new ArrayList<Long>();
            for (int i = 0; i < count; i++) {
                periodicSyncTimes.add(parcel.readLong());
            }
        }
        if (version >= 3) {
            mLastEventTimes.clear();
            mLastEvents.clear();
            final int nEvents = parcel.readInt();
            for (int i = 0; i < nEvents; i++) {
                mLastEventTimes.add(parcel.readLong());
                mLastEvents.add(parcel.readString());
            }
        }
    }
    if (version < 4) {
        // Before version 4, numSourcePeriodic wasn't persisted.
        totalStats.numSourcePeriodic =
                totalStats.numSyncs - totalStats.numSourceLocal - totalStats.numSourcePoll
                        - totalStats.numSourceOther
                        - totalStats.numSourceUser;
        if (totalStats.numSourcePeriodic < 0) { // Sanity check.
            totalStats.numSourcePeriodic = 0;
        }
    } else {
        totalStats.numSourcePeriodic = parcel.readInt();
    }
    if (version >= 5) {
        totalStats.numSourceFeed = parcel.readInt();
        totalStats.numFailures = parcel.readInt();
        totalStats.numCancels = parcel.readInt();

        lastTodayResetTime = parcel.readLong();

        todayStats.readFromParcel(parcel);
        yesterdayStats.readFromParcel(parcel);
    }
    if (version >= 6) {
        parcel.readLongArray(perSourceLastSuccessTimes);
        parcel.readLongArray(perSourceLastFailureTimes);
    }
}