Skip to content

Commit 35614c3

Browse files
committed
Don't show app name twice in notifications on N
1 parent 9c894fe commit 35614c3

File tree

1 file changed

+5
-2
lines changed
  • app/src/main/java/de/Maxr1998/xposed/maxlock/hooks

1 file changed

+5
-2
lines changed

app/src/main/java/de/Maxr1998/xposed/maxlock/hooks/Apps.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,16 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
109109
String appName = appContext.getPackageManager().getApplicationInfo(packageName, 0).loadLabel(appContext.getPackageManager()).toString();
110110
Notification.Builder replacementBuilder = (SDK_INT > Build.VERSION_CODES.O ?
111111
new Notification.Builder(appContext, notification.getChannelId()) : new Notification.Builder(appContext))
112-
.setContentTitle(appName)
113-
.setContentText(replacementText)
114112
.setLights(notification.ledARGB, notification.ledOnMS, notification.ledOffMS)
115113
.setSound(notification.sound)
116114
.setContentIntent(notification.contentIntent)
117115
.setDeleteIntent(notification.deleteIntent)
118116
.setWhen(notification.when);
117+
if (SDK_INT >= Build.VERSION_CODES.N) {
118+
replacementBuilder.setContentTitle(replacementText);
119+
} else replacementBuilder.setContentTitle(appName)
120+
.setContentText(replacementText);
121+
119122
if (SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
120123
replacementBuilder.setColor(mlColor)
121124
.setGroup(notification.getGroup())

0 commit comments

Comments
 (0)