Skip to content

Commit

Permalink
client library bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
m4gr3d committed Feb 8, 2015
1 parent f46d49d commit ebf15ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ClientLib/mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

ext {
PUBLISH_ARTIFACT_ID = '3dr-services-lib'
PUBLISH_VERSION = '2.2.7'
PUBLISH_VERSION = '2.2.8'
PROJECT_DESCRIPTION = "3DR Services Client Library"
PROJECT_LABELS = ['3DR', '3DR Services', 'DroneAPI', 'Android']
PROJECT_LICENSES = ['Apache-2.0']
Expand All @@ -15,7 +15,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 20207
versionCode 20208
versionName PUBLISH_VERSION
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.o3dr.android.client.utils.InstallServiceDialog;
import com.o3dr.android.client.utils.UpdateServiceDialog;
import com.o3dr.services.android.lib.BuildConfig;
import com.o3dr.services.android.lib.drone.connection.ConnectionParameter;
import com.o3dr.services.android.lib.model.IDroidPlannerServices;

import java.util.concurrent.atomic.AtomicBoolean;
Expand Down Expand Up @@ -98,15 +99,21 @@ void notifyTowerDisconnected() {
}

public Bundle[] getConnectedApps() {
Bundle[] connectedApps = new Bundle[0];
if (isTowerConnected()) {
try {
return o3drServices.getConnectedApps(getApplicationId());
connectedApps = o3drServices.getConnectedApps(getApplicationId());
if(connectedApps != null){
for(Bundle appInfo: connectedApps){
appInfo.setClassLoader(ConnectionParameter.class.getClassLoader());
}
}
} catch (RemoteException e) {
Log.e(TAG, e.getMessage(), e);
}
}

return new Bundle[0];
return connectedApps;
}

public void registerDrone(Drone drone, Handler handler) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ public void registerDroneListener(DroneListener listener) {
if (listener == null)
return;

droneListeners.add(listener);
if (!droneListeners.contains(listener))
droneListeners.add(listener);
}

private void addAttributesObserver(IObserver observer) {
Expand Down

0 comments on commit ebf15ec

Please sign in to comment.