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

Commit 2e899dd3 authored by You Kim's avatar You Kim Committed by Danny Baumann
Browse files

NPE in SearchManager.triggerSearch

mAssociatedPackage field is never initialized and cause NPE.

Change-Id: Ibf0d44b2170b7cbfe4a883008254a086e03579c5
parent 7430f66a
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -540,11 +540,6 @@ public class SearchManager

    private final Context mContext;

    /**
     * The package associated with this seach manager.
     */
    private String mAssociatedPackage;

    // package private since they are used by the inner class SearchManagerCallback
    /* package */ final Handler mHandler;
    /* package */ OnDismissListener mDismissListener = null;
@@ -742,10 +737,6 @@ public class SearchManager
    public void triggerSearch(String query,
                              ComponentName launchActivity,
                              Bundle appSearchData) {
        if (!mAssociatedPackage.equals(launchActivity.getPackageName())) {
            throw new IllegalArgumentException("invoking app search on a different package " +
                    "not associated with this search manager");
        }
        if (query == null || TextUtils.getTrimmedLength(query) == 0) {
            Log.w(TAG, "triggerSearch called with empty query, ignoring.");
            return;