diff options
author | Dmitry Donskoy <donskdmitry@mail.ru> | 2018-08-22 18:45:09 +0300 |
---|---|---|
committer | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2018-08-22 19:56:21 +0300 |
commit | 8ba105a2ba41e4aaa35f47a1eb4e4403d96222b6 (patch) | |
tree | 06728b4e68bc705f3755164496deda43530bf463 /android | |
parent | e300e80c54a71b58d12c461bc0d04b191a125c7c (diff) |
[android] Fixed review notes
Diffstat (limited to 'android')
6 files changed, 4 insertions, 36 deletions
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index d37ea1e750..895cec897c 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -440,13 +440,6 @@ android:label="@string/subtittle_opt_out" android:configChanges="keyboardHidden|orientation|screenSize"> </activity> - - <service - android:name="com.mapswithme.util.push.GcmRouterJobIntentService" - android:permission="android.permission.BIND_JOB_SERVICE" - android:exported="false"> - </service> - <receiver android:name="com.mapswithme.maps.background.ConnectivityChangedReceiver" android:enabled="true" diff --git a/android/src/com/mapswithme/maps/MwmApplication.java b/android/src/com/mapswithme/maps/MwmApplication.java index 7aa5b16e32..9302261f9e 100644 --- a/android/src/com/mapswithme/maps/MwmApplication.java +++ b/android/src/com/mapswithme/maps/MwmApplication.java @@ -374,7 +374,6 @@ public class MwmApplication extends Application if (BuildConfig.PW_APPID.equals(PW_EMPTY_APP_ID)) return; - Pushwoosh pushManager = Pushwoosh.getInstance(); pushManager.registerForPushNotifications(); diff --git a/android/src/com/mapswithme/maps/ugc/UGC.java b/android/src/com/mapswithme/maps/ugc/UGC.java index 6ca44019f8..7d9d4a183a 100644 --- a/android/src/com/mapswithme/maps/ugc/UGC.java +++ b/android/src/com/mapswithme/maps/ugc/UGC.java @@ -279,6 +279,7 @@ public class UGC { if (foreground) return; + WorkerService.startActionUploadUGC(mContext); } } diff --git a/android/src/com/mapswithme/util/push/GCMListenerRouterService.java b/android/src/com/mapswithme/util/push/GCMListenerRouterService.java index 7779ca7da7..4ee0d84bde 100644 --- a/android/src/com/mapswithme/util/push/GCMListenerRouterService.java +++ b/android/src/com/mapswithme/util/push/GCMListenerRouterService.java @@ -1,19 +1,18 @@ package com.mapswithme.util.push; import android.content.Context; -import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; -import android.support.v4.app.JobIntentService; import android.text.TextUtils; import com.google.android.gms.gcm.GcmListenerService; import com.mapswithme.maps.BuildConfig; import com.mapswithme.util.log.Logger; import com.mapswithme.util.log.LoggerFactory; +import com.pushwoosh.internal.utils.NotificationRegistrarHelper; import ru.mail.libnotify.api.NotificationFactory; // It's temporary class, it may be deleted along with Pushwoosh sdk. @@ -37,7 +36,7 @@ public class GCMListenerRouterService extends GcmListenerService String pwProjectId = getPWProjectId(getApplicationContext()); if (!TextUtils.isEmpty(pwProjectId) && pwProjectId.contains(from)) { - dispatchMessage(data); + NotificationRegistrarHelper.handleMessage(data); return; } @@ -63,12 +62,4 @@ public class GCMListenerRouterService extends GcmListenerService } return null; } - - private void dispatchMessage(@NonNull Bundle data) { - Intent intent = new Intent(); - intent.putExtras(data); - intent.setAction("com.google.android.c2dm.intent.RECEIVE"); - int jobId = GcmRouterJobIntentService.class.hashCode(); - JobIntentService.enqueueWork(this, GcmRouterJobIntentService.class, jobId, intent); - } } diff --git a/android/src/com/mapswithme/util/push/GcmInstanceIDRouterListenerService.java b/android/src/com/mapswithme/util/push/GcmInstanceIDRouterListenerService.java index 53b6a10b5b..c2e75fb3c1 100644 --- a/android/src/com/mapswithme/util/push/GcmInstanceIDRouterListenerService.java +++ b/android/src/com/mapswithme/util/push/GcmInstanceIDRouterListenerService.java @@ -29,7 +29,7 @@ public class GcmInstanceIDRouterListenerService extends InstanceIDListenerServic } catch (IOException e) { - LOGGER.d(TAG, String.valueOf(e)); + LOGGER.e(TAG, "Failed to obtained refreshed token: ", e); } } diff --git a/android/src/com/mapswithme/util/push/GcmRouterJobIntentService.java b/android/src/com/mapswithme/util/push/GcmRouterJobIntentService.java deleted file mode 100644 index 07c18383eb..0000000000 --- a/android/src/com/mapswithme/util/push/GcmRouterJobIntentService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.mapswithme.util.push; - -import android.content.Intent; -import android.support.annotation.NonNull; -import android.support.v4.app.JobIntentService; - -import com.pushwoosh.internal.utils.NotificationRegistrarHelper; - -public class GcmRouterJobIntentService extends JobIntentService -{ - @Override - protected void onHandleWork(@NonNull Intent intent) - { - NotificationRegistrarHelper.handleMessage(intent.getExtras()); - } -} |