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

Commit 2f78d82a authored by Lifu Tang's avatar Lifu Tang Committed by Android (Google) Code Review
Browse files

Merge "Don't show help menu when browser unavailable" into klp-dev

parents bc2c3db8 66d879ce
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.settings;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
@@ -95,9 +96,15 @@ public class HelpUtils {

            // Set the intent to the help menu item, show the help menu item in the overflow
            // menu, and make it visible.
            ComponentName component = intent.resolveActivity(context.getPackageManager());
            if (component != null) {
                helpMenuItem.setIntent(intent);
                helpMenuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
                helpMenuItem.setVisible(true);
            } else {
                helpMenuItem.setVisible(false);
                return false;
            }

            // return that the help menu item is visible (i.e., true)
            return true;