Panagiotis Triantafyllou

fixes in health service

...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
16 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> 16 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
17 <uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" /> 17 <uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" />
18 <uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" /> 18 <uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
19 - <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> 19 + <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
20 + <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
20 21
21 <application android:largeHeap="true"> 22 <application android:largeHeap="true">
22 <!-- <meta-data--> 23 <!-- <meta-data-->
...@@ -33,49 +34,49 @@ ...@@ -33,49 +34,49 @@
33 android:value="false" /> 34 android:value="false" />
34 35
35 <activity 36 <activity
36 - android:name="ly.warp.sdk.activities.WarpViewActivity" 37 + android:name=".activities.WarpViewActivity"
37 android:exported="false" 38 android:exported="false"
38 android:screenOrientation="portrait" 39 android:screenOrientation="portrait"
39 android:theme="@style/SDKAppTheme" /> 40 android:theme="@style/SDKAppTheme" />
40 41
41 <activity 42 <activity
42 - android:name="ly.warp.sdk.activities.LoyaltyAnalysisActivity" 43 + android:name=".activities.LoyaltyAnalysisActivity"
43 android:exported="false" 44 android:exported="false"
44 android:screenOrientation="portrait" 45 android:screenOrientation="portrait"
45 android:theme="@style/SDKAppTheme" /> 46 android:theme="@style/SDKAppTheme" />
46 47
47 <activity 48 <activity
48 - android:name="ly.warp.sdk.activities.LoyaltyHistoryActivity" 49 + android:name=".activities.LoyaltyHistoryActivity"
49 android:exported="false" 50 android:exported="false"
50 android:screenOrientation="portrait" 51 android:screenOrientation="portrait"
51 android:theme="@style/SDKAppTheme" /> 52 android:theme="@style/SDKAppTheme" />
52 53
53 <activity 54 <activity
54 - android:name="ly.warp.sdk.activities.CouponInfoActivity" 55 + android:name=".activities.CouponInfoActivity"
55 android:exported="false" 56 android:exported="false"
56 android:screenOrientation="portrait" 57 android:screenOrientation="portrait"
57 android:theme="@style/SDKAppTheme" /> 58 android:theme="@style/SDKAppTheme" />
58 59
59 <activity 60 <activity
60 - android:name="ly.warp.sdk.activities.LoyaltyMarketAnalysisActivity" 61 + android:name=".activities.LoyaltyMarketAnalysisActivity"
61 android:exported="false" 62 android:exported="false"
62 android:screenOrientation="portrait" 63 android:screenOrientation="portrait"
63 android:theme="@style/SDKAppTheme" /> 64 android:theme="@style/SDKAppTheme" />
64 65
65 <activity 66 <activity
66 - android:name="ly.warp.sdk.activities.UnifiedCouponInfoActivity" 67 + android:name=".activities.UnifiedCouponInfoActivity"
67 android:exported="false" 68 android:exported="false"
68 android:screenOrientation="portrait" 69 android:screenOrientation="portrait"
69 android:theme="@style/SDKAppTheme" /> 70 android:theme="@style/SDKAppTheme" />
70 71
71 <activity 72 <activity
72 - android:name="ly.warp.sdk.activities.ActiveCouponsActivity" 73 + android:name=".activities.ActiveCouponsActivity"
73 android:exported="false" 74 android:exported="false"
74 android:screenOrientation="portrait" 75 android:screenOrientation="portrait"
75 android:theme="@style/SDKAppTheme" /> 76 android:theme="@style/SDKAppTheme" />
76 77
77 <activity 78 <activity
78 - android:name="ly.warp.sdk.activities.ActiveUnifiedCouponsActivity" 79 + android:name=".activities.ActiveUnifiedCouponsActivity"
79 android:exported="false" 80 android:exported="false"
80 android:screenOrientation="portrait" 81 android:screenOrientation="portrait"
81 android:theme="@style/SDKAppTheme" /> 82 android:theme="@style/SDKAppTheme" />
...@@ -100,62 +101,62 @@ ...@@ -100,62 +101,62 @@
100 <!-- android:theme="@style/SDKAppTheme" />--> 101 <!-- android:theme="@style/SDKAppTheme" />-->
101 102
102 <activity 103 <activity
103 - android:name="ly.warp.sdk.activities.GiftsForYouActivity" 104 + android:name=".activities.GiftsForYouActivity"
104 android:exported="false" 105 android:exported="false"
105 android:screenOrientation="portrait" 106 android:screenOrientation="portrait"
106 android:theme="@style/GFYAppTheme" /> 107 android:theme="@style/GFYAppTheme" />
107 108
108 <activity 109 <activity
109 - android:name="ly.warp.sdk.activities.MoreForYouActivity" 110 + android:name=".activities.MoreForYouActivity"
110 android:exported="false" 111 android:exported="false"
111 android:screenOrientation="portrait" 112 android:screenOrientation="portrait"
112 android:theme="@style/SDKAppTheme" /> 113 android:theme="@style/SDKAppTheme" />
113 114
114 <activity 115 <activity
115 - android:name="ly.warp.sdk.activities.CouponsetInfoActivity" 116 + android:name=".activities.CouponsetInfoActivity"
116 android:exported="false" 117 android:exported="false"
117 android:screenOrientation="portrait" 118 android:screenOrientation="portrait"
118 android:theme="@style/SDKAppTheme" /> 119 android:theme="@style/SDKAppTheme" />
119 120
120 <activity 121 <activity
121 - android:name="ly.warp.sdk.activities.ShopsActivity" 122 + android:name=".activities.ShopsActivity"
122 android:exported="false" 123 android:exported="false"
123 android:screenOrientation="portrait" 124 android:screenOrientation="portrait"
124 android:theme="@style/SDKAppTheme" /> 125 android:theme="@style/SDKAppTheme" />
125 126
126 <activity 127 <activity
127 - android:name="ly.warp.sdk.activities.ShopsHuaweiActivity" 128 + android:name=".activities.ShopsHuaweiActivity"
128 android:exported="false" 129 android:exported="false"
129 android:screenOrientation="portrait" 130 android:screenOrientation="portrait"
130 android:theme="@style/SDKAppTheme" /> 131 android:theme="@style/SDKAppTheme" />
131 132
132 <activity 133 <activity
133 - android:name="ly.warp.sdk.activities.CouponShareActivity" 134 + android:name=".activities.CouponShareActivity"
134 android:exported="false" 135 android:exported="false"
135 android:screenOrientation="portrait" 136 android:screenOrientation="portrait"
136 android:theme="@style/SDKAppTheme" /> 137 android:theme="@style/SDKAppTheme" />
137 138
138 <activity 139 <activity
139 - android:name="ly.warp.sdk.activities.TelcoActivity" 140 + android:name=".activities.TelcoActivity"
140 android:exported="false" 141 android:exported="false"
141 android:screenOrientation="portrait" 142 android:screenOrientation="portrait"
142 android:theme="@style/SDKAppTheme" /> 143 android:theme="@style/SDKAppTheme" />
143 144
144 <activity 145 <activity
145 - android:name="ly.warp.sdk.activities.ContextualActivity" 146 + android:name=".activities.ContextualActivity"
146 android:exported="false" 147 android:exported="false"
147 android:screenOrientation="portrait" 148 android:screenOrientation="portrait"
148 android:theme="@style/SDKAppTheme" /> 149 android:theme="@style/SDKAppTheme" />
149 150
150 <activity 151 <activity
151 - android:name="ly.warp.sdk.dexter.PermissionsActivity" 152 + android:name=".dexter.PermissionsActivity"
152 android:exported="false" 153 android:exported="false"
153 android:launchMode="singleInstance" 154 android:launchMode="singleInstance"
154 android:screenOrientation="portrait" 155 android:screenOrientation="portrait"
155 android:theme="@android:style/Theme.Light.NoTitleBar" /> 156 android:theme="@android:style/Theme.Light.NoTitleBar" />
156 157
157 <activity 158 <activity
158 - android:name="ly.warp.sdk.activities.BaseFragmentActivity" 159 + android:name=".activities.BaseFragmentActivity"
159 android:exported="true" 160 android:exported="true"
160 android:screenOrientation="portrait"> 161 android:screenOrientation="portrait">
161 <intent-filter android:autoVerify="true"> 162 <intent-filter android:autoVerify="true">
...@@ -177,70 +178,70 @@ ...@@ -177,70 +178,70 @@
177 178
178 <!-- Service used for updating user's location. --> 179 <!-- Service used for updating user's location. -->
179 <service 180 <service
180 - android:name="ly.warp.sdk.services.UpdateUserLocationService" 181 + android:name=".services.UpdateUserLocationService"
181 android:exported="false" 182 android:exported="false"
182 android:permission="android.permission.BIND_JOB_SERVICE" /> 183 android:permission="android.permission.BIND_JOB_SERVICE" />
183 184
184 <service 185 <service
185 - android:name="ly.warp.sdk.services.EventService" 186 + android:name=".services.EventService"
186 android:exported="false" 187 android:exported="false"
187 android:permission="android.permission.BIND_JOB_SERVICE" /> 188 android:permission="android.permission.BIND_JOB_SERVICE" />
188 189
189 <service 190 <service
190 - android:name="ly.warp.sdk.services.VouchersFetchedService" 191 + android:name=".services.VouchersFetchedService"
191 android:exported="false" 192 android:exported="false"
192 android:permission="android.permission.BIND_JOB_SERVICE" /> 193 android:permission="android.permission.BIND_JOB_SERVICE" />
193 194
194 <service 195 <service
195 - android:name="ly.warp.sdk.services.EventCouponsService" 196 + android:name=".services.EventCouponsService"
196 android:exported="false" 197 android:exported="false"
197 android:permission="android.permission.BIND_JOB_SERVICE" /> 198 android:permission="android.permission.BIND_JOB_SERVICE" />
198 199
199 <service 200 <service
200 - android:name="ly.warp.sdk.services.EventRewardsCouponsService" 201 + android:name=".services.EventRewardsCouponsService"
201 android:exported="false" 202 android:exported="false"
202 android:permission="android.permission.BIND_JOB_SERVICE" /> 203 android:permission="android.permission.BIND_JOB_SERVICE" />
203 204
204 <service 205 <service
205 - android:name="ly.warp.sdk.services.EventUnifiedCouponsService" 206 + android:name=".services.EventUnifiedCouponsService"
206 android:exported="false" 207 android:exported="false"
207 android:permission="android.permission.BIND_JOB_SERVICE" /> 208 android:permission="android.permission.BIND_JOB_SERVICE" />
208 209
209 <service 210 <service
210 - android:name="ly.warp.sdk.services.EventCampaignCouponService" 211 + android:name=".services.EventCampaignCouponService"
211 android:exported="false" 212 android:exported="false"
212 android:permission="android.permission.BIND_JOB_SERVICE" /> 213 android:permission="android.permission.BIND_JOB_SERVICE" />
213 214
214 <service 215 <service
215 - android:name="ly.warp.sdk.services.EventCampaignService" 216 + android:name=".services.EventCampaignService"
216 android:exported="false" 217 android:exported="false"
217 android:permission="android.permission.BIND_JOB_SERVICE" /> 218 android:permission="android.permission.BIND_JOB_SERVICE" />
218 219
219 <service 220 <service
220 - android:name="ly.warp.sdk.services.EventRefreshDeviceTokenService" 221 + android:name=".services.EventRefreshDeviceTokenService"
221 android:exported="false" 222 android:exported="false"
222 android:permission="android.permission.BIND_JOB_SERVICE" /> 223 android:permission="android.permission.BIND_JOB_SERVICE" />
223 224
224 <service 225 <service
225 - android:name="ly.warp.sdk.services.EventQuestionnaireService" 226 + android:name=".services.EventQuestionnaireService"
226 android:exported="false" 227 android:exported="false"
227 android:permission="android.permission.BIND_JOB_SERVICE" /> 228 android:permission="android.permission.BIND_JOB_SERVICE" />
228 229
229 <!-- android:stopWithTask="false"--> 230 <!-- android:stopWithTask="false"-->
230 <!-- android:process=":warplyHealthService"--> 231 <!-- android:process=":warplyHealthService"-->
231 <service 232 <service
232 - android:name="ly.warp.sdk.services.WarplyHealthService" 233 + android:name=".services.WarplyHealthService"
233 android:exported="false" 234 android:exported="false"
234 android:foregroundServiceType="health" 235 android:foregroundServiceType="health"
235 - android:permission="android.permission.BIND_JOB_SERVICE" /> 236 + android:permission="android.permission.FOREGROUND_SERVICE" />
236 237
237 <service 238 <service
238 - android:name="ly.warp.sdk.services.WarplyBeaconsRangingService" 239 + android:name=".services.WarplyBeaconsRangingService"
239 android:exported="false" /> 240 android:exported="false" />
240 241
241 <!-- Service used for in app notification. --> 242 <!-- Service used for in app notification. -->
242 <service 243 <service
243 - android:name="ly.warp.sdk.services.WarpInAppNotificationService" 244 + android:name=".services.WarpInAppNotificationService"
244 android:exported="false" /> 245 android:exported="false" />
245 246
246 <!-- FCM Service for push notifications --> 247 <!-- FCM Service for push notifications -->
...@@ -262,7 +263,7 @@ ...@@ -262,7 +263,7 @@
262 <!-- </service>--> 263 <!-- </service>-->
263 264
264 <receiver 265 <receiver
265 - android:name="ly.warp.sdk.receivers.LocationChangedReceiver" 266 + android:name=".receivers.LocationChangedReceiver"
266 android:exported="false" /> 267 android:exported="false" />
267 268
268 <!-- <receiver--> 269 <!-- <receiver-->
...@@ -275,7 +276,7 @@ ...@@ -275,7 +276,7 @@
275 <!-- </receiver>--> 276 <!-- </receiver>-->
276 277
277 <receiver 278 <receiver
278 - android:name="ly.warp.sdk.receivers.BluetoothStateChangeReceiver" 279 + android:name=".receivers.BluetoothStateChangeReceiver"
279 android:exported="false"> 280 android:exported="false">
280 <intent-filter> 281 <intent-filter>
281 <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" /> 282 <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
...@@ -283,11 +284,20 @@ ...@@ -283,11 +284,20 @@
283 </receiver> 284 </receiver>
284 285
285 <receiver 286 <receiver
286 - android:name="ly.warp.sdk.receivers.WarplyInAppNotificationReceiver" 287 + android:name=".receivers.WarplyInAppNotificationReceiver"
287 android:exported="false" /> 288 android:exported="false" />
288 289
289 -<!-- <provider--> 290 + <receiver
290 -<!-- android:name=".utils.WarplyProvider"--> 291 + android:name=".receivers.RestartHealthServiceReceiver"
291 -<!-- android:authorities="ly.warp.sdk.utils.WarplyProvider" />--> 292 + android:exported="false">
293 + <intent-filter>
294 + <action android:name="android.intent.action.BOOT_COMPLETED" />
295 + <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
296 + </intent-filter>
297 + </receiver>
298 +
299 + <!-- <provider-->
300 + <!-- android:name=".utils.WarplyProvider"-->
301 + <!-- android:authorities="ly.warp.sdk.utils.WarplyProvider" />-->
292 </application> 302 </application>
293 </manifest> 303 </manifest>
...\ No newline at end of file ...\ No newline at end of file
......
1 +package ly.warp.sdk.receivers;
2 +
3 +import android.content.BroadcastReceiver;
4 +import android.content.Context;
5 +import android.content.Intent;
6 +import android.os.Build;
7 +
8 +import ly.warp.sdk.services.WarplyHealthService;
9 +
10 +public class RestartHealthServiceReceiver extends BroadcastReceiver {
11 + @Override
12 + public void onReceive(Context context, Intent intent) {
13 + if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) ||
14 + Intent.ACTION_MY_PACKAGE_REPLACED.equals(intent.getAction())) {
15 + Intent stepsRestartServiceIntent = new Intent(context, WarplyHealthService.class);
16 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
17 + context.startForegroundService(stepsRestartServiceIntent);
18 + } else {
19 + context.startService(stepsRestartServiceIntent);
20 + }
21 + }
22 + }
23 +}
...\ No newline at end of file ...\ No newline at end of file