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 {
26
26
companion object {
27
27
fun valueOf (value : Int ): SORT {
28
28
if (Version .isNougat) {
29
- val optional = Arrays .stream(values ()).filter {
29
+ val optional = Arrays .stream(entries.toTypedArray ()).filter {
30
30
sort: SORT -> sort.value == value
31
31
}.findFirst()
32
32
if (optional.isPresent) return optional.get()
33
33
} else {
34
- for (view in values() ) {
34
+ for (view in entries ) {
35
35
if (view.value == value) return view
36
36
}
37
37
}
@@ -50,12 +50,12 @@ open class BrowserSettings : Parcelable {
50
50
companion object {
51
51
fun valueOf (value : Int ): VIEW {
52
52
if (Version .isNougat) {
53
- val optional = Arrays .stream(values ()).filter {
53
+ val optional = Arrays .stream(entries.toTypedArray ()).filter {
54
54
view: VIEW -> view.value == value
55
55
}.findFirst()
56
56
if (optional.isPresent) return optional.get()
57
57
} else {
58
- for (view in values() ) {
58
+ for (view in entries ) {
59
59
if (view.value == value) return view
60
60
}
61
61
}
Original file line number Diff line number Diff line change @@ -44,4 +44,8 @@ object NfcByte {
44
44
val POWERTAG_WRITE = TagArray .hexToByteArray(" a000" )
45
45
@JvmField
46
46
val POWERTAG_SIG = TagArray .hexToByteArray(" 3c00" )
47
+
48
+ private fun generatePowerTagId (): ByteArray {
49
+ return Foomiibo .generateRandomUID().plus(ByteArray (7 ))
50
+ }
47
51
}
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import androidx.documentfile.provider.DocumentFile
24
24
import com.google.android.play.core.appupdate.AppUpdateInfo
25
25
import com.google.android.play.core.appupdate.AppUpdateManager
26
26
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
27
+ import com.google.android.play.core.appupdate.AppUpdateOptions
27
28
import com.google.android.play.core.install.model.AppUpdateType
28
29
import com.google.android.play.core.install.model.UpdateAvailability
29
30
import com.hiddenramblings.tagmo.BrowserActivity
@@ -231,9 +232,9 @@ class UpdateManager internal constructor(activity: BrowserActivity) {
231
232
private fun startPlayUpdateFlow (appUpdateInfo : AppUpdateInfo ? ) {
232
233
try {
233
234
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 ),
237
238
Random .nextInt()
238
239
)
239
240
} catch (ex: SendIntentException ) {
You can’t perform that action at this time.
0 commit comments