disable handling broadcast on Nougat and better

This commit is contained in:
tobiasKaminsky 2016-12-29 16:10:59 +01:00 committed by AndyScherzinger
parent c3b6e013d8
commit a116cdf77f
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -28,6 +28,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.os.Build;
import android.provider.MediaStore.Images;
import android.provider.MediaStore.Video;
import android.support.v4.content.ContextCompat;
@ -57,18 +58,20 @@ public class InstantUploadBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log_OC.d(TAG, "Received: " + intent.getAction());
if (intent.getAction().equals(NEW_PHOTO_ACTION_UNOFFICIAL)) {
handleNewPictureAction(context, intent);
Log_OC.d(TAG, "UNOFFICIAL processed: com.android.camera.NEW_PICTURE");
} else if (intent.getAction().equals(NEW_PHOTO_ACTION)) {
handleNewPictureAction(context, intent);
Log_OC.d(TAG, "OFFICIAL processed: android.hardware.action.NEW_PICTURE");
} else if (intent.getAction().equals(NEW_VIDEO_ACTION)) {
handleNewVideoAction(context, intent);
Log_OC.d(TAG, "OFFICIAL processed: android.hardware.action.NEW_VIDEO");
} else {
Log_OC.e(TAG, "Incorrect intent received: " + intent.getAction());
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
Log_OC.d(TAG, "Received: " + intent.getAction());
if (intent.getAction().equals(NEW_PHOTO_ACTION_UNOFFICIAL)) {
handleNewPictureAction(context, intent);
Log_OC.d(TAG, "UNOFFICIAL processed: com.android.camera.NEW_PICTURE");
} else if (intent.getAction().equals(NEW_PHOTO_ACTION)) {
handleNewPictureAction(context, intent);
Log_OC.d(TAG, "OFFICIAL processed: android.hardware.action.NEW_PICTURE");
} else if (intent.getAction().equals(NEW_VIDEO_ACTION)) {
handleNewVideoAction(context, intent);
Log_OC.d(TAG, "OFFICIAL processed: android.hardware.action.NEW_VIDEO");
} else {
Log_OC.e(TAG, "Incorrect intent received: " + intent.getAction());
}
}
}