Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ryan #79

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from
Open

ryan #79

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fc9cbe9
Intergrate with MSDK 4.15
DJI-William Jun 25, 2021
e8c93cf
Eliminate the private key
DJI-William Jun 25, 2021
c7386c7
Update to 4.15.1
DJI-William Sep 14, 2021
2826b84
Update to 4.15.1
DJI-William Sep 14, 2021
0d5dd8a
Create codeql-analysis.yml
Michael-DJI Sep 23, 2021
6eaa92a
update rxjava to 3.0
Hoker1 Oct 13, 2021
383dc4d
Merge branch 'master' of https://github.com/dji-sdk/Mobile-UXSDK-Beta…
Hoker1 Oct 13, 2021
3a16d98
fix widget preview bug
Hoker1 Oct 15, 2021
9cad7e0
update license date
Hoker1 Dec 29, 2021
f8f36ca
update license date
Hoker1 Dec 29, 2021
5b00677
DJIDeviceUtil.isDJIDevice: fix logic error
accek Jan 8, 2022
a7c7ee2
add for 4.16
Hoker1 Feb 10, 2022
975459a
Merge pull request #52 from accek/patch-1
Michael-DJI Feb 10, 2022
133cf00
Merge pull request #54 from dji-sdk/sdk_releases/4.16
Michael-DJI Feb 10, 2022
48e040c
删掉无用信息
Hoker1 Apr 20, 2022
43603cf
删除无用信息
Hoker1 Apr 20, 2022
04d4ab0
删除无用信息
Hoker1 Apr 20, 2022
d45fe57
clean:
Hoker1 Apr 24, 2022
965f8db
update for 4.16.1
Hoker1 Jun 17, 2022
f020f25
Fixe biuld.gradle for Android Studio (Build #AI-212.5712.43.2112.8512…
kenargo Jun 27, 2022
dcc7a3f
add for exposure
Hoker1 Jun 28, 2022
84f96e6
Fixes root ID issue
kenargo Jun 28, 2022
c68d162
Fixes override parameter name
kenargo Jun 28, 2022
6253c33
Merge pull request #62 from kenargo/Fix_build.gradle
dji-dev Jun 28, 2022
1eac7e7
Merge pull request #63 from kenargo/fixed_override_parameter_names
dji-dev Jun 28, 2022
2fc33d6
update to api 31
Hoker1 Jun 28, 2022
df5c1ef
处理多线程问题
Hoker1 Jun 29, 2022
01bfc40
Align RTK connection reporting status to be the same as DJI Cockpit
kenargo Jul 12, 2022
6b6d6be
update for 4.16.2
Hoker1 Sep 1, 2022
3d8c701
feature: Camera view Switch, Gimbal Orientation Adjustment, Laser Ran…
skycatchci Dec 7, 2022
30ac757
Merge pull request #69 from kenargo/master
dji-dev Dec 8, 2022
dedebdf
Merge pull request #76 from skycatchci/feature/h20-ui-widgets
dji-dev Dec 9, 2022
f92fc2b
add h20 widget
huhuanhuan Feb 1, 2023
1838dee
Merge pull request #78 from huhuanhuan/H20-widget-ui
Hoker- Feb 6, 2023
ed5ca45
fix error
Hoker1 Feb 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '45 14 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
9 changes: 1 addition & 8 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2020 DJI
Copyright (c) 2021 DJI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,10 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

====================================================================================

Mobile-UXSDK-Beta-Android uses several unmodified libraries which are listed along
with their licenses in the `dependencyLicenses.txt` file.

====================================================================================
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ Our long-term plan is for this framework to reach feature parity with the curren
## License

Mobile-UXSDK-Beta-Android is available under the the MIT license. Please see the [LICENSE.txt](https://github.com/dji-sdk/Mobile-UXSDK-Beta-Android/blob/master/LICENSE.txt) file for more info.

Mobile-UXSDK-Beta-Android uses several unmodified libraries which are listed along
with their licenses in the `dependencyLicenses.txt` file.
24 changes: 5 additions & 19 deletions android-uxsdk-beta-accessory/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ android {
lintOptions {
abortOnError = false
}
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 31
publishNonDefault true
resourcePrefix "uxsdk_"
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
minSdkVersion 23
targetSdkVersion 31
versionCode 1
versionName "5.0"
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -68,20 +67,7 @@ android {

dependencies {
api project(path: ':android-uxsdk-beta-core')

implementation ('com.dji:dji-sdk:4.14', {
/**
* Comment the "library-anti-distortion" if your app needs Anti Distortion for Mavic 2 Pro
* and Mavic 2 Zoom.
* Comment the "fly-safe-database" if you don't need a smaller apk for release. When
* uncommented, we will download it when DJISDKManager.getInstance().registerApp
* is called, and it won't register success without fly-safe-database.
* Both will greatly reduce the size of the APK.
*/
exclude module: 'library-anti-distortion'
exclude module: 'fly-safe-database'
})
compileOnly ('com.dji:dji-sdk-provided:4.14')
compileOnly ('com.dji:dji-sdk-provided:4.16.4')

implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
Expand All @@ -94,5 +80,5 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
mavenLocal()
}
5 changes: 2 additions & 3 deletions android-uxsdk-beta-accessory/proguard-test-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@
-keep class android.support.** { *; }
-keep class android.media.** { *; }
-keep class okio.** { *; }
-keep class com.lmax.disruptor.** {
*;
}
-keep class com.lmax.disruptor.** { *; }
-keep class com.qx.wz.dj.rtcm.* { *; }

-dontwarn com.mapbox.services.android.location.LostLocationEngine
-dontwarn com.mapbox.services.android.location.MockLocationEngine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ import android.widget.TextView
import androidx.annotation.*
import androidx.core.content.res.use
import dji.log.DJILog
import dji.thirdparty.io.reactivex.Flowable
import dji.thirdparty.io.reactivex.disposables.Disposable
import dji.thirdparty.io.reactivex.functions.Consumer
import dji.thirdparty.io.reactivex.processors.PublishProcessor
import io.reactivex.rxjava3.core.Flowable
import io.reactivex.rxjava3.disposables.Disposable
import io.reactivex.rxjava3.functions.Consumer
import io.reactivex.rxjava3.processors.PublishProcessor
import dji.ux.beta.accessory.R
import dji.ux.beta.accessory.widget.rtk.RTKEnabledWidget.ModelState
import dji.ux.beta.accessory.widget.rtk.RTKEnabledWidget.ModelState.ProductConnected
Expand All @@ -50,6 +50,7 @@ import dji.ux.beta.core.base.widget.ConstraintLayoutWidget
import dji.ux.beta.core.communication.ObservableInMemoryKeyedStore
import dji.ux.beta.core.extension.*
import dji.ux.beta.core.util.DisplayUtil
import dji.ux.beta.core.util.RxUtil

private const val TAG = "RTKEnabledWidget"

Expand Down Expand Up @@ -204,7 +205,7 @@ open class RTKEnabledWidget @JvmOverloads constructor(
} else {
setRTKEnabled(isChecked)
}
}, logErrorConsumer(TAG, "canEnableRTK: ")))
}, RxUtil.logErrorConsumer(TAG, "canEnableRTK: ")))
uiUpdateStateProcessor.onNext(SwitchChanged(isChecked))
}

Expand Down Expand Up @@ -232,14 +233,13 @@ open class RTKEnabledWidget @JvmOverloads constructor(
if (rtkEnabled != enabled) {
addDisposable(toggleRTK(enabled))
}
}, logErrorConsumer(TAG, "rtkEnabled: ")))
}, RxUtil.logErrorConsumer(TAG, "rtkEnabled: ")))
}

private fun toggleRTK(enabled: Boolean): Disposable {
return widgetModel.setRTKEnabled(enabled)
.observeOn(SchedulerProvider.ui())
.subscribe({}
) { throwable: Throwable ->
.subscribe({}) { throwable: Throwable ->
setRTKSwitch(!enabled)
DJILog.e(TAG, "setRTKEnabled: " + throwable.localizedMessage)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ package dji.ux.beta.accessory.widget.rtk

import dji.keysdk.DJIKey
import dji.keysdk.FlightControllerKey
import dji.thirdparty.io.reactivex.Completable
import dji.thirdparty.io.reactivex.Flowable
import io.reactivex.rxjava3.functions.Consumer
import io.reactivex.rxjava3.core.Flowable
import dji.ux.beta.core.base.DJISDKModel
import dji.ux.beta.core.base.WidgetModel
import dji.ux.beta.core.communication.ObservableInMemoryKeyedStore
import dji.ux.beta.core.util.DataProcessor
import io.reactivex.rxjava3.core.Completable

/**
* Widget Model for the [RTKEnabledWidget] used to define
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ import dji.common.flightcontroller.PositioningSolution
import dji.common.flightcontroller.RTKState
import dji.common.flightcontroller.rtk.NetworkServiceChannelState
import dji.common.product.Model
import dji.thirdparty.io.reactivex.Flowable
import dji.thirdparty.io.reactivex.functions.Consumer
import io.reactivex.rxjava3.core.Flowable
import io.reactivex.rxjava3.functions.Consumer
import dji.ux.beta.accessory.R
import dji.ux.beta.accessory.widget.rtk.RTKSatelliteStatusWidget.ModelState
import dji.ux.beta.accessory.widget.rtk.RTKSatelliteStatusWidget.ModelState.*
Expand All @@ -56,6 +56,7 @@ import dji.ux.beta.core.communication.GlobalPreferencesManager
import dji.ux.beta.core.communication.ObservableInMemoryKeyedStore
import dji.ux.beta.core.extension.*
import dji.ux.beta.core.util.DisplayUtil
import dji.ux.beta.core.util.RxUtil
import dji.ux.beta.core.util.UnitConversionUtil
import java.util.*

Expand Down Expand Up @@ -867,7 +868,7 @@ open class RTKSatelliteStatusWidget @JvmOverloads constructor(
.firstOrError()
.observeOn(SchedulerProvider.ui())
.subscribe(Consumer { updateOrientationStatus(it.isHeadingValid, it.headingSolution) },
logErrorConsumer(TAG, "updateOrientation")))
RxUtil.logErrorConsumer(TAG, "updateOrientation")))
}
}

Expand All @@ -877,7 +878,7 @@ open class RTKSatelliteStatusWidget @JvmOverloads constructor(
.firstOrError()
.observeOn(SchedulerProvider.ui())
.subscribe(Consumer { updateModel(it) },
logErrorConsumer(TAG, "updateModel")))
RxUtil.logErrorConsumer(TAG, "updateModel")))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import dji.keysdk.DJIKey
import dji.keysdk.FlightControllerKey
import dji.keysdk.ProductKey
import dji.sdk.network.RTKNetworkServiceProvider
import dji.thirdparty.io.reactivex.Flowable
import dji.thirdparty.io.reactivex.functions.BiFunction
import io.reactivex.rxjava3.core.Flowable
import io.reactivex.rxjava3.functions.BiFunction
import dji.ux.beta.core.base.DJISDKModel
import dji.ux.beta.core.base.WidgetModel
import dji.ux.beta.core.communication.GlobalPreferenceKeys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import androidx.annotation.ColorInt
import androidx.annotation.DrawableRes
import androidx.annotation.StyleRes
import androidx.core.content.res.use
import dji.thirdparty.io.reactivex.Flowable
import dji.thirdparty.io.reactivex.functions.Consumer
import dji.thirdparty.io.reactivex.processors.PublishProcessor
import io.reactivex.rxjava3.core.Flowable
import io.reactivex.rxjava3.functions.Consumer
import io.reactivex.rxjava3.processors.PublishProcessor
import dji.ux.beta.accessory.R
import dji.ux.beta.accessory.widget.rtk.RTKWidget.ModelState
import dji.ux.beta.accessory.widget.rtk.RTKWidget.ModelState.ProductConnected
Expand All @@ -50,6 +50,7 @@ import dji.ux.beta.core.communication.ObservableInMemoryKeyedStore
import dji.ux.beta.core.communication.OnStateChangeCallback
import dji.ux.beta.core.extension.*
import dji.ux.beta.core.util.DisplayUtil
import dji.ux.beta.core.util.RxUtil

private const val TAG = "RTKWidget"

Expand Down Expand Up @@ -257,7 +258,7 @@ open class RTKWidget @JvmOverloads constructor(
}
uiUpdateStateProcessor.onNext(VisibilityUpdated(visibility == View.VISIBLE))
}
}, logErrorConsumer(TAG, "getRTKSupported: ")))
}, RxUtil.logErrorConsumer(TAG, "getRTKSupported: ")))
}
//endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ package dji.ux.beta.accessory.widget.rtk

import dji.keysdk.DJIKey
import dji.keysdk.FlightControllerKey
import dji.thirdparty.io.reactivex.Flowable
import dji.thirdparty.io.reactivex.functions.Consumer
import io.reactivex.rxjava3.core.Flowable
import io.reactivex.rxjava3.functions.Consumer
import dji.ux.beta.core.base.DJISDKModel
import dji.ux.beta.core.base.SchedulerProvider
import dji.ux.beta.core.base.WidgetModel
import dji.ux.beta.core.communication.ObservableInMemoryKeyedStore
import dji.ux.beta.core.util.DataProcessor
import dji.ux.beta.core.util.RxUtil

private const val TAG = "RTKWidgetModel"

Expand Down Expand Up @@ -75,7 +76,7 @@ class RTKWidgetModel(djiSdkModel: DJISDKModel,
bindDataProcessor(isRTKConnectedKey, isRTKConnectedProcessor) {
addDisposable(djiSdkModel.getValue(rtkEnabledKey)
.observeOn(SchedulerProvider.io())
.subscribe(Consumer { }, logErrorConsumer(TAG, "isRTKEnabled: ")))
.subscribe(Consumer { }, RxUtil.logErrorConsumer(TAG, "isRTKEnabled: ")))
}
}

Expand Down
26 changes: 7 additions & 19 deletions android-uxsdk-beta-cameracore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
lintOptions {
abortOnError = false
}
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 31
publishNonDefault true
resourcePrefix "uxsdk_"
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
minSdkVersion 23
targetSdkVersion 31
versionCode 1
versionName "4.5"
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -68,20 +69,7 @@ android {

dependencies {
api project(path: ':android-uxsdk-beta-core')

implementation ('com.dji:dji-sdk:4.14', {
/**
* Comment the "library-anti-distortion" if your app needs Anti Distortion for Mavic 2 Pro
* and Mavic 2 Zoom.
* Comment the "fly-safe-database" if you don't need a smaller apk for release. When
* uncommented, we will download it when DJISDKManager.getInstance().registerApp
* is called, and it won't register success without fly-safe-database.
* Both will greatly reduce the size of the APK.
*/
exclude module: 'library-anti-distortion'
exclude module: 'fly-safe-database'
})
compileOnly ('com.dji:dji-sdk-provided:4.14')
compileOnly ('com.dji:dji-sdk-provided:4.16.4')

implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
Expand All @@ -93,5 +81,5 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
mavenLocal()
}
5 changes: 2 additions & 3 deletions android-uxsdk-beta-cameracore/proguard-test-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@
-keep class android.support.** { *; }
-keep class android.media.** { *; }
-keep class okio.** { *; }
-keep class com.lmax.disruptor.** {
*;
}
-keep class com.lmax.disruptor.** { *; }
-keep class com.qx.wz.dj.rtcm.* { *; }

-dontwarn com.mapbox.services.android.location.LostLocationEngine
-dontwarn com.mapbox.services.android.location.MockLocationEngine
Expand Down
Loading