From 5f636747992940987876c39821fcb3dedf28fbfb Mon Sep 17 00:00:00 2001 From: Page Asgardius Date: Mon, 10 Oct 2022 12:49:41 -0700 Subject: [PATCH] notification channel --- .../main/java/asgardius/page/s3manager/VideoPlayer.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/asgardius/page/s3manager/VideoPlayer.java b/app/src/main/java/asgardius/page/s3manager/VideoPlayer.java index 1585376..2d826db 100644 --- a/app/src/main/java/asgardius/page/s3manager/VideoPlayer.java +++ b/app/src/main/java/asgardius/page/s3manager/VideoPlayer.java @@ -4,6 +4,8 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import android.app.AppOpsManager; +import android.app.NotificationChannel; +import android.app.NotificationManager; import android.app.PendingIntent; import android.app.PictureInPictureParams; import android.content.Context; @@ -71,6 +73,12 @@ public class VideoPlayer extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_video_player); + if(Build.VERSION.SDK_INT >=Build.VERSION_CODES.O){ + + NotificationChannel channel= new NotificationChannel("playback","Test Notification",NotificationManager.IMPORTANCE_DEFAULT); + NotificationManager manager =getSystemService(NotificationManager.class); + manager.createNotificationChannel(channel); + } appOpsManager = (AppOpsManager)getSystemService(Context.APP_OPS_SERVICE); mediaSession = new MediaSessionCompat(this, getPackageName()); mediaSessionConnector = new MediaSessionConnector(mediaSession);