From 0522bd9d3d2f6f6f4fb7aa8eb11c66380575128a Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Tue, 16 Nov 2021 14:56:58 +0900 Subject: [PATCH] universal7885: CameraLightSensor: Allow user to mute the app's notification android.app.NotificationChannel public void setBlockable(boolean blockable) Allows users to block notifications sent through this channel, if this channel belongs to a package that is signed with the system signature. If the channel does not belong to a package that is signed with the system signature, this method does nothing, since such channels are blockable by default and cannot be set to be unblockable. Change-Id: Idfa7a672c0be585381239b879ce386e6e99d0619 Signed-off-by: roynatech2544 --- .../eurekateam/cameralightsensor/CameraLightSensorService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.kt b/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.kt index 1454da9..3912cfc 100755 --- a/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.kt +++ b/universal7885-common/apps/CameraLightSensor/src/com/eurekateam/cameralightsensor/CameraLightSensorService.kt @@ -53,6 +53,7 @@ open class CameraLightSensorService : Service() { mContext!!.basePackageName, "CameraLightSensor", NotificationManager.IMPORTANCE_LOW ) + channel.isBlockable = true nm.createNotificationChannel(channel) val builder = NotificationCompat.Builder(mContext!!, mContext!!.basePackageName) val notificationIntent = Intent(mContext, CameraLightSensorService::class.java) @@ -61,7 +62,6 @@ open class CameraLightSensorService : Service() { notificationIntent, PendingIntent.FLAG_IMMUTABLE ) - //set builder.setContentIntent(contentIntent) builder.setSmallIcon(R.drawable.ic_brightness) builder.setContentTitle("Camera Light Sensor Service") @@ -429,4 +429,4 @@ open class CameraLightSensorService : Service() { } } } -} \ No newline at end of file +}