From 9a4c4e4a1a72faccb63d78636f1fbe3d03c85ed5 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Tue, 8 Dec 2020 01:09:00 +0300 Subject: [PATCH 1/3] enable legacy sdcard access --- app/build.gradle | 4 ++-- app/src/main/AndroidManifest.xml | 1 + build.gradle | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7a6ec12..1760234 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' apply plugin: 'com.github.axet.dxplugin' android { - compileSdkVersion 25 + compileSdkVersion 29 buildToolsVersion '28.0.3' defaultConfig { @@ -54,6 +54,6 @@ android { dependencies { testImplementation 'junit:junit:4.12' implementation 'com.github.axet:android-audio-library:1.0.178' // implementation project(':android-audio-library') - implementation ('com.github.axet:wget:1.6.1') { exclude group: 'org.json', module: 'json' } + implementation ('com.github.axet:wget:1.7.0') { exclude group: 'org.json', module: 'json' } assets('com.google.android.exoplayer:exoplayer:2.7.3') { exclude group: 'com.android.support' } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8bb58f8..c078dde 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -19,6 +19,7 @@ android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" + android:requestLegacyExternalStorage="true" android:roundIcon="@mipmap/ic_launcher" android:supportsRtl="true" android:theme="@style/RecThemeLight"> diff --git a/build.gradle b/build.gradle index 8e6ffc2..9696088 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.1' + classpath 'com.android.tools.build:gradle:4.0.2' classpath 'com.github.axet:gradle-android-dx:0.0.4' } } From 966e90339f2bb62c81baf2cda58877ee2183d9c5 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Thu, 10 Dec 2020 23:11:10 +0300 Subject: [PATCH 2/3] lockscreen control only during lock screen --- app/src/main/AndroidManifest.xml | 1 + .../activities/MainActivity.java | 2 + .../activities/RecordingActivity.java | 3 + .../activities/SettingsActivity.java | 8 +- .../audiorecorder/app/AudioApplication.java | 2 + .../services/ControlsService.java | 236 ++++++++++++++++++ .../services/OnBootReceiver.java | 1 + .../services/OnExternalReceiver.java | 1 + .../services/OnUpgradeReceiver.java | 1 + .../services/RecordingService.java | 77 ++---- 10 files changed, 279 insertions(+), 53 deletions(-) create mode 100644 app/src/main/java/com/github/axet/audiorecorder/services/ControlsService.java diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c078dde..bd59451 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -25,6 +25,7 @@ android:theme="@style/RecThemeLight"> + = 16 && icon.notification.bigContentView != null) { + a = new RemoteViews(getPackageName(), icon.notification.bigContentView.getLayoutId()); a.setTextViewText(R.id.title, title); - RemoteViewsCompat.mergeRemoteViews(icon.notification.contentView, a); - if (Build.VERSION.SDK_INT >= 16 && icon.notification.bigContentView != null) { - a = new RemoteViews(getPackageName(), icon.notification.bigContentView.getLayoutId()); - a.setTextViewText(R.id.title, title); - RemoteViewsCompat.mergeRemoteViews(icon.notification.bigContentView, a); - } - return icon.notification; - } catch (RuntimeException e) { - Log.d(TAG, "merge failed", e); + RemoteViewsCompat.mergeRemoteViews(icon.notification.bigContentView, a); } + return icon.notification; + } catch (RuntimeException e) { + Log.d(TAG, "merge failed", e); } } - text = ".../" + targetFile; - builder = new RemoteNotificationCompat.Builder(context, R.layout.notifictaion); - builder.setViewVisibility(R.id.notification_record, View.GONE); - builder.setViewVisibility(R.id.notification_pause, View.VISIBLE); - main = PendingIntent.getService(context, 0, new Intent(context, RecordingService.class) - .setAction(SHOW_ACTIVITY) - .putExtra("targetFile", targetFile) - .putExtra("recording", recording), PendingIntent.FLAG_UPDATE_CURRENT); } + text = ".../" + targetFile; + builder = new RemoteNotificationCompat.Builder(context, R.layout.notifictaion); + builder.setViewVisibility(R.id.notification_record, View.GONE); + builder.setViewVisibility(R.id.notification_pause, View.VISIBLE); + main = PendingIntent.getService(context, 0, new Intent(context, RecordingService.class) + .setAction(SHOW_ACTIVITY) + .putExtra("targetFile", targetFile) + .putExtra("recording", recording), PendingIntent.FLAG_UPDATE_CURRENT); PendingIntent pe = PendingIntent.getService(context, 0, new Intent(context, RecordingService.class).setAction(PAUSE_BUTTON), From b15848beed31945167c9ff33b3a87e527edfa5e6 Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Thu, 10 Dec 2020 23:12:55 +0300 Subject: [PATCH 3/3] Bump version audiorecorder-3.4.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1760234..eaa3060 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "com.github.axet.audiorecorder" minSdkVersion 9 targetSdkVersion 29 - versionCode 349 - versionName "3.3.24" + versionCode 350 + versionName "3.4.0" } signingConfigs { release {