Skip to content

Commit

Permalink
Merge pull request #15 from DroidPlanner/cleaning_deprecated_functions
Browse files Browse the repository at this point in the history
Cleaning deprecated functions
  • Loading branch information
m4gr3d committed Dec 22, 2014
2 parents 66ccb35 + 6d53766 commit 0477dcf
Show file tree
Hide file tree
Showing 18 changed files with 371 additions and 253 deletions.
9 changes: 7 additions & 2 deletions AidlLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 200018
versionName '2.0.18'
versionCode 200020
versionName '2.0.20'
}

defaultPublishConfig "release"
publishNonDefault false

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*/
public class StreamRates implements Parcelable {

private static final int DEFAULT_RATE = 2; //hz

private int extendedStatus;
private int extra1;
private int extra2;
Expand All @@ -17,7 +19,20 @@ public class StreamRates implements Parcelable {
private int rawSensors;
private int rawController;

public StreamRates(){}
public StreamRates(){
this(DEFAULT_RATE);
}

public StreamRates(int defaultRate){
extendedStatus = defaultRate;
extra1 = defaultRate;
extra2 = defaultRate;
extra3 = defaultRate;
position = defaultRate;
rcChannels = defaultRate;
rawSensors = defaultRate;
rawController = defaultRate;
}

public int getExtendedStatus() {
return extendedStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public class State implements Parcelable {
private boolean armed;
private boolean isFlying;
private String calibrationStatus;
private VehicleMode vehicleMode;
private VehicleMode vehicleMode = VehicleMode.UNKNOWN;
private String failsafeWarning;
private int mavlinkVersion;
private int mavlinkVersion = INVALID_MAVLINK_VERSION;

public State(){}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public String getLabel(){
}
}

private int droneType;
private int droneType = TYPE_UNKNOWN;
private String firmwareVersion;
private Firmware firmware;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import com.o3dr.services.android.lib.drone.connection.ConnectionResult;
interface IApiListener {

/**
* Ping the api listener to make sure it's still up and connected.
* Retrieve the version code for the api.
*/
boolean ping();
int getApiVersionCode();

/**
* Called when the connection attempt fails.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,9 @@ import com.o3dr.services.android.lib.model.IApiListener;
interface IDroidPlannerServices {

/**
* Ping the 3DR Services to make sure it's still up and connected.
* Retrieve the version code for the 3DR Service implementation.
*/
boolean ping();

/**
* TODO: left now for backward compatibility. To be removed in next version.
* Acquire an handle to the droidplanner api.
* @param appId application id for the application acquiring the drone api handle.
* @return IDroneApi object used to interact with the drone.
* @deprecated use {@link #registerDroneApi(IApiListener listener, String appId)} instead.
*/
IDroneApi acquireDroneApi(String appId);
int getServiceVersionCode();

/**
* Release the handle to the droidplanner api.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// IObserver.aidl
package com.o3dr.services.android.lib.model;

import com.o3dr.services.android.lib.drone.connection.ConnectionResult;

/**
* Asynchronous notification on change of vehicle state is available by registering observers for
* attribute changes.
Expand All @@ -16,10 +14,4 @@ oneway interface IObserver {
*/
void onAttributeUpdated(String attributeEvent, in Bundle eventExtras);

/**
* TODO: left now for backward compatibility. To be removed in next version.
* Called when the connection attempt fails.
* @param result Describe why the connection failed.
*/
void onConnectionFailed(in ConnectionResult result);
}
9 changes: 7 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.1.14'
PUBLISH_VERSION = '2.1.23'
PROJECT_DESCRIPTION = "3DR Services client library"
PROJECT_LABELS = ['3DR', '3DR Services', 'DroneAPI', 'Android']
PROJECT_LICENSES = ['Apache-2.0']
Expand All @@ -15,10 +15,15 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 20114
versionCode 20123
versionName PUBLISH_VERSION
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

android.libraryVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
Expand Down
Binary file modified ClientLib/mobile/libs/AidlLib.jar
Binary file not shown.
1 change: 1 addition & 0 deletions ClientLib/mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:excludeFromRecents="true"
android:launchMode="singleTask"/>


<activity
android:name=".utils.UpdateServiceDialog"
android:theme="@android:style/Theme.Holo.Light.Dialog.NoActionBar.MinWidth"
Expand Down
Loading

0 comments on commit 0477dcf

Please sign in to comment.