Loading services/core/java/com/android/server/content/SyncManager.java +3 −0 Original line number Diff line number Diff line Loading @@ -3978,6 +3978,9 @@ public class SyncManager { * @return true if the provided key is used by the SyncManager in scheduling the sync. */ private static boolean isSyncSetting(String key) { if (key == null) { return false; } if (key.equals(ContentResolver.SYNC_EXTRAS_EXPEDITED)) { return true; } Loading services/tests/servicestests/src/com/android/server/content/SyncManagerTest.java +18 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.content; import android.content.ContentResolver; import android.os.Bundle; import android.test.suitebuilder.annotation.SmallTest; Loading Loading @@ -57,6 +58,23 @@ public class SyncManagerTest extends TestCase { SyncManager.syncExtrasEquals(b1, b2, false /* don't care about system extras */)); } public void testSyncExtrasEqualsFails_WithNull() throws Exception { Bundle b1 = new Bundle(); b1.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); b1.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true); Bundle b2 = new Bundle(); b2.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); b2.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true); b2.putString(null, "Hello NPE!"); b2.putString("a", "b"); b2.putString("c", "d"); b2.putString("e", "f"); assertFalse("Extras not properly compared between bundles.", SyncManager.syncExtrasEquals(b1, b2, false /* don't care about system extras */)); } public void testSyncExtrasEqualsFails_differentValues() throws Exception { Bundle b1 = new Bundle(); Bundle b2 = new Bundle(); Loading Loading
services/core/java/com/android/server/content/SyncManager.java +3 −0 Original line number Diff line number Diff line Loading @@ -3978,6 +3978,9 @@ public class SyncManager { * @return true if the provided key is used by the SyncManager in scheduling the sync. */ private static boolean isSyncSetting(String key) { if (key == null) { return false; } if (key.equals(ContentResolver.SYNC_EXTRAS_EXPEDITED)) { return true; } Loading
services/tests/servicestests/src/com/android/server/content/SyncManagerTest.java +18 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.content; import android.content.ContentResolver; import android.os.Bundle; import android.test.suitebuilder.annotation.SmallTest; Loading Loading @@ -57,6 +58,23 @@ public class SyncManagerTest extends TestCase { SyncManager.syncExtrasEquals(b1, b2, false /* don't care about system extras */)); } public void testSyncExtrasEqualsFails_WithNull() throws Exception { Bundle b1 = new Bundle(); b1.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); b1.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true); Bundle b2 = new Bundle(); b2.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); b2.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true); b2.putString(null, "Hello NPE!"); b2.putString("a", "b"); b2.putString("c", "d"); b2.putString("e", "f"); assertFalse("Extras not properly compared between bundles.", SyncManager.syncExtrasEquals(b1, b2, false /* don't care about system extras */)); } public void testSyncExtrasEqualsFails_differentValues() throws Exception { Bundle b1 = new Bundle(); Bundle b2 = new Bundle(); Loading