aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-11-30 21:20:08 +0100
committerChristian Schneppe <christian@pix-art.de>2018-11-30 21:20:08 +0100
commit806c82f34bf561c8b35d245b2756acd2361c9210 (patch)
treed35d01d38f9165bed06dac43b3dcaac591c9332e /src/main/java/de
parent591f585a7a1eaafaf388821dc05a638c7d3044be (diff)
change audio attributes for notification channel
This may help on platforms that make a difference between ringtone volume and notification volume
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index 6e93145b8..de7ace3fd 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -159,7 +159,7 @@ public class NotificationService {
messagesChannel.setShowBadge(true);
messagesChannel.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION), new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
- .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE)
+ .setUsage(AudioAttributes.USAGE_NOTIFICATION_COMMUNICATION_INSTANT)
.build());
messagesChannel.setLightColor(LED_COLOR);
final int dat = 70;
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index 06ee2692d..aded90a30 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -25,6 +25,7 @@ import android.graphics.Color;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
+import android.media.AudioManager;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.AsyncTask;
@@ -385,6 +386,7 @@ public abstract class XmppActivity extends ActionBarActivity {
super.onCreate(savedInstanceState);
this.mTheme = findTheme();
setTheme(this.mTheme);
+ setVolumeControlStream(AudioManager.STREAM_NOTIFICATION);
metrics = getResources().getDisplayMetrics();
ExceptionHelper.init(getApplicationContext());
this.isCameraFeatureAvailable = getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA);