Unverified Commit 1e92dc5c authored by Javier Guerra's avatar Javier Guerra Committed by GitHub

Merge pull request #9 from openconnectivity/develop

Merge develop into master
parents 857cb317 abe7844a
......@@ -53,11 +53,15 @@ The steps required to build the binary of the IoTivity-lite Android API is shown
```
git checkout swig
```
2. Go to the **android** directory.
2. Apply the patch of the OTGC in IoTivity-lite
```
git apply <otgc-android>/extlibs/patchs/remove_cred_by_credid.patch
```
3. Go to the **android** directory.
```
cd <iotivity-lite>/port/android
```
3. Execute the command to build the library.
4. Execute the command to build the library.
```
make NDK_HOME=<ndk-directory> ANDROID_API=21 DEBUG=1 SECURE=1 IPV4=1 TCP=0 PKI=1 DYNAMIC=1 CLOUD=0 JAVA=1 IDD=1
```
......
iotivity-lite @ 513d1c9a
Subproject commit 1b955e8d56e87d8fe7c18098f7df4740e9ce0867
Subproject commit 513d1c9a707beaee87e7fe32742d66ab5bd897fc
......@@ -13,10 +13,10 @@ index acbab8c..c16b512 100644
}
#endif
diff --git a/security/oc_pki.c b/security/oc_pki.c
index a3ecc4f..97e8fb3 100644
index a9306c2..c9b3b15 100644
--- a/security/oc_pki.c
+++ b/security/oc_pki.c
@@ -334,6 +334,16 @@ oc_pki_add_trust_anchor(size_t device, const unsigned char *cert,
@@ -354,6 +354,16 @@ oc_pki_add_trust_anchor(size_t device, const unsigned char *cert,
return pki_add_trust_anchor(device, cert, cert_size, OC_CREDUSAGE_TRUSTCA);
}
......@@ -34,16 +34,15 @@ index a3ecc4f..97e8fb3 100644
typedef int dummy_declaration;
#endif /* !OC_PKI */
diff --git a/swig/swig_interfaces/oc_pki.i b/swig/swig_interfaces/oc_pki.i
index ae654bb..c4bae02 100644
index 2765e56..9910770 100644
--- a/swig/swig_interfaces/oc_pki.i
+++ b/swig/swig_interfaces/oc_pki.i
@@ -32,6 +32,6 @@
%rename (addMfgTrustAnchor) oc_pki_add_mfg_trust_anchor;
%rename (addTrustAnchor) oc_pki_add_trust_anchor;
%rename (setSecurityProfile) oc_pki_set_security_profile;
+%rename (removeCredentialByCredid) oc_pki_remove_credential_by_credid;
@@ -105,4 +105,6 @@ void jni_pki_set_security_profile(size_t device,
}
%}
-
-%include "oc_pki.h"
\ No newline at end of file
+%include "oc_pki.h"
+%rename (removeCredentialByCredid) oc_pki_remove_credential_by_credid;
+
+%include "oc_pki.h"
\ No newline at end of file
......@@ -30,7 +30,7 @@ android {
minSdkVersion 21
targetSdkVersion 28
versionCode 13
versionName "2.0.6"
versionName "2.0.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
compileOptions {
......
......@@ -313,11 +313,11 @@ public class IotivityRepository {
};
String scope = preferencesRepository.getDiscoveryScope();
if (scope.equals(DiscoveryScope.DISCOVERY_SCOPE_SITE)) {
if (scope.equals(DiscoveryScope.DISCOVERY_SCOPE_REALM)) {
if (!OCMain.doRealmLocalIPv6Multicast(OcfResourceUri.RES_URI, null, handler)) {
emitter.onError(new Exception("Error scanning hosts"));
}
} else if (scope.equals(DiscoveryScope.DISCOVERY_SCOPE_REALM)) {
} else if (scope.equals(DiscoveryScope.DISCOVERY_SCOPE_SITE)) {
if (!OCMain.doSiteLocalIPv6Multicast(OcfResourceUri.RES_URI, null, handler)) {
emitter.onError(new Exception("Error scanning hosts"));
}
......
......@@ -319,6 +319,16 @@ public class DoxsFragment extends Fragment implements DoxsViewModel.SelectOxMLis
getActivity().runOnUiThread(() -> {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(getActivity());
alertDialog.setTitle(R.string.devices_select_oxm_title);
alertDialog.setOnCancelListener((dialog) -> {
dialog.dismiss();
try {
synchronized (lock) {
lock.notifyAll();
}
} catch (Exception e) {
Timber.e(e);
}
});
alertDialog.setItems(options.toArray(new CharSequence[0]), (dialog, which) -> {
dialog.dismiss();
try {
......
......@@ -57,7 +57,6 @@ import org.openconnectivity.otgc.domain.usecase.wifi.ScanWiFiNetworksUseCase;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
......@@ -227,7 +226,6 @@ public class DoxsViewModel extends BaseViewModel {
}).filter(oxm -> oxm != null))
.subscribeOn(mSchedulersFacade.io())
.observeOn(mSchedulersFacade.ui())
.doOnSubscribe(__ -> otmResponse.setValue(Response.loading()))
.subscribe(
oxm -> mOnboardUseCase.execute(deviceToOnboard, oxm)
.map(device -> {
......@@ -240,6 +238,7 @@ public class DoxsViewModel extends BaseViewModel {
})
.subscribeOn(mSchedulersFacade.io())
.observeOn(mSchedulersFacade.ui())
.doOnSubscribe(__ -> otmResponse.setValue(Response.loading()))
.subscribe(
ownedDevice -> mCreateAclUseCase.execute(ownedDevice, true, Arrays.asList("*"), 31)
.subscribeOn(mSchedulersFacade.io())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment