Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 828005b9 authored by Ankit Gupta's avatar Ankit Gupta Committed by Howard M. Harte
Browse files

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:
ab0d28c6

Issue-id: FEIJ-1413
Change-Id: I0eb4d7879745267e91d38626df1abf1db09bb604
parent 50d8860b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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>
    <item type="integer" name="timer_column_count">1</item>
    <!-- Number of world clocks in a row, for the clock tab. -->
    <item type="integer" name="world_clocks_per_row">1</item>
+11 −0
Original line number Diff line number Diff line
@@ -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