+ * Due to changes in API level 16.
+ *
+ * @param appWidgetManager the app widget manager
+ * @param appWidgetId the app widget id
+ */
+ public int getAppWidgetSize(AppWidgetManager appWidgetManager, int appWidgetId);
+
+ /**
+ * Sets the app widget size.
+ *
+ * @param appWidgetManager the app widget manager.
+ * @param appWidgetId the app widgit id
+ * @param size the size
+ */
+ public void setAppWidgetSize(AppWidgetManager appWidgetManager, int appWidgetId, int size);
}
diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/ApiAdapterFactory.java b/MyTracks/src/com/google/android/apps/mytracks/util/ApiAdapterFactory.java
index d1ebdffe8..5b60e1e5a 100644
--- a/MyTracks/src/com/google/android/apps/mytracks/util/ApiAdapterFactory.java
+++ b/MyTracks/src/com/google/android/apps/mytracks/util/ApiAdapterFactory.java
@@ -31,21 +31,18 @@ public class ApiAdapterFactory {
*/
public static ApiAdapter getApiAdapter() {
if (apiAdapter == null) {
- if (Build.VERSION.SDK_INT >= 14) {
+ if (Build.VERSION.SDK_INT >= 16) {
+ apiAdapter = new Api16Adapter();
+ } else if (Build.VERSION.SDK_INT >= 14) {
apiAdapter = new Api14Adapter();
- return apiAdapter;
} else if (Build.VERSION.SDK_INT >= 11) {
apiAdapter = new Api11Adapter();
- return apiAdapter;
} else if (Build.VERSION.SDK_INT >= 10) {
apiAdapter = new Api10Adapter();
- return apiAdapter;
} else if (Build.VERSION.SDK_INT >= 9) {
apiAdapter = new Api9Adapter();
- return apiAdapter;
} else {
apiAdapter = new Api8Adapter();
- return apiAdapter;
}
}
return apiAdapter;
diff --git a/MyTracks/src/com/google/android/apps/mytracks/util/GoogleFeedbackUtils.java b/MyTracks/src/com/google/android/apps/mytracks/util/GoogleFeedbackUtils.java
new file mode 100644
index 000000000..71f2b50b2
--- /dev/null
+++ b/MyTracks/src/com/google/android/apps/mytracks/util/GoogleFeedbackUtils.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.google.android.apps.mytracks.util;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.Parcel;
+import android.os.RemoteException;
+import android.util.Log;
+
+import java.util.List;
+
+/**
+ * Utilities for Google Feedback.
+ *
+ * @author Jimmy Shih
+ */
+public class GoogleFeedbackUtils {
+
+ private static final String GOOGLE_FEEDBACK_PACKAGE_NAME = "com.google.android.feedback";
+ private static final String TAG = GoogleFeedbackUtils.class.getSimpleName();
+
+ private static Boolean available = null;
+
+ /**
+ * Returns true if the Google Feedback is available.
+ *
+ * @param context the context
+ */
+ public static boolean isAvailable(Context context) {
+ if (available == null) {
+ List