File tree Expand file tree Collapse file tree 11 files changed +36
-16
lines changed
src/main/java/video/api/uploader/service/example
src/main/java/video/api/uploader/work/example
src/main/java/video/api/uploader/api Expand file tree Collapse file tree 11 files changed +36
-16
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
All changes to this project will be documented in this file.
3
3
4
+ ## [ 1.3.2] - 2023-09-26
5
+ - Extend Android minSdkVersion to 21
6
+
4
7
## [ 1.3.1] - 2023-08-22
5
8
- Fix cancellation of upload workers for the WorkManager API
6
9
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ Add this dependency to your project's POM:
49
49
<dependency >
50
50
<groupId >video.api</groupId >
51
51
<artifactId >android-video-uploader</artifactId >
52
- <version >1.3.1 </version >
52
+ <version >1.3.2 </version >
53
53
<scope >compile</scope >
54
54
</dependency >
55
55
```
@@ -59,7 +59,7 @@ Add this dependency to your project's POM:
59
59
Add this dependency to your project's build file:
60
60
61
61
``` groovy
62
- implementation "video.api:android-video-uploader:1.3.1 "
62
+ implementation "video.api:android-video-uploader:1.3.2 "
63
63
```
64
64
65
65
### Others
@@ -72,7 +72,7 @@ mvn clean package
72
72
73
73
Then manually install the following JARs:
74
74
75
- * ` target/android-video-uploader-1.3.1 .jar `
75
+ * ` target/android-video-uploader-1.3.2 .jar `
76
76
* ` target/lib/*.jar `
77
77
78
78
## Code sample
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ apply plugin: 'maven-publish'
5
5
apply plugin : ' kotlin-android'
6
6
7
7
group = ' video.api'
8
- version = ' 1.3.1 '
8
+ version = ' 1.3.2 '
9
9
10
10
buildscript {
11
11
repositories {
@@ -36,7 +36,7 @@ if(hasProperty('target') && target == 'android') {
36
36
compileSdkVersion 33
37
37
buildToolsVersion ' 30.0.3'
38
38
defaultConfig {
39
- minSdkVersion 24
39
+ minSdkVersion 21
40
40
targetSdkVersion 33
41
41
multiDexEnabled true
42
42
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ android {
8
8
9
9
defaultConfig {
10
10
applicationId " video.api.uploader.service.example"
11
- minSdk 24
11
+ minSdk 21
12
12
targetSdk 33
13
13
versionCode 1
14
14
versionName " 1.0"
Original file line number Diff line number Diff line change @@ -16,13 +16,21 @@ class ReadStorePermissionManager(
16
16
} else {
17
17
android.Manifest .permission.READ_EXTERNAL_STORAGE
18
18
}
19
+
19
20
private val hasPermission: Boolean
20
- get() = activity.checkSelfPermission(requiredPermission) == PackageManager .PERMISSION_GRANTED
21
+ get() = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) {
22
+ activity.checkSelfPermission(requiredPermission) == PackageManager .PERMISSION_GRANTED
23
+ } else {
24
+ true
25
+ }
21
26
22
27
fun requestPermission () {
23
28
if (hasPermission) {
24
29
onGranted()
25
30
} else {
31
+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .M ) {
32
+ throw IllegalStateException (" Permission should be granted" )
33
+ }
26
34
if (activity.shouldShowRequestPermissionRationale(requiredPermission)) {
27
35
onShowPermissionRationale(requiredPermission) {
28
36
requestPermission.launch(requiredPermission)
@@ -41,4 +49,4 @@ class ReadStorePermissionManager(
41
49
onDenied()
42
50
}
43
51
}
44
- }
52
+ }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ android {
8
8
9
9
defaultConfig {
10
10
applicationId " video.api.uploader.work.example"
11
- minSdkVersion 24
11
+ minSdkVersion 21
12
12
targetSdkVersion 33
13
13
versionCode 1
14
14
versionName " 1.0"
Original file line number Diff line number Diff line change @@ -16,13 +16,21 @@ class ReadStorePermissionManager(
16
16
} else {
17
17
android.Manifest .permission.READ_EXTERNAL_STORAGE
18
18
}
19
+
19
20
private val hasPermission: Boolean
20
- get() = activity.checkSelfPermission(requiredPermission) == PackageManager .PERMISSION_GRANTED
21
+ get() = if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .M ) {
22
+ activity.checkSelfPermission(requiredPermission) == PackageManager .PERMISSION_GRANTED
23
+ } else {
24
+ true
25
+ }
21
26
22
27
fun requestPermission () {
23
28
if (hasPermission) {
24
29
onGranted()
25
30
} else {
31
+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .M ) {
32
+ throw IllegalStateException (" Permission should be granted" )
33
+ }
26
34
if (activity.shouldShowRequestPermissionRationale(requiredPermission)) {
27
35
onShowPermissionRationale(requiredPermission) {
28
36
requestPermission.launch(requiredPermission)
@@ -41,4 +49,4 @@ class ReadStorePermissionManager(
41
49
onDenied()
42
50
}
43
51
}
44
- }
52
+ }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ apply plugin: 'maven-publish'
18
18
apply plugin : ' signing'
19
19
20
20
def isReleaseBuild () {
21
- return ! " 1.3.1 " . contains(" SNAPSHOT" )
21
+ return ! " 1.3.2 " . contains(" SNAPSHOT" )
22
22
}
23
23
24
24
def getReleaseRepositoryUrl () {
@@ -47,7 +47,7 @@ afterEvaluate { project ->
47
47
48
48
groupId = " video.api"
49
49
artifactId = " android-video-uploader"
50
- version = " 1.3.1 "
50
+ version = " 1.3.2 "
51
51
52
52
pom {
53
53
name = " video.api:android-video-uploader"
Original file line number Diff line number Diff line change 5
5
<artifactId >android-video-uploader</artifactId >
6
6
<packaging >jar</packaging >
7
7
<name >${project.groupId} :${project.artifactId} </name >
8
- <version >1.3.1 </version >
8
+ <version >1.3.2 </version >
9
9
<url >https://github.com/apivideo/api.video-android-uploader</url >
10
10
<description >api.video Android API video uploader</description >
11
11
<scm >
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ private OkHttpClient initHttpClient(List<Interceptor> interceptors) {
118
118
private void init () {
119
119
verifyingSsl = true ;
120
120
json = new JSON ();
121
- addDefaultHeader ("AV-Origin-Client" , "android-uploader:1.3.1 " );
121
+ addDefaultHeader ("AV-Origin-Client" , "android-uploader:1.3.2 " );
122
122
}
123
123
124
124
private boolean isValid (String regex , String field ) {
You can’t perform that action at this time.
0 commit comments