am ef0dc0ac: am 809313bd: Merge "Add ability to clear migration state to debug screen" into ub-gmail-ur14-dev

* commit 'ef0dc0ac016776c704ccd5ea9805b610664bc46f':
  Add ability to clear migration state to debug screen
This commit is contained in:
Martin Hibdon 2014-11-02 17:29:55 +00:00 committed by Android Git Automerger
commit 3c38f6ac95
3 changed files with 19 additions and 1 deletions

View File

@ -42,7 +42,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/debug_clear_webview_cache"
/>
/>
<Button
android:id="@+id/clear_migration_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/debug_clear_migration_state"
/>
<CheckBox
android:id="@+id/debug_force_one_minute_refresh"
android:layout_width="wrap_content"

View File

@ -75,6 +75,8 @@
<!-- Do Not Translate. Button label, shown only on debug screen -->
<string name="debug_clear_webview_cache" translatable="false">
Clear WebView cache</string>
<!-- Do Not Translate. Button label. Shown only on debug screen -->
<string name="debug_clear_migration_state" translatable="false">Clear migration state</string>
<!-- Do Not Translate. Checkbox label, shown on debug screen. -->
<string name="debug_force_one_minute_refresh_label" translatable="false">
Force 1-minute refresh for POP/IMAP</string>

View File

@ -33,6 +33,7 @@ import com.android.email.R;
import com.android.email.activity.UiUtilities;
import com.android.email.service.EmailServiceUtils;
import com.android.emailcommon.Logging;
import com.android.mail.preferences.MailPrefs;
import com.android.mail.utils.LogUtils;
public class DebugFragment extends Fragment implements OnCheckedChangeListener,
@ -73,6 +74,7 @@ public class DebugFragment extends Fragment implements OnCheckedChangeListener,
}
UiUtilities.getView(view, R.id.clear_webview_cache).setOnClickListener(this);
UiUtilities.getView(view, R.id.clear_migration_state).setOnClickListener(this);
final CheckBox enableStrictModeView =
UiUtilities.getView(view, R.id.debug_enable_strict_mode);
@ -112,6 +114,9 @@ public class DebugFragment extends Fragment implements OnCheckedChangeListener,
case R.id.clear_webview_cache:
clearWebViewCache();
break;
case R.id.clear_migration_state:
clearMigrationState();
break;
}
}
@ -124,4 +129,9 @@ public class DebugFragment extends Fragment implements OnCheckedChangeListener,
webview.destroy();
}
}
private void clearMigrationState() {
MailPrefs prefs = MailPrefs.get(getActivity());
prefs.setMigrationState(MailPrefs.PreferenceKeys.MIGRATION_STATE_NONE);
}
}