Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51084b37 authored by kaiyiz's avatar kaiyiz
Browse files

TeleService: Remove the option menu of the restore defaults

This issue is the Android original bug, Google has delete restore defaults
but they don't delete the menu item in quick response settings.

Remove the option menu item of the restore defaults.

CRs-Fixed: 752474

Change-Id: Idaee12351a850f0e4bac421490f2543620ff8082
parent 828ac5c6
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import android.view.MenuItem;
 */
public class RespondViaSmsSettings {
    private static final String KEY_PREFERRED_PACKAGE = "preferred_package_pref";
    private static final String KEY_INSTANT_TEXT_DEFAULT_COMPONENT = "instant_text_def_component";

    // TODO: This class is newly copied into Telecom (com.android.server.telecom) from it previous
    // location in Telephony (com.android.phone). User's preferences stored in the old location
@@ -124,26 +123,12 @@ public class RespondViaSmsSettings {
            switch (itemId) {
                case android.R.id.home:
                    goUpToTopLevelSetting(this);
                    return true;
                case R.id.respond_via_message_reset:
                    // Reset the preferences settings
                    SharedPreferences prefs = getSharedPreferences(
                            QuickResponseUtils.SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
                    SharedPreferences.Editor editor = prefs.edit();
                    editor.remove(KEY_INSTANT_TEXT_DEFAULT_COMPONENT);
                    editor.apply();

                    return true;
                default:
            }
            return super.onOptionsItemSelected(item);
        }

        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            getMenuInflater().inflate(R.menu.respond_via_message_settings_menu, menu);
            return super.onCreateOptionsMenu(menu);
        }
    }

    /**