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

Commit 38533ea5 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "NPE in AcitivtyChooserModel." into jb-mr1-dev

parents 08681add abcaeea1
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.pm.ResolveInfo;
import android.database.DataSetObservable;
import android.database.DataSetObservable;
import android.database.DataSetObserver;
import android.os.AsyncTask;
import android.os.AsyncTask;
import android.text.TextUtils;
import android.text.TextUtils;
import android.util.Log;
import android.util.Log;
@@ -458,13 +457,18 @@ public class ActivityChooserModel extends DataSetObservable {
     * </p>
     * </p>
     *
     *
     * @return An {@link Intent} for launching the activity or null if the
     * @return An {@link Intent} for launching the activity or null if the
     *         policy has consumed the intent.
     *         policy has consumed the intent or there is not current intent
     *         set via {@link #setIntent(Intent)}.
     *
     *
     * @see HistoricalRecord
     * @see HistoricalRecord
     * @see OnChooseActivityListener
     * @see OnChooseActivityListener
     */
     */
    public Intent chooseActivity(int index) {
    public Intent chooseActivity(int index) {
        synchronized (mInstanceLock) {
        synchronized (mInstanceLock) {
            if (mIntent == null) {
                return null;
            }

            ensureConsistentState();
            ensureConsistentState();


            ActivityResolveInfo chosenActivity = mActivities.get(index);
            ActivityResolveInfo chosenActivity = mActivities.get(index);