1
0
mirror of https://github.com/etesync/android synced 2024-11-22 07:58:09 +00:00

Version bump to 0.9.1.2

* debug info: send report inline up to 8000 characters, as attachment otherwise
* ical4android: fix bug which locally deleted tasks by mistake
This commit is contained in:
Ricki Hirner 2015-11-24 17:59:47 +01:00
parent 4adf3001ac
commit aaa7d71ae3
No known key found for this signature in database
GPG Key ID: C4A212CF0B2B4566
5 changed files with 38 additions and 47 deletions

View File

@ -17,8 +17,8 @@ android {
minSdkVersion 14
targetSdkVersion 22
versionCode 85
versionName "0.9.1.1"
versionCode 86
versionName "0.9.1.2"
buildConfigField "java.util.Date", "buildTime", "new java.util.Date()"
}

View File

@ -34,6 +34,7 @@ public class DavResourceFinderTest extends InstrumentationTestCase {
ServerInfo serverInfo = new ServerInfo(url.uri(), "admin", "12345", true);
DavResourceFinder finder = new DavResourceFinder(Constants.log, getInstrumentation().getTargetContext().getApplicationContext(), serverInfo);
// positive test case
server.enqueue(new MockResponse()
.setResponseCode(207)
.setHeader("Content-Type", "application/xml;charset=utf-8")
@ -50,6 +51,18 @@ public class DavResourceFinderTest extends InstrumentationTestCase {
"</multistatus>"));
HttpUrl principal = finder.getCurrentUserPrincipal(url);
assertEquals(url.resolve("/principals/myself"), principal);
// negative test case
server.enqueue(new MockResponse()
.setResponseCode(207)
.setHeader("Content-Type", "application/xml;charset=utf-8")
.setBody("<multistatus xmlns='DAV:'>" +
" <response>" +
" <href>/dav</href>" +
" <status>HTTP/1.0 200 OK</status>" +
" </response>" +
"</multistatus>"));
assertNull(finder.getCurrentUserPrincipal(url));
}
}

View File

@ -1,33 +0,0 @@
/*
* Copyright © 2013 2015 Ricki Hirner (bitfire web engineering).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*/
package at.bitfire.davdroid.syncadapter;
import junit.framework.TestCase;
import java.io.IOException;
import at.bitfire.davdroid.resource.DavResourceFinder;
public class DavResourceFinderTest extends TestCase {
DavResourceFinder finder;
@Override
protected void setUp() {
}
@Override
protected void tearDown() throws IOException {
}
public void testFindResources() {
// TODO
}
}

View File

@ -49,6 +49,8 @@ public class DebugInfoActivity extends Activity implements LoaderManager.LoaderC
KEY_AUTHORITY = "authority",
KEY_PHASE = "phase";
private static final int MAX_INLINE_REPORT_LENGTH = 8000;
TextView tvReport;
String report;
@ -74,20 +76,29 @@ public class DebugInfoActivity extends Activity implements LoaderManager.LoaderC
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.setType("text/plain");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "DAVdroid Exception Details");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "DAVdroid debug info");
try {
File reportFile = File.createTempFile("davdroid-debug", ".txt", getExternalCacheDir());
Constants.log.debug("Writing debug info to " + reportFile.getAbsolutePath());
FileWriter writer = new FileWriter(reportFile);
writer.write(report);
writer.close();
boolean inline = false;
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(reportFile));
} catch (IOException e) {
// let's hope the report is < 1 MB
if (report.length() > MAX_INLINE_REPORT_LENGTH)
// report is too long for inline text, send it as an attachment
try {
File reportFile = File.createTempFile("davdroid-debug", ".txt", getExternalCacheDir());
Constants.log.debug("Writing debug info to " + reportFile.getAbsolutePath());
FileWriter writer = new FileWriter(reportFile);
writer.write(report);
writer.close();
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(reportFile));
} catch (IOException e) {
// let's hope the report is < 1 MB (Android IPC limit)
inline = true;
}
else
inline = true;
if (inline)
sendIntent.putExtra(Intent.EXTRA_TEXT, report);
}
startActivity(sendIntent);
}

@ -1 +1 @@
Subproject commit c59c7b4e65e431d7c3ca554cdab9b7ff065e914c
Subproject commit 6e9ab8680d27a9be7fb677c3b755c4550bc3e80a