Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Commit

Permalink
fix: controls not showing on Android lock screen (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
lufinkey authored and tanguyantoine committed Feb 1, 2019
1 parent 6ee2a86 commit 51a6fc2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,13 @@ public void init() {
createChannel(context);
}
nb = new NotificationCompat.Builder(context, CHANNEL_ID);
nb.setVisibility(Notification.VISIBILITY_PUBLIC);

if (!(Build.MANUFACTURER.toLowerCase(Locale.getDefault()).contains("huawei") && Build.VERSION.SDK_INT < Build.VERSION_CODES.M)) {
nb.setStyle(new MediaStyle().setMediaSession(session.getSessionToken()));
MediaStyle style = new MediaStyle();
style.setMediaSession(session.getSessionToken());
style.setShowActionsInCompactView(new int[]{0,1,2});
nb.setStyle(style);
}

state = pb.build();
Expand Down

0 comments on commit 51a6fc2

Please sign in to comment.