aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Zivkovic <zivkovic@google.com>2015-03-23 10:51:54 -0700
committerDan Zivkovic <zivkovic@google.com>2015-03-23 11:34:02 -0700
commit75fc9080a83881e5d8961eb21caa93496a84483e (patch)
tree463175b25278e91a9f0a90c8cfb1396fa3ad3c58
parent13271bfde84c56c0bf75868c1a4888c4262b3314 (diff)
downloadlatinime-75fc9080a83881e5d8961eb21caa93496a84483e.tar.gz
latinime-75fc9080a83881e5d8961eb21caa93496a84483e.tar.xz
latinime-75fc9080a83881e5d8961eb21caa93496a84483e.zip
Block overflow menu during setup.
Bug 19866981. Change-Id: I757dacaa29a132c65841b9aaa2cc070ed9fa712c
-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 b98c53af4..f5455e3db 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;
@@ -68,13 +70,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;