From 474ccdc3261934410d9c348c7677644acd5b93ff Mon Sep 17 00:00:00 2001 From: Shankari Date: Wed, 28 Aug 2024 14:35:50 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20the=20`NEW=5FDATA`=20br?= =?UTF-8?q?oadcast=20intent=20when=20we=20pull=20data=20from=20the=20serve?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The intent does not have the package configured like all the other explicit intents - The intent is currently unused since we do not read any data from the local cache - Note that since we don't read any data from the local cache, we can also just stop returning any data from the server, and reduce power and data consumption. That is implemented in the related PR: https://github.com/e-mission/e-mission-server/pull/978 --- plugin.xml | 2 +- src/android/ServerSyncAdapter.java | 7 ------- src/ios/BEMServerSyncCommunicationHelper.m | 13 +------------ 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/plugin.xml b/plugin.xml index a411df7..708d702 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + version="1.3.3"> ServerSync Push and pull local data to the server diff --git a/src/android/ServerSyncAdapter.java b/src/android/ServerSyncAdapter.java index 8412ec8..4987ef8 100644 --- a/src/android/ServerSyncAdapter.java +++ b/src/android/ServerSyncAdapter.java @@ -176,13 +176,6 @@ public void onPerformSync(Account account, Bundle extras, String authority, new StatsEvent(cachedContext, R.string.pull_duration)); } - // We are sending this only locally, so we don't care about the URI and so on. - Intent localIntent = new Intent("edu.berkeley.eecs.emission.sync.NEW_DATA"); - Bundle b = new Bundle(); - b.putString( "userdata", "{}" ); - localIntent.putExtras(b); - Log.i(cachedContext, TAG, "Finished sync, sending local broadcast"); - LocalBroadcastManager.getInstance(cachedContext).sendBroadcastSync(localIntent); biuc.putMessage(R.string.key_usercache_client_time, new StatsEvent(cachedContext, R.string.sync_duration, to.elapsedSecs())); } diff --git a/src/ios/BEMServerSyncCommunicationHelper.m b/src/ios/BEMServerSyncCommunicationHelper.m index e14c8d1..112a18f 100644 --- a/src/ios/BEMServerSyncCommunicationHelper.m +++ b/src/ios/BEMServerSyncCommunicationHelper.m @@ -171,18 +171,7 @@ +(BFTask*) pullIntoUserCache { StatsEvent* se = [[StatsEvent alloc] initForReading:@"sync_pull_list_size" withReading:newSectionCount]; [[BuiltinUserCache database] putMessage:@"key.usercache.client_time" value:se]; - if (newSectionCount > 0) { - // Note that we need to update the UI before calling the completion handler, otherwise - // when the view appears, users won't see the newly fetched data! - [[NSNotificationCenter defaultCenter] postNotificationName:BackgroundRefreshNewData - object:self]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"edu.berkeley.eecs.emission.sync.NEW_DATA" - object:nil - userInfo:nil]; - [task setResult:@(TRUE)]; - } else { - [task setResult:@(TRUE)]; - } + [task setResult:@(TRUE)]; } StatsEvent* se = [[StatsEvent alloc] initForReading:@"pull_duration" withReading:[t elapsed_secs]]; [[BuiltinUserCache database] putMessage:@"key.usercache.client_time" value:se];