aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorDan Zivkovic <zivkovic@google.com>2015-03-23 23:10:58 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-23 23:10:58 +0000
commit6f09e99d24b4f67ef14d78a18a246da67cca650e (patch)
treef51bfa4fe52218248dc4f03eab6188b76a183b45 /java/src
parentc84e354cfdd3380acbbd086c1f40511afa79e9ae (diff)
parent2bc9f4073d872ac3ffb56e44bef39e24da12a66f (diff)
downloadlatinime-6f09e99d24b4f67ef14d78a18a246da67cca650e.tar.gz
latinime-6f09e99d24b4f67ef14d78a18a246da67cca650e.tar.xz
latinime-6f09e99d24b4f67ef14d78a18a246da67cca650e.zip
am 2bc9f407: Block overflow menu during setup. DO NOT MERGE
* commit '2bc9f4073d872ac3ffb56e44bef39e24da12a66f': Block overflow menu during setup. DO NOT MERGE
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/settings/SettingsFragment.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java
index 4fc17387f..6c8ab573a 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java
@@ -16,10 +16,12 @@
package com.android.inputmethod.latin.settings;
+import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceScreen;
+import android.provider.Settings.Secure;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@@ -67,13 +69,23 @@ public final class SettingsFragment extends InputMethodSettingsFragment {
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
+ final Activity activity = getActivity();
+ final int setupStatus = Secure.getInt(
+ activity.getContentResolver(),
+ "user_setup_complete",
+ 0 /* default */);
+ if (setupStatus == 0) {
+ // If setup is not complete, it's not safe to launch Help or other activities
+ // because they might go to the Play Store. See b/19866981.
+ return true;
+ }
final int itemId = item.getItemId();
if (itemId == MENU_HELP_AND_FEEDBACK) {
- FeedbackUtils.showHelpAndFeedbackForm(getActivity());
+ FeedbackUtils.showHelpAndFeedbackForm(activity);
return true;
}
if (itemId == MENU_ABOUT) {
- final Intent aboutIntent = FeedbackUtils.getAboutKeyboardIntent(getActivity());
+ final Intent aboutIntent = FeedbackUtils.getAboutKeyboardIntent(activity);
if (aboutIntent != null) {
startActivity(aboutIntent);
return true;