mirror of
https://github.com/CherretGit/zaprett-app.git
synced 2026-03-22 00:28:15 +05:00
Revert "add requiresapi annotation to QS tile service"
This reverts commit fabea1f68d.
This commit is contained in:
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@@ -6,7 +6,6 @@
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="/usr/share/java/gradle" />
|
||||
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
@@ -16,6 +15,5 @@
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
<option name="parallelModelFetch" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -2,10 +2,8 @@ package com.cherret.zaprett.utils
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Build
|
||||
import android.service.quicksettings.Tile
|
||||
import android.service.quicksettings.TileService
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.cherret.zaprett.R
|
||||
import com.cherret.zaprett.byedpi.ByeDpiVpnService
|
||||
@@ -19,19 +17,16 @@ class QSTileService: TileService() {
|
||||
prefs = applicationContext.getSharedPreferences("settings", MODE_PRIVATE)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
override fun onTileAdded() {
|
||||
super.onTileAdded()
|
||||
updateStatus()
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
override fun onStartListening() {
|
||||
super.onStartListening()
|
||||
updateStatus()
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
override fun onClick() {
|
||||
super.onClick()
|
||||
if (qsTile.state == Tile.STATE_INACTIVE) {
|
||||
@@ -59,7 +54,6 @@ class QSTileService: TileService() {
|
||||
updateStatus()
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.Q)
|
||||
private fun updateStatus() {
|
||||
if (getServiceType(prefs) != ServiceType.byedpi) {
|
||||
getStatus {
|
||||
|
||||
Reference in New Issue
Block a user