1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License 15 */ 16 17 package android.nfc; 18 19 import android.os.Parcel; 20 import android.os.Parcelable; 21 22 /** @hide */ 23 public class TechListParcel implements Parcelable { 24 25 private String[][] mTechLists; 26 27 public TechListParcel(String[]... strings) { 28 mTechLists = strings; 29 } 30 31 public String[][] getTechLists() { 32 return mTechLists; 33 } 34 35 @Override 36 public int describeContents() { 37 return 0; 38 } 39 40 @Override 41 public void writeToParcel(Parcel dest, int flags) { 42 int count = mTechLists.length; 43 dest.writeInt(count); 44 for (int i = 0; i < count; i++) { 45 String[] techList = mTechLists[i]; 46 dest.writeStringArray(techList); 47 } 48 } 49 50 public static final Creator<TechListParcel> CREATOR = new Creator<TechListParcel>() { 51 @Override 52 public TechListParcel createFromParcel(Parcel source) { 53 int count = source.readInt(); 54 String[][] techLists = new String[count][]; 55 for (int i = 0; i < count; i++) { 56 techLists[i] = source.readStringArray(); 57 } 58 return new TechListParcel(techLists); 59 } 60 61 @Override 62 public TechListParcel[] newArray(int size) { 63 return new TechListParcel[size]; 64 } 65 }; 66 } 67