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
f0a734fd
Commit
f0a734fd
authored
May 24, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed clearing cache crashing due to operations on main thread
parent
aaabd836
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
ModuleRepository.kt
.../com/topjohnwu/magisk/data/repository/ModuleRepository.kt
+2
-1
SettingsFragment.java
...va/com/topjohnwu/magisk/ui/settings/SettingsFragment.java
+3
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/data/repository/ModuleRepository.kt
View file @
f0a734fd
...
...
@@ -12,6 +12,7 @@ import com.topjohnwu.magisk.utils.Utils
import
com.topjohnwu.magisk.utils.toSingle
import
com.topjohnwu.magisk.utils.writeToFile
import
com.topjohnwu.magisk.utils.writeToString
import
io.reactivex.Completable
import
io.reactivex.Single
class
ModuleRepository
(
...
...
@@ -59,7 +60,7 @@ class ModuleRepository(
.
fetchModuleInstaller
()
.
map
{
it
.
writeToFile
(
context
,
FILE_MODULE_INSTALLER_SH
)
}
fun
deleteAllCached
()
=
repoDao
.
deleteAll
()
fun
deleteAllCached
()
=
Completable
.
fromCallable
{
repoDao
.
deleteAll
()
}
private
fun
fetchProperties
(
module
:
String
,
lastChanged
:
Long
)
=
apiRaw
...
...
app/src/main/java/com/topjohnwu/magisk/ui/settings/SettingsFragment.java
View file @
f0a734fd
...
...
@@ -110,7 +110,9 @@ public final class SettingsFragment extends BasePreferenceFragment {
Preference
clear
=
findPreference
(
"clear"
);
clear
.
setOnPreferenceClickListener
(
pref
->
{
getPrefs
().
edit
().
remove
(
Config
.
Key
.
ETAG_KEY
).
apply
();
getModuleRepo
().
deleteAllCached
();
getModuleRepo
().
deleteAllCached
().
subscribeOn
(
Schedulers
.
io
()).
subscribe
(()
->
{
},
throwable
->
{
});
Utils
.
toast
(
R
.
string
.
repo_cache_cleared
,
Toast
.
LENGTH_SHORT
);
return
true
;
});
...
...
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