0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-04 18:05:04 +00:00

I should've built before pushing commits

This commit is contained in:
X1nto 2020-09-04 23:41:39 +04:00
parent 85d5764e75
commit 4daee42a0b
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ import java.io.InputStream
class AppInstaller: Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val app = if (intent.getStringExtra("pkg").contains("mgoogle")) "microg" else "music"
val app = if (intent?.getStringExtra("pkg")?.contains("mgoogle") == true) "microg" else "music"
val callbackIntent = Intent(applicationContext, AppInstallerService::class.java).putExtra("app", app)
val pendingIntent = PendingIntent.getService(applicationContext, 0, callbackIntent, 0)
val packageInstaller = packageManager.packageInstaller

View file

@ -17,7 +17,7 @@ class AppInstallerService: Service() {
when (intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -999)) {
PackageInstaller.STATUS_PENDING_USER_ACTION -> {
Log.d(TAG, "Requesting user confirmation for installation")
localBroadcastManager.sendBroadcast(Intent(if (intent.getStringExtra("app")) HomeFragment.MICROG_INSTALLING else HomeFragment.MUSIC_INSTALLING))
localBroadcastManager.sendBroadcast(Intent(if (intent.getStringExtra("app") == "microg") HomeFragment.MICROG_INSTALLING else HomeFragment.MUSIC_INSTALLING))
val confirmationIntent = intent.getParcelableExtra<Intent>(Intent.EXTRA_INTENT)
confirmationIntent?.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
try {
@ -30,7 +30,7 @@ class AppInstallerService: Service() {
Log.d(TAG, "Installation succeed")
with(localBroadcastManager) {
sendBroadcast(Intent(HomeFragment.REFRESH_HOME))
sendBroadcast(Intent(if (intent.getStringExtra("app")) HomeFragment.MICROG_INSTALLING else HomeFragment.MUSIC_INSTALLING))
sendBroadcast(Intent(if (intent.getStringExtra("app") == "microg") HomeFragment.MICROG_INSTALLING else HomeFragment.MUSIC_INSTALLING))
}
}
else -> sendFailure(intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -999), this)