Warning, /network/kdeconnect-android/src/org/kde/kdeconnect/Plugins/ClibpoardPlugin/ClipboardTileService.kt is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2021 Maxim Leshchenko <cnmaks90@gmail.com>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 package org.kde.kdeconnect.Plugins.ClibpoardPlugin
0008 
0009 import android.content.Intent
0010 import android.os.Build
0011 import android.service.quicksettings.TileService
0012 import androidx.annotation.RequiresApi
0013 import org.kde.kdeconnect.KdeConnect
0014 
0015 @RequiresApi(Build.VERSION_CODES.N)
0016 class ClipboardTileService : TileService() {
0017     override fun onClick() {
0018         super.onClick()
0019 
0020         startActivityAndCollapse(Intent(this, ClipboardFloatingActivity::class.java).apply {
0021             flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
0022             val ids = KdeConnect.getInstance().devices.values
0023                 .filter { it.isReachable && it.isPaired }
0024                 .map { it.deviceId }
0025             putExtra("connectedDeviceIds", ArrayList(ids))
0026         })
0027     }
0028 }