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

View File

@@ -10,10 +10,10 @@ import android.graphics.Bitmap
import android.graphics.Color import android.graphics.Color
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import android.os.Bundle
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.app.PendingIntentCompat import androidx.core.app.PendingIntentCompat
import androidx.core.content.getSystemService import androidx.core.content.getSystemService
import androidx.core.os.bundleOf
import androidx.navigation.NavDeepLinkBuilder import androidx.navigation.NavDeepLinkBuilder
import com.aurora.Constants import com.aurora.Constants
import com.aurora.store.MainActivity import com.aurora.store.MainActivity
@@ -213,11 +213,15 @@ object NotificationUtil {
.build() .build()
fun getUpdateNotification(context: Context, updatesList: List<Update>): Notification { fun getUpdateNotification(context: Context, updatesList: List<Update>): Notification {
val arguments = Bundle().apply {
putInt("destinationId", R.id.updatesFragment)
}
val contentIntent = NavDeepLinkBuilder(context) val contentIntent = NavDeepLinkBuilder(context)
.setGraph(R.navigation.mobile_navigation) .setGraph(R.navigation.mobile_navigation)
.setDestination(R.id.splashFragment) .setDestination(R.id.splashFragment)
.setComponentName(MainActivity::class.java) .setComponentName(MainActivity::class.java)
.setArguments(bundleOf("destinationId" to R.id.updatesFragment)) .setArguments(arguments)
.createPendingIntent() .createPendingIntent()
return NotificationCompat.Builder(context, Constants.NOTIFICATION_CHANNEL_UPDATES) return NotificationCompat.Builder(context, Constants.NOTIFICATION_CHANNEL_UPDATES)
@@ -355,21 +359,29 @@ object NotificationUtil {
) )
} }
private fun getContentIntentForSplash(context: Context, packageName: String): PendingIntent = private fun getContentIntentForSplash(context: Context, packageName: String): PendingIntent {
NavDeepLinkBuilder(context) val arguments = Bundle().apply {
putString("packageName", packageName)
}
return NavDeepLinkBuilder(context)
.setGraph(R.navigation.mobile_navigation) .setGraph(R.navigation.mobile_navigation)
.setDestination(R.id.splashFragment) .setDestination(R.id.splashFragment)
.setComponentName(MainActivity::class.java) .setComponentName(MainActivity::class.java)
.setArguments(bundleOf("packageName" to packageName)) .setArguments(arguments)
.createPendingIntent() .createPendingIntent()
}
private fun getContentIntentForDetails(context: Context, packageName: String): PendingIntent = private fun getContentIntentForDetails(context: Context, packageName: String): PendingIntent {
NavDeepLinkBuilder(context) val arguments = Bundle().apply {
putString("packageName", packageName)
}
return NavDeepLinkBuilder(context)
.setGraph(R.navigation.mobile_navigation) .setGraph(R.navigation.mobile_navigation)
.setDestination(R.id.splashFragment) .setDestination(R.id.splashFragment)
.setComponentName(MainActivity::class.java) .setComponentName(MainActivity::class.java)
.setArguments(bundleOf("packageName" to packageName)) .setArguments(arguments)
.createPendingIntent() .createPendingIntent()
}
private fun getInstallIntent(context: Context, download: Download): PendingIntent? { private fun getInstallIntent(context: Context, download: Download): PendingIntent? {
val intent = Intent(context, InstallActivity::class.java).apply { 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.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.core.os.bundleOf
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
@@ -203,10 +202,13 @@ abstract class BaseFlavouredSplashFragment : BaseFragment<FragmentSplashBinding>
.getAuthToken( .getAuthToken(
Account(accountName, GOOGLE_ACCOUNT_TYPE), Account(accountName, GOOGLE_ACCOUNT_TYPE),
GOOGLE_PLAY_AUTH_TOKEN_TYPE, GOOGLE_PLAY_AUTH_TOKEN_TYPE,
bundleOf( Bundle().apply {
"overridePackage" to PACKAGE_NAME_PLAY_STORE, putString("overridePackage", PACKAGE_NAME_PLAY_STORE)
"overrideCertificate" to Base64.decode(GOOGLE_PLAY_CERT, Base64.DEFAULT) putByteArray(
), "overrideCertificate",
Base64.decode(GOOGLE_PLAY_CERT, Base64.DEFAULT)
)
},
requireActivity(), requireActivity(),
{ {
viewModel.buildGoogleAuthData( viewModel.buildGoogleAuthData(