0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-05 02:15: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() { class AppInstaller: Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { 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 callbackIntent = Intent(applicationContext, AppInstallerService::class.java).putExtra("app", app)
val pendingIntent = PendingIntent.getService(applicationContext, 0, callbackIntent, 0) val pendingIntent = PendingIntent.getService(applicationContext, 0, callbackIntent, 0)
val packageInstaller = packageManager.packageInstaller val packageInstaller = packageManager.packageInstaller

View file

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