Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grayjay
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoStreaming
Grayjay
Commits
11b89146
Commit
11b89146
authored
1 year ago
by
Koen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed polycentric disable fallback.
parent
e45c8617
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/com/futo/platformplayer/states/StatePolycentric.kt
+14
-7
14 additions, 7 deletions
...n/java/com/futo/platformplayer/states/StatePolycentric.kt
dep/polycentricandroid
+1
-1
1 addition, 1 deletion
dep/polycentricandroid
with
15 additions
and
8 deletions
app/src/main/java/com/futo/platformplayer/states/StatePolycentric.kt
+
14
−
7
View file @
11b89146
...
...
@@ -34,13 +34,11 @@ import kotlinx.coroutines.Deferred
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.async
import
kotlinx.coroutines.runBlocking
import
kotlinx.coroutines.withContext
import
userpackage.Protocol
import
java.lang.Exception
import
java.lang.Thread.State
import
java.time.Instant
import
java.time.OffsetDateTime
import
java.time.ZoneOffset
import
kotlin.Exception
class
StatePolycentric
{
private
data class
LikeDislikeEntry
(
val
unixMilliseconds
:
Long
,
val
hasLiked
:
Boolean
,
val
hasDisliked
:
Boolean
);
...
...
@@ -49,7 +47,7 @@ class StatePolycentric {
private
var
_likeDislikeMap
=
hashMapOf
<
String
,
LikeDislikeEntry
>()
private
val
_activeProcessHandle
=
FragmentedStorage
.
get
<
StringStorage
>(
"activeProcessHandle"
);
private
var
_transientEnabled
=
true
val
enabled
=
_transientEnabled
&&
Settings
.
instance
.
other
.
polycentricEnabled
val
enabled
get
()
=
_transientEnabled
&&
Settings
.
instance
.
other
.
polycentricEnabled
fun
load
(
context
:
Context
)
{
if
(!
enabled
)
{
...
...
@@ -62,12 +60,21 @@ class StatePolycentric {
val
activeProcessHandleString
=
_activeProcessHandle
.
value
;
if
(
activeProcessHandleString
.
isNotEmpty
())
{
val
system
=
PublicKey
.
fromProto
(
Protocol
.
PublicKey
.
parseFrom
(
activeProcessHandleString
.
base64ToByteArray
()));
setProcessHandle
(
Store
.
instance
.
getProcessSecret
(
system
)
?.
toProcessHandle
());
try
{
val
system
=
PublicKey
.
fromProto
(
Protocol
.
PublicKey
.
parseFrom
(
activeProcessHandleString
.
base64ToByteArray
()));
setProcessHandle
(
Store
.
instance
.
getProcessSecret
(
system
)
?.
toProcessHandle
());
}
catch
(
e
:
Throwable
)
{
db
.
upgradeOldSecrets
(
db
.
writableDatabase
);
val
system
=
PublicKey
.
fromProto
(
Protocol
.
PublicKey
.
parseFrom
(
activeProcessHandleString
.
base64ToByteArray
()));
setProcessHandle
(
Store
.
instance
.
getProcessSecret
(
system
)
?.
toProcessHandle
());
Log
.
i
(
TAG
,
"Failed to initialize Polycentric."
,
e
)
}
}
}
catch
(
e
:
Throwable
)
{
_transientEnabled
=
false
UIDialogs
.
toast
(
context
,
"Polycentric f
ailed to initialize
due to an error."
)
UIDialogs
.
showGeneralErrorDialog
(
context
,
"F
ailed to initialize
Polycentric."
,
e
);
Log
.
i
(
TAG
,
"Failed to initialize Polycentric."
,
e
)
}
}
...
...
This diff is collapsed.
Click to expand it.
polycentricandroid
@
62328514
Compare
faaa7a6d
...
62328514
Subproject commit
faaa7a6d8efb3f92fc239e7d77ec2f9a46c3a958
Subproject commit
62328514ec1dae52b8cc966561f73b81d7ebed80
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment