Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/sony-headphones-control.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-03-06 23:24:28 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-03-06 23:24:28 +0300
commitda94bf05013964069f2ce098b38361ea80513a18 (patch)
tree4b330a3dcce7d237eb104ddd61d315533b327752
parent4d334c54555441eb0fd630512b3dd878c6d353a2 (diff)
Refactoring, migrated to newer SDK
-rw-r--r--app/build.gradle4
-rw-r--r--app/src/main/java/com/clusterrr/sonyheadphonescontrol/MainActivity.java8
-rw-r--r--app/src/main/java/com/clusterrr/sonyheadphonescontrol/TaskerFireReceiver.java2
-rw-r--r--app/src/main/java/net/dinglisch/android/tasker/TaskerPlugin.java2
-rw-r--r--build.gradle2
5 files changed, 9 insertions, 9 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 378aadd..bdafacb 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 28
+ compileSdkVersion 30
defaultConfig {
applicationId "com.clusterrr.sonyheadphonescontrol"
minSdkVersion 18
- targetSdkVersion 28
+ targetSdkVersion 30
versionCode 3
versionName "1.1"
}
diff --git a/app/src/main/java/com/clusterrr/sonyheadphonescontrol/MainActivity.java b/app/src/main/java/com/clusterrr/sonyheadphonescontrol/MainActivity.java
index 7db990d..eaca5d5 100644
--- a/app/src/main/java/com/clusterrr/sonyheadphonescontrol/MainActivity.java
+++ b/app/src/main/java/com/clusterrr/sonyheadphonescontrol/MainActivity.java
@@ -74,16 +74,16 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
String blurb = "";
if (((RadioButton) findViewById(R.id.radioButtonDisable)).isChecked()) {
- mode = 0;
+ mode = TaskerFireReceiver.KEY_OFF;
blurb = ((RadioButton) findViewById(R.id.radioButtonDisable)).getText().toString();
} else if (((RadioButton) findViewById(R.id.radioButtonNoiseCancelling)).isChecked()) {
- mode = 1;
+ mode = TaskerFireReceiver.KEY_NOISE_CANCELLING;
blurb = ((RadioButton) findViewById(R.id.radioButtonNoiseCancelling)).getText().toString();
} else if (((RadioButton) findViewById(R.id.radioButtonWindCancelling)).isChecked()) {
- mode = 2;
+ mode = TaskerFireReceiver.KEY_WIND_CANCELLING;
blurb = ((RadioButton) findViewById(R.id.radioButtonWindCancelling)).getText().toString();
} else if (((RadioButton) findViewById(R.id.radioButtonAmbientSound)).isChecked()) {
- mode = 3;
+ mode = TaskerFireReceiver.KEY_AMBIENT_SOUND;
volume = ((SeekBar) findViewById(R.id.seekBarVolume)).getProgress() + 1;
voice = ((Switch) findViewById(R.id.switchVoiceOptimized)).isChecked();
blurb = ((RadioButton) findViewById(R.id.radioButtonAmbientSound)).getText().toString() +
diff --git a/app/src/main/java/com/clusterrr/sonyheadphonescontrol/TaskerFireReceiver.java b/app/src/main/java/com/clusterrr/sonyheadphonescontrol/TaskerFireReceiver.java
index 95dc41a..9e97f2c 100644
--- a/app/src/main/java/com/clusterrr/sonyheadphonescontrol/TaskerFireReceiver.java
+++ b/app/src/main/java/com/clusterrr/sonyheadphonescontrol/TaskerFireReceiver.java
@@ -165,7 +165,7 @@ public final class TaskerFireReceiver extends BroadcastReceiver {
throws IOException, InterruptedException, TimeoutException {
return findByUUIDAndSend(context, HEADSET_UUIDS, COMMAND_SET_MODE,
new byte[]{0x68, 0x02,
- (byte) (enabled ? 0x10 : 0x00), 0x02, (byte) (noiseCancelling), 0x01,
+ (byte) (enabled ? 0x10 : 0x00), 0x02, (byte) noiseCancelling, 0x01,
(byte) (voice ? 1 : 0), (byte) volume});
}
diff --git a/app/src/main/java/net/dinglisch/android/tasker/TaskerPlugin.java b/app/src/main/java/net/dinglisch/android/tasker/TaskerPlugin.java
index fb00be1..822826b 100644
--- a/app/src/main/java/net/dinglisch/android/tasker/TaskerPlugin.java
+++ b/app/src/main/java/net/dinglisch/android/tasker/TaskerPlugin.java
@@ -442,7 +442,7 @@ public class TaskerPlugin {
if (
( timeoutMS > REQUESTED_TIMEOUT_MS_MAX ) &&
( timeoutMS != REQUESTED_TIMEOUT_MS_NEVER )
- ) {
+ ) {
Log.w( TAG, "requestTimeoutMS: requested timeout " + timeoutMS + " exceeds maximum, setting to max (" + REQUESTED_TIMEOUT_MS_MAX + ")" );
timeoutMS = REQUESTED_TIMEOUT_MS_MAX;
}
diff --git a/build.gradle b/build.gradle
index 5509623..69cab14 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,7 +7,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.5.0'
+ classpath 'com.android.tools.build:gradle:3.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files