summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/CryptKeeper.java
diff options
context:
space:
mode:
authorPaul Lawrence <paullawrence@google.com>2014-07-22 15:00:50 -0700
committerPaul Lawrence <paullawrence@google.com>2014-07-23 14:39:31 +0000
commit7ae20e3ce98543888cfccbef6b1254d060bc30ca (patch)
treee31d1650f7796cb3c6e00751921475290deedcf1 /src/com/android/settings/CryptKeeper.java
parent59c3da2367bad63efd71753b4d1ad88f2298ddc6 (diff)
downloadpackages_apps_Settings-7ae20e3ce98543888cfccbef6b1254d060bc30ca.zip
packages_apps_Settings-7ae20e3ce98543888cfccbef6b1254d060bc30ca.tar.gz
packages_apps_Settings-7ae20e3ce98543888cfccbef6b1254d060bc30ca.tar.bz2
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
Diffstat (limited to 'src/com/android/settings/CryptKeeper.java')
-rw-r--r--src/com/android/settings/CryptKeeper.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 0ddeb50..b82c02a 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);