Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
App Lounge
Commits
3b6bc270
Commit
3b6bc270
authored
Feb 12, 2021
by
Mohit Mali
Browse files
Implemented microG uninstall listener
parent
332350cf
Pipeline
#101394
passed with stage
in 3 minutes and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/AndroidManifest.xml
View file @
3b6bc270
...
...
@@ -68,6 +68,13 @@
android:launchMode=
"singleInstance"
android:theme=
"@style/AppTheme1"
android:windowSoftInputMode=
"adjustResize"
/>
<receiver
android:name=
".MicrogUninstallListener"
android:enabled=
"true"
android:exported=
"true"
>
<intent-filter>
<action
android:name=
"foundation.e.apps"
/>
</intent-filter>
</receiver>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/foundation/e/apps/MicrogUninstallListener.kt
0 → 100644
View file @
3b6bc270
package
foundation.e.apps
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.util.Log
import
foundation.e.apps.utils.PreferenceStorage
class
MicrogUninstallListener
:
BroadcastReceiver
()
{
override
fun
onReceive
(
context
:
Context
,
intent
:
Intent
)
{
PreferenceStorage
(
context
).
save
(
context
.
getString
(
R
.
string
.
prefs_microg_vrsn_installed
),
false
)
}
}
\ No newline at end of file
app/src/main/java/foundation/e/apps/application/model/Installer.kt
View file @
3b6bc270
...
...
@@ -132,7 +132,6 @@ class Installer(private val packageName: String,
}
context
.
registerReceiver
(
receiver
,
IntentFilter
().
apply
{
addAction
(
Intent
.
ACTION_PACKAGE_ADDED
)
addAction
(
Intent
.
ACTION_PACKAGE_REMOVED
)
addDataScheme
(
"package"
)
})
}
...
...
@@ -149,12 +148,7 @@ class Installer(private val packageName: String,
callback
.
onInstallationComplete
(
context
)
if
(
packageName
==
Constants
.
MICROG_PACKAGE
)
{
if
(
PreferenceStorage
(
context
).
getBoolean
(
context
.
getString
(
R
.
string
.
prefs_microg_vrsn_installed
),
false
)){
PreferenceStorage
(
context
).
save
(
context
.
getString
(
R
.
string
.
prefs_microg_vrsn_installed
),
false
)
}
else
{
PreferenceStorage
(
context
).
save
(
context
.
getString
(
R
.
string
.
prefs_microg_vrsn_installed
),
true
)
}
}
}
}
...
...
Write
Preview
Supports
Markdown
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