File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
app/src/main/java/com/hiddenramblings/tagmo Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ open class BrowserSettings : Parcelable {
2626 companion object {
2727 fun valueOf (value : Int ): SORT {
2828 if (Version .isNougat) {
29- val optional = Arrays .stream(values ()).filter {
29+ val optional = Arrays .stream(entries.toTypedArray ()).filter {
3030 sort: SORT -> sort.value == value
3131 }.findFirst()
3232 if (optional.isPresent) return optional.get()
3333 } else {
34- for (view in values() ) {
34+ for (view in entries ) {
3535 if (view.value == value) return view
3636 }
3737 }
@@ -50,12 +50,12 @@ open class BrowserSettings : Parcelable {
5050 companion object {
5151 fun valueOf (value : Int ): VIEW {
5252 if (Version .isNougat) {
53- val optional = Arrays .stream(values ()).filter {
53+ val optional = Arrays .stream(entries.toTypedArray ()).filter {
5454 view: VIEW -> view.value == value
5555 }.findFirst()
5656 if (optional.isPresent) return optional.get()
5757 } else {
58- for (view in values() ) {
58+ for (view in entries ) {
5959 if (view.value == value) return view
6060 }
6161 }
Original file line number Diff line number Diff line change @@ -44,4 +44,8 @@ object NfcByte {
4444 val POWERTAG_WRITE = TagArray .hexToByteArray(" a000" )
4545 @JvmField
4646 val POWERTAG_SIG = TagArray .hexToByteArray(" 3c00" )
47+
48+ private fun generatePowerTagId (): ByteArray {
49+ return Foomiibo .generateRandomUID().plus(ByteArray (7 ))
50+ }
4751}
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import androidx.documentfile.provider.DocumentFile
2424import com.google.android.play.core.appupdate.AppUpdateInfo
2525import com.google.android.play.core.appupdate.AppUpdateManager
2626import com.google.android.play.core.appupdate.AppUpdateManagerFactory
27+ import com.google.android.play.core.appupdate.AppUpdateOptions
2728import com.google.android.play.core.install.model.AppUpdateType
2829import com.google.android.play.core.install.model.UpdateAvailability
2930import com.hiddenramblings.tagmo.BrowserActivity
@@ -231,9 +232,9 @@ class UpdateManager internal constructor(activity: BrowserActivity) {
231232 private fun startPlayUpdateFlow (appUpdateInfo : AppUpdateInfo ? ) {
232233 try {
233234 appUpdateManager?.startUpdateFlowForResult( // Pass the intent that is returned by 'getAppUpdateInfo()'.
234- appUpdateInfo!! , // Or 'AppUpdateType.FLEXIBLE' for flexible updates.
235- AppUpdateType . IMMEDIATE , // The current activity making the update request.
236- browserActivity, // Include a request code to later monitor this update request.
235+ appUpdateInfo!! ,
236+ browserActivity,
237+ AppUpdateOptions .defaultOptions( AppUpdateType . IMMEDIATE ),
237238 Random .nextInt()
238239 )
239240 } catch (ex: SendIntentException ) {
You can’t perform that action at this time.
0 commit comments