Switch from bundleOf to Bundle class

The extension method has been deprecated

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2026-03-16 15:24:25 +08:00
parent 77a7123147
commit a56f544f46
3 changed files with 33 additions and 20 deletions

View File

@@ -9,7 +9,6 @@ import android.os.Handler
import android.os.Looper
import android.util.Base64
import android.util.Log
import androidx.core.os.bundleOf
import androidx.hilt.work.HiltWorker
import androidx.work.CoroutineWorker
import androidx.work.WorkerParameters
@@ -139,13 +138,13 @@ open class AuthWorker @AssistedInject constructor(
.getAuthToken(
Account(email, GOOGLE_ACCOUNT_TYPE),
GOOGLE_PLAY_AUTH_TOKEN_TYPE,
bundleOf(
"overridePackage" to PACKAGE_NAME_PLAY_STORE,
"overrideCertificate" to Base64.decode(
GOOGLE_PLAY_CERT,
Base64.DEFAULT
Bundle().apply {
putString("overridePackage", PACKAGE_NAME_PLAY_STORE)
putByteArray(
"overrideCertificate",
Base64.decode(GOOGLE_PLAY_CERT, Base64.DEFAULT)
)
),
},
true,
callback,
Handler(Looper.getMainLooper())

View File

@@ -10,10 +10,10 @@ import android.graphics.Bitmap
import android.graphics.Color
import android.net.Uri
import android.os.Build
import android.os.Bundle
import androidx.core.app.NotificationCompat
import androidx.core.app.PendingIntentCompat
import androidx.core.content.getSystemService
import androidx.core.os.bundleOf
import androidx.navigation.NavDeepLinkBuilder
import com.aurora.Constants
import com.aurora.store.MainActivity
@@ -213,11 +213,15 @@ object NotificationUtil {
.build()
fun getUpdateNotification(context: Context, updatesList: List<Update>): Notification {
val arguments = Bundle().apply {
putInt("destinationId", R.id.updatesFragment)
}
val contentIntent = NavDeepLinkBuilder(context)
.setGraph(R.navigation.mobile_navigation)
.setDestination(R.id.splashFragment)
.setComponentName(MainActivity::class.java)
.setArguments(bundleOf("destinationId" to R.id.updatesFragment))
.setArguments(arguments)
.createPendingIntent()
return NotificationCompat.Builder(context, Constants.NOTIFICATION_CHANNEL_UPDATES)
@@ -355,21 +359,29 @@ object NotificationUtil {
)
}
private fun getContentIntentForSplash(context: Context, packageName: String): PendingIntent =
NavDeepLinkBuilder(context)
private fun getContentIntentForSplash(context: Context, packageName: String): PendingIntent {
val arguments = Bundle().apply {
putString("packageName", packageName)
}
return NavDeepLinkBuilder(context)
.setGraph(R.navigation.mobile_navigation)
.setDestination(R.id.splashFragment)
.setComponentName(MainActivity::class.java)
.setArguments(bundleOf("packageName" to packageName))
.setArguments(arguments)
.createPendingIntent()
}
private fun getContentIntentForDetails(context: Context, packageName: String): PendingIntent =
NavDeepLinkBuilder(context)
private fun getContentIntentForDetails(context: Context, packageName: String): PendingIntent {
val arguments = Bundle().apply {
putString("packageName", packageName)
}
return NavDeepLinkBuilder(context)
.setGraph(R.navigation.mobile_navigation)
.setDestination(R.id.splashFragment)
.setComponentName(MainActivity::class.java)
.setArguments(bundleOf("packageName" to packageName))
.setArguments(arguments)
.createPendingIntent()
}
private fun getInstallIntent(context: Context, download: Download): PendingIntent? {
val intent = Intent(context, InstallActivity::class.java).apply {

View File

@@ -11,7 +11,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.os.bundleOf
import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope
@@ -203,10 +202,13 @@ abstract class BaseFlavouredSplashFragment : BaseFragment<FragmentSplashBinding>
.getAuthToken(
Account(accountName, GOOGLE_ACCOUNT_TYPE),
GOOGLE_PLAY_AUTH_TOKEN_TYPE,
bundleOf(
"overridePackage" to PACKAGE_NAME_PLAY_STORE,
"overrideCertificate" to Base64.decode(GOOGLE_PLAY_CERT, Base64.DEFAULT)
),
Bundle().apply {
putString("overridePackage", PACKAGE_NAME_PLAY_STORE)
putByteArray(
"overrideCertificate",
Base64.decode(GOOGLE_PLAY_CERT, Base64.DEFAULT)
)
},
requireActivity(),
{
viewModel.buildGoogleAuthData(