Merge upstream.

This commit is contained in:
Jared Casper
2011-02-12 15:49:23 -08:00
13 changed files with 23 additions and 6 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ limitations under the License.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.maps.mytracks" package="com.google.android.maps.mytracks"
android:installLocation="auto" android:installLocation="auto"
android:versionCode="23" android:versionCode="24"
android:versionName="1.1.0"> android:versionName="1.1.1">
<application android:icon="@drawable/arrow_icon" <application android:icon="@drawable/arrow_icon"
android:label="@string/app_name" android:label="@string/app_name"
android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgent"> android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgent">

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 384 B

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

@@ -16,6 +16,7 @@
package com.google.android.apps.mytracks.content; package com.google.android.apps.mytracks.content;
import com.google.android.apps.mytracks.MyTracksConstants; import com.google.android.apps.mytracks.MyTracksConstants;
import com.google.android.apps.mytracks.util.ApiFeatures;
import android.content.ContentProvider; import android.content.ContentProvider;
import android.content.ContentUris; import android.content.ContentUris;
@@ -371,8 +372,11 @@ public class MyTracksProvider extends ContentProvider {
throw new IllegalArgumentException("Unknown URL " + url); throw new IllegalArgumentException("Unknown URL " + url);
} }
Log.i(MyTracksConstants.TAG, if (ApiFeatures.getInstance().canReuseSQLiteQueryBuilder()) {
"Build query: " + qb.buildQuery(projection, selection, selectionArgs, null, null, sortOrder, null)); Log.i(MyTracksConstants.TAG,
"Build query: " + qb.buildQuery(projection, selection, selectionArgs,
null, null, sortOrder, null));
}
Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, Cursor c = qb.query(db, projection, selection, selectionArgs, null, null,
sortOrder); sortOrder);
c.setNotificationUri(getContext().getContentResolver(), url); c.setNotificationUri(getContext().getContentResolver(), url);
@@ -210,9 +210,10 @@ public class GDataWrapper<C> {
errorType = ERROR_AUTH; errorType = ERROR_AUTH;
errorMessage = e.getMessage(); errorMessage = e.getMessage();
} catch (HttpException e) { } catch (HttpException e) {
Log.e(MyTracksConstants.TAG, "HttpException, code " + e.getStatusCode(), e); Log.e(MyTracksConstants.TAG,
"HttpException, code " + e.getStatusCode() + " message " + e.getMessage(), e);
errorMessage = e.getMessage(); errorMessage = e.getMessage();
if (errorMessage != null && errorMessage.contains("401")) { if (e.getStatusCode() == 401) {
errorType = ERROR_AUTH; errorType = ERROR_AUTH;
} else { } else {
errorType = ERROR_CONNECTION; errorType = ERROR_CONNECTION;
@@ -107,6 +107,18 @@ public class ApiFeatures {
return getApiLevel() >= 9; return getApiLevel() >= 9;
} }
/**
* There's a bug (#1587) in Cupcake and Donut which prevents you from
* using a SQLiteQueryBuilder twice. That is, if you call buildQuery
* on a given instance (to log the statement for debugging), and then
* call query on the same instance to make it actually do the query,
* it'll regenerate the query for the second call, and will screw it
* up. Specifically, it'll add extra parens which don't belong.
*/
public boolean canReuseSQLiteQueryBuilder() {
return getApiLevel() > 4;
}
// Visible for testing. // Visible for testing.
protected int getApiLevel() { protected int getApiLevel() {
return ANDROID_API_LEVEL; return ANDROID_API_LEVEL;