For hidden flavor, make notificaion not open the app when clicked, use different icon.

This only apply to when the notificaion can't be hidden, i.e. SDK >= 25.
Этот коммит содержится в:
Gary van der Merwe
2017-12-15 09:09:25 +02:00
родитель dac43ccbc1
Коммит 841d3e581c
2 изменённых файлов: 20 добавлений и 7 удалений
+11 -7
Просмотреть файл
@@ -35,16 +35,20 @@ public class TrackingService extends Service {
private TrackingController trackingController;
private static Notification createNotification(Context context) {
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
return new NotificationCompat.Builder(context, MainApplication.PRIMARY_CHANNEL)
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, MainApplication.PRIMARY_CHANNEL)
.setSmallIcon(R.drawable.ic_stat_notify)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setCategory(Notification.CATEGORY_SERVICE);
if (!BuildConfig.HIDDEN_APP) {
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
builder
.setContentTitle(context.getString(R.string.settings_status_on_summary))
.setTicker(context.getString(R.string.settings_status_on_summary))
.setContentIntent(pendingIntent)
.setSmallIcon(R.drawable.ic_stat_notify)
.setPriority(NotificationCompat.PRIORITY_LOW)
.setCategory(Notification.CATEGORY_SERVICE)
.setColor(ContextCompat.getColor(context, R.color.primary_dark))
.build();
.setColor(ContextCompat.getColor(context, R.color.primary_dark));
}
return builder.build();
}
@TargetApi(Build.VERSION_CODES.ECLAIR)