1 /*
2  * Copyright (C) 2016 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.net.wifi;
18 
19 import android.os.Parcel;
20 import android.os.Parcelable;
21 
22 /**
23  * This object describes a partial tree structure in the Hotspot 2.0 release 2 management object.
24  * The object is used during subscription remediation to modify parts of an existing PPS MO
25  * tree (Hotspot 2.0 specification section 9.1).
26  * @hide
27  */
28 public class PasspointManagementObjectDefinition implements Parcelable {
29     private final String mBaseUri;
30     private final String mUrn;
31     private final String mMoTree;
32 
PasspointManagementObjectDefinition(String baseUri, String urn, String moTree)33     public PasspointManagementObjectDefinition(String baseUri, String urn, String moTree) {
34         mBaseUri = baseUri;
35         mUrn = urn;
36         mMoTree = moTree;
37     }
38 
getBaseUri()39     public String getBaseUri() {
40         return mBaseUri;
41     }
42 
getUrn()43     public String getUrn() {
44         return mUrn;
45     }
46 
getMoTree()47     public String getMoTree() {
48         return mMoTree;
49     }
50 
51     @Override
describeContents()52     public int describeContents() {
53         return 0;
54     }
55 
56     @Override
writeToParcel(Parcel dest, int flags)57     public void writeToParcel(Parcel dest, int flags) {
58         dest.writeString(mBaseUri);
59         dest.writeString(mUrn);
60         dest.writeString(mMoTree);
61     }
62 
63     /**
64      * Implement the Parcelable interface {@hide}
65      */
66     public static final Creator<PasspointManagementObjectDefinition> CREATOR =
67             new Creator<PasspointManagementObjectDefinition>() {
68                 public PasspointManagementObjectDefinition createFromParcel(Parcel in) {
69                     return new PasspointManagementObjectDefinition(
70                             in.readString(),    /* base URI */
71                             in.readString(),    /* URN */
72                             in.readString()     /* Tree XML */
73                     );
74                 }
75 
76                 public PasspointManagementObjectDefinition[] newArray(int size) {
77                     return new PasspointManagementObjectDefinition[size];
78                 }
79             };
80 }
81 
82