Display toast for clone app creation and completion in App Info page.
Bug: 271990959 Test: manual Change-Id: I93641c1bf675ac531fbf8201203d5141aafd39cc
This commit is contained in:
@@ -32,6 +32,7 @@ import com.android.settingslib.spa.widget.button.ActionButton
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import android.widget.Toast;
|
||||
|
||||
class AppCreateButton(packageInfoPresenter: PackageInfoPresenter) {
|
||||
private val context = packageInfoPresenter.context
|
||||
@@ -55,10 +56,16 @@ class AppCreateButton(packageInfoPresenter: PackageInfoPresenter) {
|
||||
val cloneBackend = CloneBackend.getInstance(context)
|
||||
FeatureFactory.getFactory(context).metricsFeatureProvider.action(context,
|
||||
SettingsEnums.ACTION_CREATE_CLONE_APP)
|
||||
val appLabel = app.loadLabel(context.packageManager)
|
||||
Toast.makeText(context, context.getString(R.string.cloned_app_creation_toast_summary,
|
||||
appLabel),Toast.LENGTH_SHORT).show()
|
||||
coroutineScope.launch {
|
||||
enabledState.value = false
|
||||
val result = installCloneApp(app, cloneBackend)
|
||||
if (result == CloneBackend.SUCCESS) {
|
||||
Toast.makeText(context,
|
||||
context.getString(R.string.cloned_app_created_toast_summary, appLabel),
|
||||
Toast.LENGTH_SHORT).show()
|
||||
navController.navigate(getRoute(app.packageName, cloneBackend.cloneUserId),
|
||||
/* popUpCurrent*/ true)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user