Showing
5 changed files
with
60 additions
and
149 deletions
| ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
| 2 | 2 | ||
| 3 | ext { | 3 | ext { |
| 4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
| 5 | - PUBLISH_VERSION = '4.5.5.4r32' | 5 | + PUBLISH_VERSION = '4.5.5.4r33' |
| 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
| 7 | } | 7 | } |
| 8 | 8 | ... | ... |
| ... | @@ -14,8 +14,8 @@ | ... | @@ -14,8 +14,8 @@ |
| 14 | tools:node="remove" /> | 14 | tools:node="remove" /> |
| 15 | <uses-permission android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA" /> | 15 | <uses-permission android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA" /> |
| 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.ACTIVITY_RECOGNITION" />--> | 20 | <!-- <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />--> |
| 21 | <!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />--> | 21 | <!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />--> |
| ... | @@ -230,11 +230,11 @@ | ... | @@ -230,11 +230,11 @@ |
| 230 | 230 | ||
| 231 | <!-- android:stopWithTask="false"--> | 231 | <!-- android:stopWithTask="false"--> |
| 232 | <!-- android:process=":warplyHealthService"--> | 232 | <!-- android:process=":warplyHealthService"--> |
| 233 | - <service | 233 | +<!-- <service--> |
| 234 | - android:name=".services.WarplyHealthService" | 234 | +<!-- android:name=".services.WarplyHealthService"--> |
| 235 | - android:exported="false" | 235 | +<!-- android:exported="false"--> |
| 236 | - android:foregroundServiceType="health" | 236 | +<!-- android:foregroundServiceType="health"--> |
| 237 | - android:permission="android.permission.FOREGROUND_SERVICE" /> | 237 | +<!-- android:permission="android.permission.FOREGROUND_SERVICE" />--> |
| 238 | 238 | ||
| 239 | <service | 239 | <service |
| 240 | android:name=".services.WarplyBeaconsRangingService" | 240 | android:name=".services.WarplyBeaconsRangingService" |
| ... | @@ -288,14 +288,14 @@ | ... | @@ -288,14 +288,14 @@ |
| 288 | android:name=".receivers.WarplyInAppNotificationReceiver" | 288 | android:name=".receivers.WarplyInAppNotificationReceiver" |
| 289 | android:exported="false" /> | 289 | android:exported="false" /> |
| 290 | 290 | ||
| 291 | - <receiver | 291 | +<!-- <receiver--> |
| 292 | - android:name=".receivers.RestartHealthServiceReceiver" | 292 | +<!-- android:name=".receivers.RestartHealthServiceReceiver"--> |
| 293 | - android:exported="false"> | 293 | +<!-- android:exported="false">--> |
| 294 | - <intent-filter> | 294 | +<!-- <intent-filter>--> |
| 295 | -<!-- <action android:name="android.intent.action.BOOT_COMPLETED" />--> | 295 | +<!--<!– <action android:name="android.intent.action.BOOT_COMPLETED" />–>--> |
| 296 | - <action android:name="android.intent.action.RESTART" /> | 296 | +<!-- <action android:name="android.intent.action.RESTART" />--> |
| 297 | - </intent-filter> | 297 | +<!-- </intent-filter>--> |
| 298 | - </receiver> | 298 | +<!-- </receiver>--> |
| 299 | 299 | ||
| 300 | <!-- <provider--> | 300 | <!-- <provider--> |
| 301 | <!-- android:name=".utils.WarplyProvider"--> | 301 | <!-- android:name=".utils.WarplyProvider"--> | ... | ... |
| ... | @@ -1478,10 +1478,10 @@ public class WarplyManagerHelper { | ... | @@ -1478,10 +1478,10 @@ public class WarplyManagerHelper { |
| 1478 | } | 1478 | } |
| 1479 | 1479 | ||
| 1480 | public static void logoutUser() { | 1480 | public static void logoutUser() { |
| 1481 | - if (isMyServiceRunning(WarplyHealthService.class)) { | 1481 | +// if (isMyServiceRunning(WarplyHealthService.class)) { |
| 1482 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 1482 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 1483 | - Warply.getWarplyContext().stopService(stepsServiceIntent); | 1483 | +// Warply.getWarplyContext().stopService(stepsServiceIntent); |
| 1484 | - } | 1484 | +// } |
| 1485 | } | 1485 | } |
| 1486 | 1486 | ||
| 1487 | private static boolean isMyServiceRunning(Class<?> serviceClass) { | 1487 | private static boolean isMyServiceRunning(Class<?> serviceClass) { | ... | ... |
| ... | @@ -977,20 +977,20 @@ public class WarplyManager { | ... | @@ -977,20 +977,20 @@ public class WarplyManager { |
| 977 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | 977 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); |
| 978 | } | 978 | } |
| 979 | 979 | ||
| 980 | - if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | 980 | +// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { |
| 981 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | 981 | +// if (!isMyServiceRunning(WarplyHealthService.class)) { |
| 982 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 982 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 983 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 983 | +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| 984 | - Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 984 | +// Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
| 985 | - } else { | 985 | +// } else { |
| 986 | - Warply.getWarplyContext().startService(stepsServiceIntent); | 986 | +// Warply.getWarplyContext().startService(stepsServiceIntent); |
| 987 | - } | 987 | +// } |
| 988 | - | 988 | +// |
| 989 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | 989 | +// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
| 990 | - pacingVisible.setVisible(true); | 990 | +// pacingVisible.setVisible(true); |
| 991 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | 991 | +// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 992 | - } | 992 | +// } |
| 993 | - } | 993 | +// } |
| 994 | } | 994 | } |
| 995 | } | 995 | } |
| 996 | } | 996 | } |
| ... | @@ -1111,20 +1111,20 @@ public class WarplyManager { | ... | @@ -1111,20 +1111,20 @@ public class WarplyManager { |
| 1111 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | 1111 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); |
| 1112 | } | 1112 | } |
| 1113 | 1113 | ||
| 1114 | - if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | 1114 | +// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { |
| 1115 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | 1115 | +// if (!isMyServiceRunning(WarplyHealthService.class)) { |
| 1116 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 1116 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 1117 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 1117 | +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| 1118 | - Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 1118 | +// Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
| 1119 | - } else { | 1119 | +// } else { |
| 1120 | - Warply.getWarplyContext().startService(stepsServiceIntent); | 1120 | +// Warply.getWarplyContext().startService(stepsServiceIntent); |
| 1121 | - } | 1121 | +// } |
| 1122 | - | 1122 | +// |
| 1123 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | 1123 | +// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
| 1124 | - pacingVisible.setVisible(true); | 1124 | +// pacingVisible.setVisible(true); |
| 1125 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | 1125 | +// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 1126 | - } | 1126 | +// } |
| 1127 | - } | 1127 | +// } |
| 1128 | } | 1128 | } |
| 1129 | } | 1129 | } |
| 1130 | } | 1130 | } |
| ... | @@ -4783,95 +4783,6 @@ public class WarplyManager { | ... | @@ -4783,95 +4783,6 @@ public class WarplyManager { |
| 4783 | return future; | 4783 | return future; |
| 4784 | } | 4784 | } |
| 4785 | 4785 | ||
| 4786 | - public static void getCosmoteUser(WarplyCosmoteUserRequest request, final CallbackReceiver<JSONObject> receiver) { | ||
| 4787 | - WarpUtils.log("************* WARPLY Cosmote User Request ********************"); | ||
| 4788 | - WarpUtils.log("[WARP Trace] WARPLY Cosmote User Request is active"); | ||
| 4789 | - WarpUtils.log("**************************************************"); | ||
| 4790 | - | ||
| 4791 | - Warply.postReceiveMicroappData(false, "cosuser", request.toJson(), new CallbackReceiver<JSONObject>() { | ||
| 4792 | - @Override | ||
| 4793 | - public void onSuccess(JSONObject result) { | ||
| 4794 | - int status = result.optInt("status", 2); | ||
| 4795 | - if (status == 1) { | ||
| 4796 | - JSONObject tokens = result.optJSONObject("result"); | ||
| 4797 | - if (tokens != null) { | ||
| 4798 | - WarplyDBHelper.getInstance(Warply.getWarplyContext()).saveClientAccess( | ||
| 4799 | - tokens.optString("client_id", ""), | ||
| 4800 | - tokens.optString("client_secret", "") | ||
| 4801 | - ); | ||
| 4802 | - | ||
| 4803 | - WarplyDBHelper.getInstance(Warply.getWarplyContext()).saveAuthAccess( | ||
| 4804 | - tokens.optString("access_token", ""), | ||
| 4805 | - tokens.optString("refresh_token", "") | ||
| 4806 | - ); | ||
| 4807 | - | ||
| 4808 | - JSONObject newResult = new JSONObject(); | ||
| 4809 | - try { | ||
| 4810 | - newResult.putOpt("status", 1); | ||
| 4811 | - newResult.putOpt("message", "Success"); | ||
| 4812 | - receiver.onSuccess(newResult); | ||
| 4813 | - } catch (JSONException e) { | ||
| 4814 | - e.printStackTrace(); | ||
| 4815 | - receiver.onFailure(2); | ||
| 4816 | - } | ||
| 4817 | - | ||
| 4818 | - getConsumer(new WarplyConsumerRequest(), new CallbackReceiver<Consumer>() { | ||
| 4819 | - @Override | ||
| 4820 | - public void onSuccess(Consumer result) { | ||
| 4821 | - WarplyManagerHelper.setConsumerInternal(result); | ||
| 4822 | - | ||
| 4823 | - if (result != null) { | ||
| 4824 | - JSONObject profMetadata = WarpJSONParser.getJSONFromString(result.getProfileMetadata()); | ||
| 4825 | - if (profMetadata != null && profMetadata.has("nonTelco")) { | ||
| 4826 | - WarpUtils.setUserNonTelco(Warply.getWarplyContext(), profMetadata.optBoolean("nonTelco")); | ||
| 4827 | - } else { | ||
| 4828 | - WarpUtils.setUserNonTelco(Warply.getWarplyContext(), false); | ||
| 4829 | - } | ||
| 4830 | - } | ||
| 4831 | - | ||
| 4832 | - if (result != null) { | ||
| 4833 | - JSONObject profMetadata = WarpJSONParser.getJSONFromString(result.getProfileMetadata()); | ||
| 4834 | - if (profMetadata != null) { | ||
| 4835 | - if (profMetadata.has("badge")) { | ||
| 4836 | - WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | ||
| 4837 | - } | ||
| 4838 | - | ||
| 4839 | - if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | ||
| 4840 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | ||
| 4841 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | ||
| 4842 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
| 4843 | - Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | ||
| 4844 | - } else { | ||
| 4845 | - Warply.getWarplyContext().startService(stepsServiceIntent); | ||
| 4846 | - } | ||
| 4847 | - | ||
| 4848 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | ||
| 4849 | - pacingVisible.setVisible(true); | ||
| 4850 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | ||
| 4851 | - } | ||
| 4852 | - } | ||
| 4853 | - } | ||
| 4854 | - } | ||
| 4855 | - } | ||
| 4856 | - | ||
| 4857 | - @Override | ||
| 4858 | - public void onFailure(int errorCode) { | ||
| 4859 | - | ||
| 4860 | - } | ||
| 4861 | - }); | ||
| 4862 | - } else | ||
| 4863 | - receiver.onFailure(2); | ||
| 4864 | - } else | ||
| 4865 | - receiver.onFailure(status); | ||
| 4866 | - } | ||
| 4867 | - | ||
| 4868 | - @Override | ||
| 4869 | - public void onFailure(int errorCode) { | ||
| 4870 | - receiver.onFailure(errorCode); | ||
| 4871 | - } | ||
| 4872 | - }); | ||
| 4873 | - } | ||
| 4874 | - | ||
| 4875 | public static void submitOrder(CosmoteSubmitOrderRequest request, final CallbackReceiver<JSONObject> receiver) { | 4786 | public static void submitOrder(CosmoteSubmitOrderRequest request, final CallbackReceiver<JSONObject> receiver) { |
| 4876 | WarpUtils.log("************* WARPLY Submit Order Request ********************"); | 4787 | WarpUtils.log("************* WARPLY Submit Order Request ********************"); |
| 4877 | WarpUtils.log("[WARP Trace] WARPLY Submit Order Request is active"); | 4788 | WarpUtils.log("[WARP Trace] WARPLY Submit Order Request is active"); | ... | ... |
| ... | @@ -425,12 +425,12 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { | ... | @@ -425,12 +425,12 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { |
| 425 | if (!EventBus.getDefault().isRegistered(this)) | 425 | if (!EventBus.getDefault().isRegistered(this)) |
| 426 | EventBus.getDefault().register(this); | 426 | EventBus.getDefault().register(this); |
| 427 | 427 | ||
| 428 | - if (mWebviewLoaded) { | 428 | +// if (mWebviewLoaded) { |
| 429 | - String scriptSourceInit = "webviewDidFocus(" + String.valueOf(mWebviewLoaded) + "," + String.valueOf(isMyServiceRunning(WarplyHealthService.class)) + ");"; | 429 | +// String scriptSourceInit = "webviewDidFocus(" + String.valueOf(mWebviewLoaded) + "," + String.valueOf(isMyServiceRunning(WarplyHealthService.class)) + ");"; |
| 430 | - WarpView.this.evaluateJavascript(scriptSourceInit, s -> { | 430 | +// WarpView.this.evaluateJavascript(scriptSourceInit, s -> { |
| 431 | - | 431 | +// |
| 432 | - }); | 432 | +// }); |
| 433 | - } | 433 | +// } |
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | @Override | 436 | @Override |
| ... | @@ -561,9 +561,9 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { | ... | @@ -561,9 +561,9 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { |
| 561 | // EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | 561 | // EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 562 | // } | 562 | // } |
| 563 | 563 | ||
| 564 | - WarplyHealthEventModel healthActive = new WarplyHealthEventModel(); | 564 | +// WarplyHealthEventModel healthActive = new WarplyHealthEventModel(); |
| 565 | - healthActive.setActivated(true); | 565 | +// healthActive.setActivated(true); |
| 566 | - EventBus.getDefault().post(new WarplyEventBusManager(healthActive)); | 566 | +// EventBus.getDefault().post(new WarplyEventBusManager(healthActive)); |
| 567 | } else if (parts[1].equals("steps") && parts[2].equals("shortcutDisabled")) { // This is for the pacing service | 567 | } else if (parts[1].equals("steps") && parts[2].equals("shortcutDisabled")) { // This is for the pacing service |
| 568 | // Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 568 | // Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 569 | // Warply.getWarplyContext().stopService(stepsServiceIntent); | 569 | // Warply.getWarplyContext().stopService(stepsServiceIntent); |
| ... | @@ -572,9 +572,9 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { | ... | @@ -572,9 +572,9 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { |
| 572 | // pacingVisible.setVisible(false); | 572 | // pacingVisible.setVisible(false); |
| 573 | // EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | 573 | // EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 574 | 574 | ||
| 575 | - WarplyHealthEventModel healthActive = new WarplyHealthEventModel(); | 575 | +// WarplyHealthEventModel healthActive = new WarplyHealthEventModel(); |
| 576 | - healthActive.setActivated(false); | 576 | +// healthActive.setActivated(false); |
| 577 | - EventBus.getDefault().post(new WarplyEventBusManager(healthActive)); | 577 | +// EventBus.getDefault().post(new WarplyEventBusManager(healthActive)); |
| 578 | } else if (parts[1].equals("request") || parts[1].equals("response")) { | 578 | } else if (parts[1].equals("request") || parts[1].equals("response")) { |
| 579 | WarpUtils.log("**************** WARPLY Webview Log START *****************"); | 579 | WarpUtils.log("**************** WARPLY Webview Log START *****************"); |
| 580 | WarpUtils.log(message); | 580 | WarpUtils.log(message); | ... | ... |
-
Please register or login to post a comment