Skip to content

Commit

Permalink
Fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
HMBSbige committed Nov 6, 2019
1 parent c5834cd commit 6105874
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions app/src/main/java/com/github/shadowsocks/ShadowsocksNotification.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,6 @@ class ShadowsocksNotification @JvmOverloads constructor(private val service: Ser
private val style: NotificationCompat.BigTextStyle
private var isVisible = true

init
{
// init notification builder
initNotificationBuilder()
style = NotificationCompat.BigTextStyle(builder)

// init with update action
initWithUpdateAction()

// register lock receiver
registerLockReceiver(service, visible)
}

private var lockReceiver: BroadcastReceiver? = object : BroadcastReceiver()
{
override fun onReceive(context: Context, intent: Intent)
Expand All @@ -79,6 +66,19 @@ class ShadowsocksNotification @JvmOverloads constructor(private val service: Ser
return state
}

init
{
// init notification builder
initNotificationBuilder()
style = NotificationCompat.BigTextStyle(builder)

// init with update action
initWithUpdateAction()

// register lock receiver
registerLockReceiver(service, visible)
}

private fun update(action: String?, forceShow: Boolean = false)
{
if (forceShow || serviceState == Constants.State.CONNECTED)
Expand Down

0 comments on commit 6105874

Please sign in to comment.