Skip to content

Commit

Permalink
fix bug: PlayerService crash on target API 34 #53
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfeng committed Oct 18, 2023
1 parent dba1676 commit ec27d20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions player/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

android {
compileSdkVersion 33
compileSdkVersion 34

defaultConfig {
minSdkVersion 16
targetSdkVersion 33
targetSdkVersion 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
Expand Down
7 changes: 6 additions & 1 deletion player/src/main/java/snow/player/PlayerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,12 @@ public void onReceive(Context context, Intent intent) {
};

IntentFilter filter = new IntentFilter(this.getClass().getName());
registerReceiver(mCustomActionReceiver, filter);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
registerReceiver(mCustomActionReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(mCustomActionReceiver, filter);
}
}

private void initSyncPlayerStateHandler() {
Expand Down

0 comments on commit ec27d20

Please sign in to comment.