diff options
author | Ankit Gupta <agupta@cyngn.com> | 2016-06-27 17:00:51 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-07-25 22:31:18 -0700 |
commit | f17d6eff0b78c9936f4d47caf58ccee2c6e1737d (patch) | |
tree | 05437ee4514351a49bdde8d30f0afd5fc18a8f62 | |
parent | 21af6a75b6d95fdbc1b8b06cbf749bbc71d2989f (diff) | |
download | android_packages_apps_DeskClock-f17d6eff0b78c9936f4d47caf58ccee2c6e1737d.tar.gz android_packages_apps_DeskClock-f17d6eff0b78c9936f4d47caf58ccee2c6e1737d.tar.bz2 android_packages_apps_DeskClock-f17d6eff0b78c9936f4d47caf58ccee2c6e1737d.zip |
Timer: Do not rotate Alert timer
Rotation of alert time on allows pop up of
lock screen in between. Keeping the configuration to
default prevents this happening.
Same issue has been fixed for AlarmActivity here:
ab0d28c68a77bea2a4a2ee50378da3670a1dd939
Issue-id: FEIJ-1413
Change-Id: I0eb4d7879745267e91d38626df1abf1db09bb604
-rw-r--r-- | res/values/config.xml | 1 | ||||
-rw-r--r-- | src/com/android/deskclock/timer/TimerAlertFullScreen.java | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/res/values/config.xml b/res/values/config.xml index 9187cc5a0..b7ef0fda1 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -23,6 +23,7 @@ <bool name="config_requiresScreenSaver">true</bool> <bool name="config_dockAppEnabled">true</bool> <bool name="config_rotateAlarmAlert">false</bool> + <bool name="config_rotateTimerAlert">false</bool> <!-- Default action for flip (turn face down) during alarm 0 means no action, 1 means snooze 2 means dismiss. --> diff --git a/src/com/android/deskclock/timer/TimerAlertFullScreen.java b/src/com/android/deskclock/timer/TimerAlertFullScreen.java index db6edfca3..13025e5a6 100644 --- a/src/com/android/deskclock/timer/TimerAlertFullScreen.java +++ b/src/com/android/deskclock/timer/TimerAlertFullScreen.java @@ -23,6 +23,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; +import android.content.pm.ActivityInfo; import com.android.deskclock.BaseActivity; import com.android.deskclock.R; @@ -71,6 +72,16 @@ public class TimerAlertFullScreen extends BaseActivity implements OnEmptyListLis getFragmentManager().beginTransaction() .add(R.id.fragment_container, timerFragment, FRAGMENT).commit(); } + // Following issue was found on Alarm and same can be applied on timer: + // In order to allow tablets to freely rotate and phones to stick + // with "nosensor" (use default device orientation) we have to have + // the manifest start with an orientation of unspecified" and only limit + // to "nosensor" for phones. Otherwise we get behavior like in b/8728671 + // where tablets start off in their default orientation and then are + // able to freely rotate. + if (!getResources().getBoolean(R.bool.config_rotateTimerAlert)) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR); + } } @Override |