Skip to content
Snippets Groups Projects
Commit e02d4831 authored by Dan Zivkovic's avatar Dan Zivkovic Committed by Android (Google) Code Review
Browse files

Merge "Block overflow menu during setup."

parents bc1cf081 75fc9080
No related branches found
No related tags found
No related merge requests found
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
package com.android.inputmethod.latin.settings; package com.android.inputmethod.latin.settings;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.preference.Preference; import android.preference.Preference;
import android.preference.PreferenceScreen; import android.preference.PreferenceScreen;
import android.provider.Settings.Secure;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
...@@ -68,13 +70,23 @@ public final class SettingsFragment extends InputMethodSettingsFragment { ...@@ -68,13 +70,23 @@ public final class SettingsFragment extends InputMethodSettingsFragment {
@Override @Override
public boolean onOptionsItemSelected(final MenuItem item) { 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(); final int itemId = item.getItemId();
if (itemId == MENU_HELP_AND_FEEDBACK) { if (itemId == MENU_HELP_AND_FEEDBACK) {
FeedbackUtils.showHelpAndFeedbackForm(getActivity()); FeedbackUtils.showHelpAndFeedbackForm(activity);
return true; return true;
} }
if (itemId == MENU_ABOUT) { if (itemId == MENU_ABOUT) {
final Intent aboutIntent = FeedbackUtils.getAboutKeyboardIntent(getActivity()); final Intent aboutIntent = FeedbackUtils.getAboutKeyboardIntent(activity);
if (aboutIntent != null) { if (aboutIntent != null) {
startActivity(aboutIntent); startActivity(aboutIntent);
return true; return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment