Skip to content

Commit

Permalink
Address a few dependency API deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Jul 10, 2024
1 parent 6f872f4 commit d1c1d16
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ open class BrowserSettings : Parcelable {
companion object {
fun valueOf(value: Int): SORT {
if (Version.isNougat) {
val optional = Arrays.stream(values()).filter {
val optional = Arrays.stream(entries.toTypedArray()).filter {
sort: SORT -> sort.value == value
}.findFirst()
if (optional.isPresent) return optional.get()
} else {
for (view in values()) {
for (view in entries) {
if (view.value == value) return view
}
}
Expand All @@ -50,12 +50,12 @@ open class BrowserSettings : Parcelable {
companion object {
fun valueOf(value: Int): VIEW {
if (Version.isNougat) {
val optional = Arrays.stream(values()).filter {
val optional = Arrays.stream(entries.toTypedArray()).filter {
view: VIEW -> view.value == value
}.findFirst()
if (optional.isPresent) return optional.get()
} else {
for (view in values()) {
for (view in entries) {
if (view.value == value) return view
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ object NfcByte {
val POWERTAG_WRITE = TagArray.hexToByteArray("a000")
@JvmField
val POWERTAG_SIG = TagArray.hexToByteArray("3c00")

private fun generatePowerTagId(): ByteArray {
return Foomiibo.generateRandomUID().plus(ByteArray(7))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.documentfile.provider.DocumentFile
import com.google.android.play.core.appupdate.AppUpdateInfo
import com.google.android.play.core.appupdate.AppUpdateManager
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
import com.google.android.play.core.appupdate.AppUpdateOptions
import com.google.android.play.core.install.model.AppUpdateType
import com.google.android.play.core.install.model.UpdateAvailability
import com.hiddenramblings.tagmo.BrowserActivity
Expand Down Expand Up @@ -231,9 +232,9 @@ class UpdateManager internal constructor(activity: BrowserActivity) {
private fun startPlayUpdateFlow(appUpdateInfo: AppUpdateInfo?) {
try {
appUpdateManager?.startUpdateFlowForResult( // Pass the intent that is returned by 'getAppUpdateInfo()'.
appUpdateInfo!!, // Or 'AppUpdateType.FLEXIBLE' for flexible updates.
AppUpdateType.IMMEDIATE, // The current activity making the update request.
browserActivity, // Include a request code to later monitor this update request.
appUpdateInfo!!,
browserActivity,
AppUpdateOptions.defaultOptions(AppUpdateType.IMMEDIATE),
Random.nextInt()
)
} catch (ex: SendIntentException) {
Expand Down

0 comments on commit d1c1d16

Please sign in to comment.