1/*
2 * Copyright (C) 2014 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
17package com.android.omadm.service;
18
19import android.util.Log;
20
21class DMPkg0Notification {
22    private static final String TAG = "DMPkg0Notification";
23    private static final boolean DBG = DMClientService.DBG;
24
25    private int mUIMode;
26
27    private int mInitiator;
28
29    private int mSessionID;
30
31    private String mServerID;
32
33    private boolean mAuthFlag;
34
35    public DMPkg0Notification() {
36        mSessionID = 0;
37        mUIMode = 0;
38        mInitiator = 0;
39        mAuthFlag = false;
40        mServerID = null;
41    }
42
43    public int getSessionID() {
44        return mSessionID;
45    }
46
47    public int getUIMode() {
48        return mUIMode;
49    }
50
51    public int getInitiator() {
52        return mInitiator;
53    }
54
55    public boolean getAuthFlag() {
56        return mAuthFlag;
57    }
58
59    public String getServerID() {
60        return mServerID;
61    }
62
63    /**
64     * Set the session ID.
65     * Called from JNI code.
66     *
67     * @param sessionID
68     */
69    public void setSessionID(int sessionID) {
70        if (DBG) logd("setSessionID: " + sessionID);
71        mSessionID = sessionID;
72    }
73
74    /**
75     * Set the UI mode.
76     * Called from JNI code.
77     *
78     * @param uiMode
79     */
80    public void setUIMode(int uiMode) {
81        if (DBG) logd("setUIMode: " + uiMode);
82        mUIMode = uiMode;
83    }
84
85    /**
86     * Set the initiator.
87     * Called from JNI code.
88     *
89     * @param initiator
90     */
91    public void setInitiator(int initiator) {
92        if (DBG) logd("setInitiator: " + initiator);
93        mInitiator = initiator;
94    }
95
96    /**
97     * Set the auth flag.
98     * Called from JNI code.
99     *
100     * @param authFlag
101     */
102    public void setAuthFlag(int authFlag) {
103        if (DBG) logd("setAuthFlag: " + authFlag);
104        mAuthFlag = authFlag == 1;
105    }
106
107    /**
108     * Set the server ID.
109     * Called from JNI code.
110     *
111     * @param serverID
112     */
113    public void setServerID(String serverID) {
114        if (DBG) logd("setServerID: \"" + serverID + '"');
115        mServerID = serverID;
116    }
117
118    private static void logd(String msg) {
119        Log.d(TAG, msg);
120    }
121}
122