summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <mchan@android.com>2011-04-21 15:59:29 -0700
committerMichael Chan <mchan@android.com>2011-04-21 16:02:39 -0700
commitc03aab49fe4169036e5b5d089bded31611b2b6dd (patch)
treed573e3f51b533409e28eb20f8ca1038a7d49e90e
parentfcba1f187b1ee435e67774c792f7ccf8a3b5c357 (diff)
downloadandroid_packages_apps_Calendar-c03aab49fe4169036e5b5d089bded31611b2b6dd.tar.gz
android_packages_apps_Calendar-c03aab49fe4169036e5b5d089bded31611b2b6dd.tar.bz2
android_packages_apps_Calendar-c03aab49fe4169036e5b5d089bded31611b2b6dd.zip
Added code to trigger debug utility in provider to copy calendar db to sd card.
Change-Id: I5bedf5c50df4ad52b79408d623e9fda9eaf2bb89
-rw-r--r--res/values/strings.xml3
-rw-r--r--res/xml/other_preferences.xml8
-rw-r--r--src/com/android/calendar/AllInOneActivity.java2
-rw-r--r--src/com/android/calendar/OtherPreferences.java20
4 files changed, 29 insertions, 4 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cd67b7e7..e2827559 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -499,6 +499,9 @@
<!-- DO NOT TRANSLATE -->
<string name="tardis">TARDIS</string>
+ <!-- Send a copy of the database to developers for debugging [CHAR LIMIT="NONE"] -->
+ <string name="copy_db">Send database</string>
+
<!-- Displayed in email address autocomplete list when searching for contacts
in corporate directories. Example: "Searching bigcompany.com..." [CHAR LIMIT=64] -->
<string name="directory_searching_fmt">Searching <xliff:g id="domain">%s</xliff:g>\u2026</string>
diff --git a/res/xml/other_preferences.xml b/res/xml/other_preferences.xml
index 420c0b77..4e7bddf7 100644
--- a/res/xml/other_preferences.xml
+++ b/res/xml/other_preferences.xml
@@ -18,9 +18,11 @@
<PreferenceCategory
android:key="preferences_tardis_category"
android:title="@string/tardis">
+ <Preference
+ android:key="preferences_copy_db"
+ android:title="@string/copy_db" />
<CheckBoxPreference
android:key="preferences_tardis_1"
- android:defaultValue="false"/>
+ android:defaultValue="false" />
</PreferenceCategory>
-
-</PreferenceScreen>
+</PreferenceScreen> \ No newline at end of file
diff --git a/src/com/android/calendar/AllInOneActivity.java b/src/com/android/calendar/AllInOneActivity.java
index 0b241b2c..25ed3cc2 100644
--- a/src/com/android/calendar/AllInOneActivity.java
+++ b/src/com/android/calendar/AllInOneActivity.java
@@ -758,7 +758,7 @@ public class AllInOneActivity extends Activity implements EventHandler,
@Override
public boolean onQueryTextSubmit(String query) {
- if (TextUtils.equals(query, "TARDIS")) {
+ if ("TARDIS".equalsIgnoreCase(query)) {
Utils.tardis();
}
mSearchView.clearFocus();
diff --git a/src/com/android/calendar/OtherPreferences.java b/src/com/android/calendar/OtherPreferences.java
index 6f9ed2f1..45aebd7a 100644
--- a/src/com/android/calendar/OtherPreferences.java
+++ b/src/com/android/calendar/OtherPreferences.java
@@ -16,8 +16,12 @@
package com.android.calendar;
+import android.content.ComponentName;
+import android.content.Intent;
import android.os.Bundle;
+import android.preference.Preference;
import android.preference.PreferenceFragment;
+import android.preference.PreferenceScreen;
public class OtherPreferences extends PreferenceFragment {
// The name of the shared preferences file. This name must be maintained for
@@ -27,6 +31,8 @@ public class OtherPreferences extends PreferenceFragment {
public static final String KEY_OTHER_1 = "preferences_tardis_1";
+ private Preference mCopyDb;
+
public OtherPreferences() {
}
@@ -35,5 +41,19 @@ public class OtherPreferences extends PreferenceFragment {
super.onCreate(icicle);
getPreferenceManager().setSharedPreferencesName(SHARED_PREFS_NAME);
addPreferencesFromResource(R.xml.other_preferences);
+ mCopyDb = findPreference("preferences_copy_db");
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) {
+ if (preference == mCopyDb) {
+ Intent intent = new Intent(Intent.ACTION_MAIN);
+ intent.setComponent(new ComponentName("com.android.providers.calendar",
+ "com.android.providers.calendar.CalendarDebugActivity"));
+ startActivity(intent);
+ } else {
+ return super.onPreferenceTreeClick(screen, preference);
+ }
+ return true;
}
} \ No newline at end of file