Release version 4.0.1
Update target SDK to 28
Update start service
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index ebd1541..b841d09 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -16,33 +16,33 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dsi.ant.server"
- android:versionName="4.0.0"
- android:versionCode="030200"
+ android:versionName="4.0.1"
+ android:versionCode="040001"
android:sharedUserId="android.uid.system">
<uses-sdk
android:minSdkVersion="7"
- android:targetSdkVersion="10"
+ android:targetSdkVersion="28"
/>
<application android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:process="system"
android:permission="com.dsi.ant.permission.ANTRADIO" >
-
+
<service android:exported="true" android:name=".AntService">
<intent-filter>
<action android:name="com.dsi.ant.server.IAntHal" />
<action android:name="com.dsi.ant.intent.request.SERVICE_INFO" />
</intent-filter>
-
+
<meta-data android:name="ANT_AdapterType"
android:value="built-in"
/>
</service>
-
- <receiver android:name="com.dsi.ant.server.startup.BootCompletedReceiver"
- android:enabled="true"
+
+ <receiver android:name="com.dsi.ant.server.startup.BootCompletedReceiver"
+ android:enabled="true"
android:exported="false"
android:label="BootCompletedReceiver">
<intent-filter>
@@ -62,4 +62,4 @@
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
-</manifest>
+</manifest>
diff --git a/src/com/dsi/ant/server/AntService.java b/src/com/dsi/ant/server/AntService.java
index 4e6f891..e41b2fa 100644
--- a/src/com/dsi/ant/server/AntService.java
+++ b/src/com/dsi/ant/server/AntService.java
@@ -124,11 +124,6 @@
return false; // Set to true if require bluetooth on for ANT functionality
}
- public static boolean startService(Context context)
- {
- return ( null != context.startService(new Intent(IAntHal.class.getName())) );
- }
-
/**
* Calls back the registered callback with the change to the new state
* @param state the {@link AntHalDefine} state
@@ -635,10 +630,6 @@
}
}
- // As someone has started using us, make sure we run "forever" like we
- // are a system service.
- startService(this);
-
return binder;
}
diff --git a/src/com/dsi/ant/server/startup/BootCompletedReceiver.java b/src/com/dsi/ant/server/startup/BootCompletedReceiver.java
index e53ebc4..bd3b9b8 100644
--- a/src/com/dsi/ant/server/startup/BootCompletedReceiver.java
+++ b/src/com/dsi/ant/server/startup/BootCompletedReceiver.java
@@ -31,14 +31,15 @@
{
/** The debug log tag */
public static final String TAG = "BootCompletedReceiver";
-
+ private static final String ACTION_BOOT_COMPLETED = "android.intent.action.BOOT_COMPLETED";
@Override
public void onReceive(final Context context, final Intent intent)
{
- // just make sure we are getting the right intent (better safe than sorry)
- if(Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()))
+ String action = intent.getAction();
+ Intent serviceIntent = new Intent(context,AntService.class);
+ if (null != action && action.equals(ACTION_BOOT_COMPLETED))
{
- AntService.startService(context);
+ context.startService(serviceIntent);
}
else
{