[android] Maded intent processor returned value nullable

This commit is contained in:
Alexander Zatsepin 2018-08-09 15:20:57 +03:00 committed by Aleksey Belousov
parent 76fe38a833
commit cd128520d5
3 changed files with 11 additions and 14 deletions

View file

@ -494,11 +494,8 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
for (IntentProcessor ip : mIntentProcessors)
{
if (ip.isSupported(extra))
{
mMapTaskToForward = ip.process(intent);
if (ip.isSupported(extra) && (mMapTaskToForward = ip.process(extra)) != null)
break;
}
}
}

View file

@ -4,6 +4,7 @@ import android.content.ContentResolver;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.crashlytics.android.Crashlytics;
@ -347,7 +348,7 @@ public class Factory
@NonNull
private final DownloadResourcesLegacyActivity mActivity;
public KmzKmlProcessor(@NonNull DownloadResourcesLegacyActivity activity)
KmzKmlProcessor(@NonNull DownloadResourcesLegacyActivity activity)
{
mActivity = activity;
}
@ -359,17 +360,15 @@ public class Factory
return mData != null;
}
@NonNull
@Nullable
@Override
public MwmActivity.MapTask process(@NonNull Intent intent)
{
return (MwmActivity.MapTask) target -> {
ThreadPool.getStorage().execute(() -> {
readKmzFromIntent();
mActivity.runOnUiThread(mActivity::showMap);
});
return true;
};
ThreadPool.getStorage().execute(() -> {
readKmzFromIntent();
mActivity.runOnUiThread(mActivity::showMap);
});
return null;
}
private void readKmzFromIntent()

View file

@ -2,6 +2,7 @@ package com.mapswithme.maps.intent;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.mapswithme.maps.MwmActivity;
@ -9,7 +10,7 @@ public interface IntentProcessor
{
boolean isSupported(@NonNull Intent intent);
@NonNull
@Nullable
MwmActivity.MapTask process(@NonNull Intent intent);
}