From be235c39b04efd2ab64638bf3b4276a4b3b446b5 Mon Sep 17 00:00:00 2001 From: Ricki Hirner Date: Wed, 11 Mar 2015 14:56:39 +0100 Subject: [PATCH] Bug fixes * show "Settings" in Android Settings/Accounts again --- .../bitfire/davdroid/resource/LocalCalendarTest.java | 10 +++++----- app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/sync_prefs.xml | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/androidTest/java/at/bitfire/davdroid/resource/LocalCalendarTest.java b/app/src/androidTest/java/at/bitfire/davdroid/resource/LocalCalendarTest.java index 28249209..81c56656 100644 --- a/app/src/androidTest/java/at/bitfire/davdroid/resource/LocalCalendarTest.java +++ b/app/src/androidTest/java/at/bitfire/davdroid/resource/LocalCalendarTest.java @@ -33,7 +33,7 @@ import at.bitfire.davdroid.resource.LocalStorageException; public class LocalCalendarTest extends InstrumentationTestCase { private static final String - TAG = "davroid.LocalCalendarTest", + TAG = "davroid.test", calendarName = "DAVdroid_Test"; ContentProviderClient providerClient; @@ -76,13 +76,13 @@ public class LocalCalendarTest extends InstrumentationTestCase { providerClient = resolver.acquireContentProviderClient(CalendarContract.AUTHORITY); long id; - + @Cleanup Cursor cursor = providerClient.query(Calendars.CONTENT_URI, - new String[] { Calendars._ID }, + new String[]{Calendars._ID}, Calendars.ACCOUNT_TYPE + "=? AND " + Calendars.NAME + "=?", - new String[] { CalendarContract.ACCOUNT_TYPE_LOCAL, calendarName }, + new String[]{ CalendarContract.ACCOUNT_TYPE_LOCAL, calendarName }, null); - if (cursor.moveToNext()) { + if (cursor != null && cursor.moveToNext()) { // found local test calendar id = cursor.getLong(0); Log.d(TAG, "Found test calendar with ID " + id); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c2e99059..9ae04405 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -113,6 +113,7 @@ Password: + Settings No DAVdroid accounts found Authentication diff --git a/app/src/main/res/xml/sync_prefs.xml b/app/src/main/res/xml/sync_prefs.xml index 707ec8f0..5c1aa923 100644 --- a/app/src/main/res/xml/sync_prefs.xml +++ b/app/src/main/res/xml/sync_prefs.xml @@ -9,10 +9,10 @@ - +