Java Code Examples for android.os.Parcel#readTypedArray()
The following examples show how to use
android.os.Parcel#readTypedArray() .
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: PackageInfoLite.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
private PackageInfoLite(Parcel source) { packageName = source.readString(); splitNames = source.createStringArray(); versionCode = source.readInt(); versionCodeMajor = source.readInt(); baseRevisionCode = source.readInt(); splitRevisionCodes = source.createIntArray(); recommendedInstallLocation = source.readInt(); installLocation = source.readInt(); multiArch = (source.readInt() != 0); final int verifiersLength = source.readInt(); if (verifiersLength == 0) { verifiers = new VerifierInfo[0]; } else { verifiers = new VerifierInfo[verifiersLength]; source.readTypedArray(verifiers, VerifierInfo.CREATOR); } }
Example 2
Source File: ZenModeConfig.java From android_9.0.0_r45 with Apache License 2.0 | 6 votes |
public ZenModeConfig(Parcel source) { allowCalls = source.readInt() == 1; allowRepeatCallers = source.readInt() == 1; allowMessages = source.readInt() == 1; allowReminders = source.readInt() == 1; allowEvents = source.readInt() == 1; allowCallsFrom = source.readInt(); allowMessagesFrom = source.readInt(); user = source.readInt(); manualRule = source.readParcelable(null); final int len = source.readInt(); if (len > 0) { final String[] ids = new String[len]; final ZenRule[] rules = new ZenRule[len]; source.readStringArray(ids); source.readTypedArray(rules, ZenRule.CREATOR); for (int i = 0; i < len; i++) { automaticRules.put(ids[i], rules[i]); } } allowAlarms = source.readInt() == 1; allowMedia = source.readInt() == 1; allowSystem = source.readInt() == 1; suppressedVisualEffects = source.readInt(); areChannelsBypassingDnd = source.readInt() == 1; }
Example 3
Source File: ExtendableSavedState.java From material-components-android with Apache License 2.0 | 6 votes |
private ExtendableSavedState(@NonNull Parcel in, ClassLoader loader) { super(in, loader); int size = in.readInt(); String[] keys = new String[size]; in.readStringArray(keys); Bundle[] states = new Bundle[size]; in.readTypedArray(states, Bundle.CREATOR); extendableStates = new SimpleArrayMap<>(size); for (int i = 0; i < size; i++) { extendableStates.put(keys[i], states[i]); } }
Example 4
Source File: SentenceSuggestionsInfo.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
public SentenceSuggestionsInfo(Parcel source) { final int infoSize = source.readInt(); mSuggestionsInfos = new SuggestionsInfo[infoSize]; source.readTypedArray(mSuggestionsInfos, SuggestionsInfo.CREATOR); mOffsets = new int[mSuggestionsInfos.length]; source.readIntArray(mOffsets); mLengths = new int[mSuggestionsInfos.length]; source.readIntArray(mLengths); }
Example 5
Source File: NdefMessage.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public NdefMessage createFromParcel(Parcel in) { int recordsLength = in.readInt(); NdefRecord[] records = new NdefRecord[recordsLength]; in.readTypedArray(records, NdefRecord.CREATOR); return new NdefMessage(records); }
Example 6
Source File: BeamShareData.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public BeamShareData createFromParcel(Parcel source) { Uri[] uris = null; NdefMessage msg = source.readParcelable(NdefMessage.class.getClassLoader()); int numUris = source.readInt(); if (numUris > 0) { uris = new Uri[numUris]; source.readTypedArray(uris, Uri.CREATOR); } UserHandle userHandle = source.readParcelable(UserHandle.class.getClassLoader()); int flags = source.readInt(); return new BeamShareData(msg, uris, userHandle, flags); }
Example 7
Source File: ActivityChangedEvent.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
@Override public ActivityChangedEvent createFromParcel(Parcel source) { int activityRecognitionEventsLength = source.readInt(); ActivityRecognitionEvent[] activityRecognitionEvents = new ActivityRecognitionEvent[activityRecognitionEventsLength]; source.readTypedArray(activityRecognitionEvents, ActivityRecognitionEvent.CREATOR); return new ActivityChangedEvent(activityRecognitionEvents); }
Example 8
Source File: SlotsList.java From decoro with Apache License 2.0 | 5 votes |
protected SlotsList(Parcel in) { this.size = in.readInt(); if (size > 0) { Slot[] slots = new Slot[this.size]; in.readTypedArray(slots, Slot.CREATOR); linkSlots(slots, this); } }
Example 9
Source File: ContactEditText.java From material with Apache License 2.0 | 5 votes |
/** * Constructor called from {@link #CREATOR} */ private SavedState(Parcel in) { super(in); int length = in.readInt(); if(length > 0){ recipients = new Recipient[length]; in.readTypedArray(recipients, Recipient.CREATOR); } }
Example 10
Source File: BeamShareData.java From external-nfc-api with Apache License 2.0 | 5 votes |
@Override public BeamShareData createFromParcel(Parcel source) { Uri[] uris = null; NdefMessage msg = source.readParcelable(NdefMessage.class.getClassLoader()); int numUris = source.readInt(); if (numUris > 0) { uris = new Uri[numUris]; source.readTypedArray(uris, Uri.CREATOR); } UserHandle userHandle = source.readParcelable(UserHandle.class.getClassLoader()); int flags = source.readInt(); return new BeamShareData(msg, uris, userHandle, flags); }
Example 11
Source File: DesfireApplication.java From MensaGuthaben with GNU General Public License v3.0 | 5 votes |
public DesfireApplication createFromParcel(Parcel source) { int id = source.readInt(); DesfireFile[] files = new DesfireFile[source.readInt()]; source.readTypedArray(files, DesfireFile.CREATOR); return new DesfireApplication(id, files); }
Example 12
Source File: EntityParceler.java From requery with Apache License 2.0 | 4 votes |
public T readFromParcel(Parcel in) { T entity = type.getFactory().get(); EntityProxy<T> proxy = type.getProxyProvider().apply(entity); for (Attribute<T, ?> attribute : type.getAttributes()) { if (attribute.isAssociation()) { continue; } Class<?> typeClass = attribute.getClassType(); Object value = null; if (typeClass.isEnum()) { String name = (String) in.readValue(getClass().getClassLoader()); if (name == null) { value = null; } else { @SuppressWarnings("unchecked") Class<? extends Enum> enumClass = (Class<? extends Enum>) typeClass; value = Enum.valueOf(enumClass, name); } } else if (typeClass.isArray()) { int length = in.readInt(); if (length >= 0) { try { Parcelable.Creator creator = (Parcelable.Creator<?>) typeClass.getField("CREATOR").get(null); Object[] array = creator.newArray(length); in.readTypedArray(array, creator); value = array; } catch (Exception e) { throw new RuntimeException(e); } } } else { value = in.readValue(getClass().getClassLoader()); } PropertyState state = PropertyState.LOADED; if (!type.isStateless()) { state = PropertyState.valueOf(in.readString()); } proxy.setObject(attribute, value, state); } return entity; }