diff options
author | Jeremy Friesen <jeremy.friesen@thisisant.com> | 2019-07-25 08:17:38 -0600 |
---|---|---|
committer | Jeremy Friesen <jeremy.friesen@thisisant.com> | 2019-07-25 08:17:38 -0600 |
commit | 674e8d9b3f67f0fc599116fa4e2efcc1c3d10947 (patch) | |
tree | 54d99d6ca9a31d3096d0f44f02c2621b9418672a | |
parent | 5846d51cbe8a7d7278316e99fba68698edefb028 (diff) | |
download | android_external_ant-wireless_ant_service-674e8d9b3f67f0fc599116fa4e2efcc1c3d10947.tar.gz android_external_ant-wireless_ant_service-674e8d9b3f67f0fc599116fa4e2efcc1c3d10947.tar.bz2 android_external_ant-wireless_ant_service-674e8d9b3f67f0fc599116fa4e2efcc1c3d10947.zip |
Release version 4.0.1
Update target SDK to 28
Update start service
-rw-r--r-- | AndroidManifest.xml | 18 | ||||
-rw-r--r-- | src/com/dsi/ant/server/AntService.java | 9 | ||||
-rw-r--r-- | src/com/dsi/ant/server/startup/BootCompletedReceiver.java | 9 |
3 files changed, 14 insertions, 22 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ebd1541..b841d09 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -16,33 +16,33 @@ limitations under the License. --> <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 @@ limitations under the License. <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 @@ public class AntService extends Service 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 @@ public class AntService extends Service } } - // 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 @@ public class BootCompletedReceiver extends BroadcastReceiver { /** 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 { |