Merge "Crash happens if back button is pressed during "Format as Portable""
This commit is contained in:
@@ -36,6 +36,7 @@ import com.android.settings.R;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
public class StorageWizardFormatProgress extends StorageWizardBase {
|
public class StorageWizardFormatProgress extends StorageWizardBase {
|
||||||
private static final String TAG = "StorageWizardFormatProgress";
|
private static final String TAG = "StorageWizardFormatProgress";
|
||||||
@@ -54,6 +55,16 @@ public class StorageWizardFormatProgress extends StorageWizardBase {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setContentView(R.layout.storage_wizard_progress);
|
setContentView(R.layout.storage_wizard_progress);
|
||||||
|
|
||||||
|
// hide the navigation bar for this activity only. So that user can not press back button accidentally.
|
||||||
|
View decorView = getWindow().getDecorView();
|
||||||
|
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||||
|
decorView.setSystemUiVisibility(uiOptions);
|
||||||
|
|
||||||
|
//disable touch in activity so user can not make the hidden navigation bar visible.
|
||||||
|
getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
|
||||||
|
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
|
||||||
|
|
||||||
setKeepScreenOn(true);
|
setKeepScreenOn(true);
|
||||||
|
|
||||||
mFormatPrivate = getIntent().getBooleanExtra(EXTRA_FORMAT_PRIVATE, false);
|
mFormatPrivate = getIntent().getBooleanExtra(EXTRA_FORMAT_PRIVATE, false);
|
||||||
|
@@ -31,6 +31,8 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
public class StorageWizardMigrateProgress extends StorageWizardBase {
|
public class StorageWizardMigrateProgress extends StorageWizardBase {
|
||||||
private static final String TAG = "StorageWizardMigrateProgress";
|
private static final String TAG = "StorageWizardMigrateProgress";
|
||||||
|
|
||||||
@@ -47,6 +49,15 @@ public class StorageWizardMigrateProgress extends StorageWizardBase {
|
|||||||
}
|
}
|
||||||
setContentView(R.layout.storage_wizard_progress);
|
setContentView(R.layout.storage_wizard_progress);
|
||||||
|
|
||||||
|
// hide the navigation bar for this activity only. So that user can not press back button accidentally.
|
||||||
|
View decorView = getWindow().getDecorView();
|
||||||
|
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
|
||||||
|
decorView.setSystemUiVisibility(uiOptions);
|
||||||
|
|
||||||
|
//disable touch in activity so user can not make the hidden navigation bar visible.
|
||||||
|
getWindow().setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
|
||||||
|
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
|
||||||
|
|
||||||
mMoveId = getIntent().getIntExtra(EXTRA_MOVE_ID, -1);
|
mMoveId = getIntent().getIntExtra(EXTRA_MOVE_ID, -1);
|
||||||
|
|
||||||
setIcon(R.drawable.ic_swap_horiz);
|
setIcon(R.drawable.ic_swap_horiz);
|
||||||
|
Reference in New Issue
Block a user