Commit 3b6bc270 authored by Mohit Mali's avatar Mohit Mali
Browse files

Implemented microG uninstall listener

parent 332350cf
Pipeline #101394 passed with stage
in 3 minutes and 5 seconds
......@@ -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
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
......@@ -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)
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment