Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / service / easy-setup / mediator / richsdk / android / EasySetupCore / src / main / java / org / iotivity / service / easysetup / mediator / RemoteEnrollee.java
1 /**
2  * ***************************************************************
3  * <p/>
4  * Copyright 2016 Samsung Electronics All Rights Reserved.
5  * <p/>
6  * <p/>
7  * <p/>
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * <p/>
12  * http://www.apache.org/licenses/LICENSE-2.0
13  * <p/>
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * <p/>
20  * ****************************************************************
21  */
22
23
24 package org.iotivity.service.easysetup.mediator;
25
26 import android.util.Log;
27
28 public class RemoteEnrollee{
29
30     public static final String TAG = RemoteEnrollee.class.getName();
31     private long m_nativeHandle;
32
33     private native void nativeStartProvision();
34     private native void nativeStopProvision();
35     private native void nativeRegisterProvisioningHandler(IProvisionStatusNativeHandler listener);
36
37     /* constructor will be invoked from the native layer */
38     private RemoteEnrollee(long nativeHandle){
39         this.m_nativeHandle = nativeHandle;
40     }
41
42     /* Register native Listener for the Provisioning state */
43     public void registerProvisioningHandler( IProvisionStatusNativeHandler provisioningListener) throws ESException{
44        // this.provisioningListener = provisioningListener;
45         nativeRegisterProvisioningHandler(provisioningListener);
46         Log.i(TAG, "JNI Callback is registered for getting provisioning status");
47     }
48
49     /* native StartProvision */
50     public void startProvision() throws ESException{
51     nativeStartProvision();
52 }
53
54     /* native stopProvision */
55     public void stopProvision() throws  ESException{
56     nativeStopProvision();
57 }
58
59 }