Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
cffd024e
Commit
cffd024e
authored
Apr 26, 2022
by
vvb2060
Committed by
John Wu
May 06, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore the response until showDialog done
parent
8c858592
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
SuRequestViewModel.kt
...a/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt
+10
-3
No files found.
app/src/main/java/com/topjohnwu/magisk/ui/surequest/SuRequestViewModel.kt
View file @
cffd024e
...
...
@@ -73,7 +73,8 @@ class SuRequestViewModel(
val
itemBinding
=
ItemBinding
.
of
<
String
>(
BR
.
item
,
R
.
layout
.
item_spinner
)
private
val
handler
=
SuRequestHandler
(
AppContext
.
packageManager
,
policyDB
)
private
var
timer
:
CountDownTimer
?
=
null
private
lateinit
var
timer
:
CountDownTimer
private
var
initialized
=
false
fun
grantPressed
()
{
cancelTimer
()
...
...
@@ -122,10 +123,16 @@ class SuRequestViewModel(
// Actually show the UI
ShowUIEvent
(
if
(
Config
.
suTapjack
)
EmptyAccessibilityDelegate
else
null
).
publish
()
initialized
=
true
}
private
fun
respond
(
action
:
Int
)
{
timer
?.
cancel
()
if
(!
initialized
)
{
// ignore the response until showDialog done
return
}
timer
.
cancel
()
val
pos
=
selectedItemPosition
timeoutPrefs
.
edit
().
putInt
(
handler
.
pkgInfo
.
packageName
,
pos
).
apply
()
...
...
@@ -138,7 +145,7 @@ class SuRequestViewModel(
}
private
fun
cancelTimer
()
{
timer
?
.
cancel
()
timer
.
cancel
()
denyText
.
seconds
=
0
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment