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

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

AOSP/DeskClock - Upgrade Handler inits to use undeprecated constructor

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: I85888a5c511a277cfb17f8a3e431ec5b11ea6bd8
parent 676ae03d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.res.Configuration;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
import android.service.dreams.DreamService;
import android.view.View;
@@ -51,7 +52,7 @@ public final class Screensaver extends DreamService {

    /* Register ContentObserver to see alarm changes for pre-L */
    private final ContentObserver mSettingsContentObserver =
            Utils.isLOrLater() ? null : new ContentObserver(new Handler()) {
            Utils.isLOrLater() ? null : new ContentObserver(new Handler(Looper.myLooper())) {
                @Override
                public void onChange(boolean selfChange) {
                    Utils.refreshAlarm(Screensaver.this, mContentView);
+2 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.database.ContentObserver;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
import android.view.View;
import android.view.ViewTreeObserver.OnPreDrawListener;
@@ -74,7 +75,7 @@ public class ScreensaverActivity extends BaseActivity {

    /* Register ContentObserver to see alarm changes for pre-L */
    private final ContentObserver mSettingsContentObserver = Utils.isPreL()
        ? new ContentObserver(new Handler()) {
        ? new ContentObserver(new Handler(Looper.myLooper())) {
            @Override
            public void onChange(boolean selfChange) {
                Utils.refreshAlarm(ScreensaverActivity.this, mContentView);
+5 −4
Original line number Diff line number Diff line
@@ -37,9 +37,7 @@ import android.media.AudioManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import androidx.annotation.NonNull;
import androidx.core.graphics.ColorUtils;
import androidx.core.view.animation.PathInterpolatorCompat;
import android.os.Looper;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
@@ -49,6 +47,9 @@ import android.view.accessibility.AccessibilityManager;
import android.widget.ImageView;
import android.widget.TextClock;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.graphics.ColorUtils;
import androidx.core.view.animation.PathInterpolatorCompat;

import com.android.deskclock.AnimatorUtils;
import com.android.deskclock.BaseActivity;
@@ -85,7 +86,7 @@ public class AlarmActivity extends BaseActivity
    private static final float BUTTON_SCALE_DEFAULT = 0.7f;
    private static final int BUTTON_DRAWABLE_ALPHA_DEFAULT = 165;

    private final Handler mHandler = new Handler();
    private final Handler mHandler = new Handler(Looper.myLooper());
    private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
+2 −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 com.android.deskclock.data.DataModel.AlarmVolumeButtonBehavior;
@@ -85,7 +86,7 @@ final class AlarmModel {
    private final class SystemAlarmAlertChangeObserver extends ContentObserver {

        private SystemAlarmAlertChangeObserver() {
            super(new Handler());
            super(new Handler(Looper.myLooper()));
        }

        @Override
+2 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.media.Ringtone;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -206,7 +207,7 @@ final class RingtoneModel {
    private final class SystemAlarmAlertChangeObserver extends ContentObserver {

        private SystemAlarmAlertChangeObserver() {
            super(new Handler());
            super(new Handler(Looper.myLooper()));
        }

        @Override
Loading