universal7885: parts: fix fps overlay on quicksettings

* mRunning should be static (in companion object) to correctly get it

Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
roynatech2544 2021-12-01 13:32:48 +09:00
commit de4c5c6d8e
No known key found for this signature in database
GPG key ID: 9675C32163D88D30
6 changed files with 17 additions and 3 deletions

View file

@ -37,7 +37,6 @@ open class FPSInfoService : Service() {
private val TAG = "FPSInfoService"
private var fPSInfoString: String? = null
private var mDreamManager: IDreamManager? = null
private var mRunning : Boolean = false
private inner class FPSView(c: Context) : View(c) {
private val mOnlinePaint: Paint?
@ -245,5 +244,6 @@ open class FPSInfoService : Service() {
}
companion object {
private var surfaceFlingerFPS: SurfaceFlingerFPS? = null
private var mRunning : Boolean = false
}
}

View file

@ -21,6 +21,7 @@ import android.service.quicksettings.TileService
// TODO: Add FPS drawables
class FPSTileService : TileService() {
private val fpsinfo = Intent(this, FPSInfoService::class.java)
private var isShowing = false
override fun onStartListening() {
super.onStartListening()
@ -30,7 +31,6 @@ class FPSTileService : TileService() {
}
override fun onClick() {
val fpsinfo = Intent(this, FPSInfoService::class.java)
if (!isShowing) startService(fpsinfo) else stopService(fpsinfo)
isShowing = !isShowing
updateTile()