From 7ae20e3ce98543888cfccbef6b1254d060bc30ca Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Tue, 22 Jul 2014 15:00:50 -0700 Subject: Allow CryptKeeper dialogs to rotate on tablets Tablets may be used in docking stations thus need to support landscape mode. Phones will not be, and having them rotate is both ugly and annoying. Also this matches lock screen behavior. The attribute screenOrientation is not themeable, so the only way of doing this is programmatic. Test for truth of bool which is only set for sw600dp devices and clear the nosensor setting from the manifest if set. Bug: 16405551 Change-Id: I5b3f945b89402e5aa39642c2c06e98f9ca1ce298 --- src/com/android/settings/CryptKeeper.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/com') diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java index 0ddeb50b7..b82c02a2d 100644 --- a/src/com/android/settings/CryptKeeper.java +++ b/src/com/android/settings/CryptKeeper.java @@ -21,7 +21,9 @@ import android.app.StatusBarManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; +import android.content.res.Resources.NotFoundException; import android.media.AudioManager; import android.os.AsyncTask; import android.os.Bundle; @@ -339,6 +341,13 @@ public class CryptKeeper extends Activity implements TextView.OnEditorActionList return; } + try { + if (getResources().getBoolean(R.bool.crypt_keeper_allow_rotation)) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); + } + } catch (NotFoundException e) { + } + // Disable the status bar, but do NOT disable back because the user needs a way to go // from keyboard settings and back to the password screen. mStatusBar = (StatusBarManager) getSystemService(Context.STATUS_BAR_SERVICE); -- cgit v1.2.3