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

Commit a62e7790 authored by Colin Marsch's avatar Colin Marsch Committed by Michael Bestas
Browse files

AOSP/DeskClock - Clean up some TODOs and deprecated calls

Test: manual, tested the DeskClock UI. As well tests were ran as follows

$ source build/envsetup.sh
$ lunch aosp_sargo-userdebug
$ make DeskClock
$ adb install out/target/product/sargo/product/app/DeskClock/DeskClock.apk
$ atest DeskClockTests
$ make DeskClockJava
$ adb install out/target/product/sargo/product/app/DeskClockJava/DeskClockJava.apk
$ atest DeskClockTests

BUG: 157255731
Change-Id: I4fafbc1021102dc7da7ad592a8840a9220d320cd
parent 0cbc389d
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -176,11 +176,18 @@ public class AlarmActivity extends BaseActivity
        // Get the volume/camera button behavior setting
        mVolumeBehavior = DataModel.getDataModel().getAlarmVolumeButtonBehavior();

        if (Utils.isOOrLater()) {
            setShowWhenLocked(true);
            setTurnScreenOn(true);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
                    | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON);
        } else {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
                    | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
                    | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
                    | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
                    | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON);
        }

        // Hide navigation bar to minimize accidental tap on Home key
        hideNavigationBar();
+3 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.Context;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
import androidx.annotation.VisibleForTesting;
import android.text.format.DateFormat;
@@ -59,7 +60,8 @@ public class TextTime extends TextView {
    private int mHour;
    private int mMinute;

    private final ContentObserver mFormatChangeObserver = new ContentObserver(new Handler()) {
    private final ContentObserver mFormatChangeObserver =
            new ContentObserver(new Handler(Looper.myLooper())) {
        @Override
        public void onChange(boolean selfChange) {
            chooseFormat();