aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahesh Sharma <smahesh@codeaurora.org>2019-07-31 15:22:39 -0700
committerMahesh Kumar Sharma <smahesh@codeaurora.org>2019-07-31 15:25:16 -0700
commit200fcc9565814288bd2cfe7c81620b6dea3a75d7 (patch)
tree5e659a64b5a8547728092854e2d87fdfada68d87
parente23ee25163bf7b3f7f2ecab3a89f5a48ff87e171 (diff)
parent674e8d9b3f67f0fc599116fa4e2efcc1c3d10947 (diff)
downloadandroid_external_ant-wireless_ant_service-200fcc9565814288bd2cfe7c81620b6dea3a75d7.tar.gz
android_external_ant-wireless_ant_service-200fcc9565814288bd2cfe7c81620b6dea3a75d7.tar.bz2
android_external_ant-wireless_ant_service-200fcc9565814288bd2cfe7c81620b6dea3a75d7.zip
Merge remote-tracking branch 'remotes/origin/caf/github/production/4.0.x' into ant.lnx.2.9.1
Change-Id: I6c6b3d4a56e7fb1b347de7def9818d37fb20ee80
-rw-r--r--AndroidManifest.xml18
-rw-r--r--src/com/dsi/ant/server/AntService.java9
-rw-r--r--src/com/dsi/ant/server/startup/BootCompletedReceiver.java9
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
{