From a823f1ac514c4aff2044effe67d4c1a4065a74f6 Mon Sep 17 00:00:00 2001 From: bezloginu Date: Mon, 19 Jun 2017 23:56:54 +0200 Subject: [PATCH] Add support of PX5 platform --- app/build.gradle | 2 +- .../java/com/f1x/mtcdialer/BluetoothServiceActivity.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 874f9f6..7325e5c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,7 +8,7 @@ android { minSdkVersion 19 targetSdkVersion 25 versionCode 1 - versionName "1.0" + versionName "1.1" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/f1x/mtcdialer/BluetoothServiceActivity.java b/app/src/main/java/com/f1x/mtcdialer/BluetoothServiceActivity.java index 5254fad..c00a235 100644 --- a/app/src/main/java/com/f1x/mtcdialer/BluetoothServiceActivity.java +++ b/app/src/main/java/com/f1x/mtcdialer/BluetoothServiceActivity.java @@ -19,12 +19,17 @@ public abstract class BluetoothServiceActivity extends Activity { protected void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); + // PX3 Intent startBluetoothServiceIntent = new Intent(); startBluetoothServiceIntent.setComponent(new ComponentName("android.microntek.mtcser", "android.microntek.mtcser.BTSerialService")); if(!bindService(startBluetoothServiceIntent, mServiceConnection, BIND_AUTO_CREATE)) { - Toast.makeText(this, this.getText(R.string.BluetoothNotAvailable), Toast.LENGTH_LONG).show(); - finish(); + // PX5 + startBluetoothServiceIntent.setComponent(new ComponentName("android.microntek.mtcser", "android.microntek.mtcser.BlueToothService")); + if(!bindService(startBluetoothServiceIntent, mServiceConnection, BIND_AUTO_CREATE)) { + Toast.makeText(this, this.getText(R.string.BluetoothNotAvailable), Toast.LENGTH_LONG).show(); + finish(); + } } }