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

Commit 37f4f5b1 authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am d135f74b: am 151af19b: Fix bug 2651076 - Catch/log...

am d135f74b: am 151af19b: Fix bug 2651076 - Catch/log ActivityNotFoundException in MenuItemImpl.invoke()

Merge commit 'd135f74b' into kraken

* commit 'd135f74b':
  Fix bug 2651076 - Catch/log ActivityNotFoundException in MenuItemImpl.invoke()
parents 55b0110f d135f74b
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

package com.android.internal.view.menu;

import com.android.internal.view.menu.MenuView.ItemView;
import java.lang.ref.WeakReference;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.SubMenu;
@@ -28,12 +30,14 @@ import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ContextMenu.ContextMenuInfo;

import java.lang.ref.WeakReference;
import com.android.internal.view.menu.MenuView.ItemView;

/**
 * @hide
 */
public final class MenuItemImpl implements MenuItem {
    private static final String TAG = "MenuItemImpl";
    
    private final int mId;
    private final int mGroup;
    private final int mCategoryOrder;
@@ -147,8 +151,12 @@ public final class MenuItemImpl implements MenuItem {
        }
        
        if (mIntent != null) {
            try {
                mMenu.getContext().startActivity(mIntent);
                return true;
            } catch (ActivityNotFoundException e) {
                Log.e(TAG, "Can't find activity to handle intent; ignoring", e);
            }
        }
        
        return false;