Hide stop action in notification if the quick settings tile is present

This commit is contained in:
Mygod
2016-06-17 14:40:33 +08:00
parent e1364c012b
commit 89df2bc715
2 changed files with 17 additions and 3 deletions
@@ -40,8 +40,8 @@ class ShadowsocksNotification(private val service: BaseService, profileName: Str
.setContentIntent(PendingIntent.getActivity(service, 0, new Intent(service, classOf[Shadowsocks])
.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), 0))
.setSmallIcon(R.drawable.ic_stat_shadowsocks)
.addAction(R.drawable.ic_navigation_close, service.getString(R.string.stop),
PendingIntent.getBroadcast(service, 0, new Intent(Action.CLOSE), 0))
if (!ShadowsocksTileService.running) builder.addAction(R.drawable.ic_navigation_close,
service.getString(R.string.stop), PendingIntent.getBroadcast(service, 0, new Intent(Action.CLOSE), 0))
app.profileManager.getAllProfiles match {
case Some(profiles) => if (profiles.length > 1)
builder.addAction(R.drawable.ic_action_settings, service.getString(R.string.quick_switch),