From ebef65696a900aba35c340d355f843d94c50b717 Mon Sep 17 00:00:00 2001 From: wangmengyan95 Date: Fri, 23 Oct 2015 14:57:25 -0700 Subject: [PATCH] Do not save installation when we only set pushType --- Parse/src/main/java/com/parse/GcmRegistrar.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Parse/src/main/java/com/parse/GcmRegistrar.java b/Parse/src/main/java/com/parse/GcmRegistrar.java index 11dd62b9d..8b2f04f88 100644 --- a/Parse/src/main/java/com/parse/GcmRegistrar.java +++ b/Parse/src/main/java/com/parse/GcmRegistrar.java @@ -105,17 +105,13 @@ public Task then(Task task) throws Exception { if (!task.getResult()) { return Task.forResult(null); } - Task saveTask; if (installation.getPushType() != PushType.GCM) { installation.setPushType(PushType.GCM); - saveTask = installation.saveInBackground(); - } else { - saveTask = Task.forResult(null); } // We do not need to wait sendRegistrationRequestAsync, since this task will finish // after we get the response from GCM, if we wait for this task, it will block our test. sendRegistrationRequestAsync(); - return saveTask; + return Task.forResult(null); } }); }