Show preview when changing user icon

Refresh activate status when ownership transferred to OwnDroid
Set Start user session message and End user session message separately
Set Long support message and Short support message separately
Simplify code
This commit is contained in:
BinTianqi
2024-09-28 10:45:48 +08:00
parent 47a965e6c0
commit 0788634049
13 changed files with 180 additions and 143 deletions

View File

@@ -18,6 +18,7 @@ import android.content.pm.PackageInstaller.STATUS_FAILURE_TIMEOUT
import android.content.pm.PackageInstaller.STATUS_PENDING_USER_ACTION
import android.content.pm.PackageInstaller.STATUS_SUCCESS
import android.os.Build.VERSION
import android.os.PersistableBundle
import android.util.Log
import android.widget.Toast
import com.bintianqi.owndroid.dpm.getDPM
@@ -68,6 +69,13 @@ class Receiver : DeviceAdminReceiver() {
handleSecurityLogs(context)
}
}
override fun onTransferOwnershipComplete(context: Context, bundle: PersistableBundle?) {
super.onTransferOwnershipComplete(context, bundle)
val sp = context.getSharedPreferences("data", Context.MODE_PRIVATE)
sp.edit().putBoolean("dhizuku", false).apply()
context.toggleInstallAppActivity()
}
}
val installAppDone = MutableStateFlow(false)