import old mobicore
[GitHub/LineageOS/android_hardware_samsung_slsi_exynos7580.git] / mobicore / rootpa / Code / Android / lib / src / com / gd / mobicore / pa / ifc / Version.java
CommitLineData
cd9434cc 1/*
15e8442f
JA
2Copyright © Trustonic Limited 2013
3
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without modification,
7are permitted provided that the following conditions are met:
8
9 1. Redistributions of source code must retain the above copyright notice, this
10 list of conditions and the following disclaimer.
11
12 2. Redistributions in binary form must reproduce the above copyright notice,
13 this list of conditions and the following disclaimer in the documentation
14 and/or other materials provided with the distribution.
15
16 3. Neither the name of the Trustonic Limited nor the names of its contributors
17 may be used to endorse or promote products derived from this software
18 without specific prior written permission.
19
20THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29OF THE POSSIBILITY OF SUCH DAMAGE.
30*/
cd9434cc
T
31
32package com.gd.mobicore.pa.ifc;
33
34import android.os.Bundle;
35import android.os.Parcel;
36import android.os.Parcelable;
37
38import java.util.Map;
39
40/**
41 * Contains the device's product ID and a collection of version numbers for various software components installed on
42 * the device.
43 */
44public class Version implements Parcelable {
45 public final static String VERSION_FIELD_TAG="TAG";
46 public final static String VERSION_FIELD_TAG1ALL="TAG1ALL";
47 public final static String VERSION_FIELD_MCI="MCI";
48 public final static String VERSION_FIELD_SO="SO";
49 public final static String VERSION_FIELD_MCLF="MCLF";
50 public final static String VERSION_FIELD_CONT="CONT";
51 public final static String VERSION_FIELD_MCCONF="MCCONF";
52 public final static String VERSION_FIELD_TLAPI="TLAPI";
53 public final static String VERSION_FIELD_DRAPI="DRAPI";
54 public final static String VERSION_FIELD_CMP="CMP";
55
56 private String productId_;
57 private Bundle version_;
58
59 public Version() {
60 }
61
62 public Version(String productId, Bundle version) {
63 setVersion(version);
64 setProductId(productId);
65 }
66
67 public String productId() {
68 return productId_;
69 }
70
71 public void setProductId(String productId) {
72 this.productId_ = productId;
73 }
74
75 public Bundle version() {
76 return version_;
77 }
78
79 public void setVersion(Bundle version) {
80 this.version_ = version;
81 }
82
83//parcelable interface
84
85 public static final Creator<Version> CREATOR = new Creator<Version>() {
86 public Version createFromParcel(Parcel in) {
87 return new Version(in);
88 }
89
90 public Version[] newArray(int size) {
91 return new Version[size];
92 }
93 };
94
95 private Version(Parcel in) {
96 readFromParcel(in);
97 }
98
99 public void readFromParcel(Parcel in) {
100 productId_ = in.readString();
101 version_ = in.readBundle();
102 }
103
104 @Override
105 public int describeContents() {
106 return 0;
107 }
108
109 @Override
110 public void writeToParcel(Parcel out, int flags) {
111 if(productId_!=null){
15e8442f 112 out.writeString(productId_);
cd9434cc
T
113 }
114 if(version_!=null){
115 out.writeBundle(version_);
116 }
117 }
118
119}