Utilize BundleCompat and IntentCompat methods
This commit is contained in:
parent
f3b458c803
commit
76f1e588f7
4 changed files with 9 additions and 4 deletions
|
|
@ -25,6 +25,7 @@ import android.content.Intent;
|
|||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.content.IntentCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import org.reactivestreams.Subscriber;
|
||||
|
|
@ -65,7 +66,7 @@ public class SubscriptionsExportService extends BaseImportExportService {
|
|||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
final Uri path = intent.getParcelableExtra(KEY_FILE_PATH);
|
||||
final Uri path = IntentCompat.getParcelableExtra(intent, KEY_FILE_PATH, Uri.class);
|
||||
if (path == null) {
|
||||
stopAndReportError(new IllegalStateException(
|
||||
"Exporting to a file, but the path is null"),
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import android.util.Pair;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.IntentCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import org.reactivestreams.Subscriber;
|
||||
|
|
@ -108,7 +109,7 @@ public class SubscriptionsImportService extends BaseImportExportService {
|
|||
if (currentMode == CHANNEL_URL_MODE) {
|
||||
channelUrl = intent.getStringExtra(KEY_VALUE);
|
||||
} else {
|
||||
final Uri uri = intent.getParcelableExtra(KEY_VALUE);
|
||||
final Uri uri = IntentCompat.getParcelableExtra(intent, KEY_VALUE, Uri.class);
|
||||
if (uri == null) {
|
||||
stopAndReportError(new IllegalStateException(
|
||||
"Importing from input stream, but file path is null"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue