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

Commit af8b810d authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Merge "Make KeyguardPresentation inherit Theme.SystemUI" into qt-dev am: 8a50bfd8

am: 936ae601

Change-Id: Ie16d61e3b0bae9c9685beefac33ceca2c60bd07e
parents 35a3cd81 936ae601
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -103,9 +103,12 @@
        <item name="android:colorControlActivated">?attr/wallpaperTextColor</item>
        <item name="android:colorControlActivated">?attr/wallpaperTextColor</item>
    </style>
    </style>


    <style name="keyguard_presentation_theme" parent="@android:style/Theme.Material.NoActionBar.Fullscreen">
    <style name="Theme.SystemUI.KeyguardPresentation">
        <item name="wallpaperTextColor">@*android:color/primary_text_material_dark</item>
        <item name="android:windowActionBar">false</item>
        <item name="wallpaperTextColorSecondary">@*android:color/secondary_text_material_dark</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:colorBackground">@*android:color/background_material_dark</item>
    </style>
    </style>


    <style name="TextAppearance.Keyguard" parent="Theme.SystemUI">
    <style name="TextAppearance.Keyguard" parent="Theme.SystemUI">
+4 −2
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManager;


import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.Dependency;
import com.android.systemui.Dependency;
import com.android.systemui.statusbar.NavigationBarController;
import com.android.systemui.statusbar.NavigationBarController;
import com.android.systemui.statusbar.phone.NavigationBarView;
import com.android.systemui.statusbar.phone.NavigationBarView;
@@ -234,7 +235,8 @@ public class KeyguardDisplayManager {


    }
    }


    private final static class KeyguardPresentation extends Presentation {
    @VisibleForTesting
    static final class KeyguardPresentation extends Presentation {
        private static final int VIDEO_SAFE_REGION = 80; // Percentage of display width & height
        private static final int VIDEO_SAFE_REGION = 80; // Percentage of display width & height
        private static final int MOVE_CLOCK_TIMEOUT = 10000; // 10s
        private static final int MOVE_CLOCK_TIMEOUT = 10000; // 10s
        private final InjectionInflationController mInjectableInflater;
        private final InjectionInflationController mInjectableInflater;
@@ -256,7 +258,7 @@ public class KeyguardDisplayManager {


        KeyguardPresentation(Context context, Display display,
        KeyguardPresentation(Context context, Display display,
                InjectionInflationController injectionInflater) {
                InjectionInflationController injectionInflater) {
            super(context, display, R.style.keyguard_presentation_theme);
            super(context, display, R.style.Theme_SystemUI_KeyguardPresentation);
            mInjectableInflater = injectionInflater;
            mInjectableInflater = injectionInflater;
            getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
            getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
            setCancelable(false);
            setCancelable(false);
+9 −8
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright (C) 2018 The Android Open Source Project
 * Copyright (C) 2019 The Android Open Source Project
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * you may not use this file except in compliance with the License.
@@ -11,18 +11,18 @@
 * distributed under the License is distributed on an "AS IS" BASIS,
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * See the License for the specific language governing permissions and
 * limitations under the License
 * limitations under the License.
 */
 */


package com.android.systemui.statusbar.phone;
package com.android.keyguard;


import android.content.Context;
import android.testing.AndroidTestingRunner;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper;
import android.view.LayoutInflater;


import androidx.test.filters.SmallTest;
import androidx.test.filters.SmallTest;


import com.android.systemui.R;
import com.android.keyguard.KeyguardDisplayManager.KeyguardPresentation;
import com.android.systemui.SystemUIFactory;
import com.android.systemui.SystemUIFactory;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.util.InjectionInflationController;
import com.android.systemui.util.InjectionInflationController;
@@ -39,8 +39,9 @@ public class KeyguardPresentationTest extends SysuiTestCase {
        com.android.systemui.util.Assert.sMainLooper = TestableLooper.get(this).getLooper();
        com.android.systemui.util.Assert.sMainLooper = TestableLooper.get(this).getLooper();
        InjectionInflationController inflationController = new InjectionInflationController(
        InjectionInflationController inflationController = new InjectionInflationController(
                SystemUIFactory.getInstance().getRootComponent());
                SystemUIFactory.getInstance().getRootComponent());
        LayoutInflater inflater = inflationController
        Context context = getContext();
                .injectable(LayoutInflater.from(getContext()));
        KeyguardPresentation keyguardPresentation =
        inflater.inflate(R.layout.keyguard_presentation, null);
                new KeyguardPresentation(context, context.getDisplay(), inflationController);
        keyguardPresentation.onCreate(null /*savedInstanceState */);
    }
    }
}
}