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
00f4242f
Commit
00f4242f
authored
Jan 21, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remember user selection of su timeout
Close #535
parent
f6a45106
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
SuRequestActivity.java
...src/full/java/com/topjohnwu/magisk/SuRequestActivity.java
+7
-1
No files found.
app/src/full/java/com/topjohnwu/magisk/SuRequestActivity.java
View file @
00f4242f
package
com
.
topjohnwu
.
magisk
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.pm.PackageManager
;
import
android.hardware.fingerprint.FingerprintManager
;
import
android.os.Bundle
;
...
...
@@ -42,6 +43,7 @@ public class SuRequestActivity extends BaseActivity {
private
Policy
policy
;
private
CountDownTimer
timer
;
private
FingerprintHelper
fingerprintHelper
;
private
SharedPreferences
timeoutPrefs
;
@Override
public
int
getDarkTheme
()
{
...
...
@@ -73,6 +75,7 @@ public class SuRequestActivity extends BaseActivity {
PackageManager
pm
=
getPackageManager
();
app
.
mDB
.
clearOutdated
();
timeoutPrefs
=
getSharedPreferences
(
"su_timeout"
,
0
);
// Get policy
Intent
intent
=
getIntent
();
...
...
@@ -132,6 +135,7 @@ public class SuRequestActivity extends BaseActivity {
R
.
array
.
allow_timeout
,
android
.
R
.
layout
.
simple_spinner_item
);
adapter
.
setDropDownViewResource
(
android
.
R
.
layout
.
simple_spinner_dropdown_item
);
timeout
.
setAdapter
(
adapter
);
timeout
.
setSelection
(
timeoutPrefs
.
getInt
(
policy
.
packageName
,
0
));
timer
=
new
CountDownTimer
((
int
)
Config
.
get
(
Config
.
Key
.
SU_REQUEST_TIMEOUT
)
*
1000
,
1000
)
{
@Override
...
...
@@ -209,7 +213,9 @@ public class SuRequestActivity extends BaseActivity {
}
private
void
handleAction
(
int
action
)
{
handleAction
(
action
,
Config
.
Value
.
TIMEOUT_LIST
[
timeout
.
getSelectedItemPosition
()]);
int
pos
=
timeout
.
getSelectedItemPosition
();
timeoutPrefs
.
edit
().
putInt
(
policy
.
packageName
,
pos
).
apply
();
handleAction
(
action
,
Config
.
Value
.
TIMEOUT_LIST
[
pos
]);
}
private
void
handleAction
(
int
action
,
int
time
)
{
...
...
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