mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
disable handling broadcast on Nougat and better
This commit is contained in:
parent
c3b6e013d8
commit
a116cdf77f
1 changed files with 15 additions and 12 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue