mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 19:55:33 -04:00
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 <whiteshell2544@naver.com>
This commit is contained in:
parent
c31f2b7c87
commit
0522bd9d3d
1 changed files with 2 additions and 2 deletions
|
|
@ -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() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue