From c8bf4906e6ba1b9f73dd80df56ef47e82bc5eebb Mon Sep 17 00:00:00 2001 From: Yoshiaki Naka Date: Wed, 6 Mar 2019 20:11:44 +0900 Subject: Consider long system notification sound set by user User can change the system notification sound from a simple tone to a long music though it is not a major user scenario. It is better not to play the notification sound when SIM Toolkit application launch a dialog or activity for DISPLAY TEXT or GET INKEY/INPUT commands. Bug: 128811547 Test: Confirmed that the sound is started only when the keyguard exists. Change-Id: Icd378bdce15a4cd77a5dc9e496f6dcf0b242664e --- src/com/android/stk/StkAppService.java | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src') diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java index c68dd83..43035f0 100644 --- a/src/com/android/stk/StkAppService.java +++ b/src/com/android/stk/StkAppService.java @@ -40,7 +40,6 @@ import android.content.res.Resources; import android.content.res.Resources.NotFoundException; import android.graphics.Bitmap; import android.graphics.BitmapFactory; -import android.media.RingtoneManager; import android.net.Uri; import android.os.Bundle; import android.os.Handler; @@ -1663,22 +1662,6 @@ public class StkAppService extends Service implements Runnable { // if user cannot see the message from the card right now because of it. // The notification can be dismissed if user removed the keyguard screen. launchNotificationOnKeyguard(slotId, message); - } else if (!(pm.isInteractive() && isTopOfStack())) { - // User might be doing something but it is not related to the SIM Toolkit. - // Play the tone and do vibration in order to attract user's attention. - // User will see the input screen or the dialog soon in this case. - NotificationChannel channel = mNotificationManager - .getNotificationChannel(STK_NOTIFICATION_CHANNEL_ID); - Uri uri = channel.getSound(); - if (uri != null && !Uri.EMPTY.equals(uri) - && (NotificationManager.IMPORTANCE_LOW) < channel.getImportance()) { - RingtoneManager.getRingtone(getApplicationContext(), uri).play(); - } - long[] pattern = channel.getVibrationPattern(); - if (pattern != null && channel.shouldVibrate()) { - ((Vibrator) this.getSystemService(Context.VIBRATOR_SERVICE)) - .vibrate(pattern, -1); - } } // Turn on the screen. -- cgit v1.2.3