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

Commit eb7b408a authored by You Kim's avatar You Kim
Browse files

NPE in SearchManager.triggerSearch

mAssociatedPackage field is never initialized and cause NPE.

Change-Id: Ibf0d44b2170b7cbfe4a883008254a086e03579c5
parent f39abeb4
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -435,11 +435,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;
@@ -633,10 +628,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;