-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/li/songe/gkd/debug/SnapshotActionService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package li.songe.gkd.debug | ||
|
||
import android.app.Service | ||
import android.content.Intent | ||
import android.os.Binder | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.launch | ||
import li.songe.gkd.appScope | ||
import li.songe.gkd.util.launchTry | ||
|
||
/** | ||
* https://github.com/gkd-kit/gkd/issues/253 | ||
*/ | ||
class SnapshotActionService : Service() { | ||
override fun onBind(intent: Intent?): Binder? = null | ||
override fun onCreate() { | ||
super.onCreate() | ||
appScope.launch { | ||
delay(1000) | ||
stopSelf() | ||
} | ||
appScope.launchTry { | ||
SnapshotExt.captureSnapshot() | ||
} | ||
} | ||
} |