Loading packages/SystemUI/res/layout/idle_host_view.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <com.android.systemui.idle.IdleHostView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/idle_host_view" android:layout_width="match_parent" android:layout_height="match_parent"/> packages/SystemUI/res/layout/status_bar_expanded.xml +6 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,11 @@ layout="@layout/keyguard_status_view" android:visibility="gone"/> <include layout="@layout/idle_host_view" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone"/> <include layout="@layout/dock_info_overlay"/> <FrameLayout Loading packages/SystemUI/res/values/config.xml +7 −0 Original line number Diff line number Diff line Loading @@ -684,4 +684,11 @@ <!-- Component name of communal source service --> <string name="config_communalSourceComponent" translatable="false">@null</string> <!-- Whether idle mode should be enabled. When enabled, the lock screen will timeout to an idle screen on inactivity. --> <bool name="config_enableIdleMode">false</bool> <!-- Timeout to idle mode duration in milliseconds. --> <integer name="config_idleModeTimeout">10000</integer> </resources> packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java +20 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,32 @@ package com.android.systemui.communal.dagger; import android.content.Context; import android.view.View; import android.widget.FrameLayout; import com.android.systemui.idle.dagger.IdleViewComponent; import javax.inject.Named; import dagger.Module; import dagger.Provides; /** * Dagger Module providing Communal-related functionality. */ @Module(subcomponents = { CommunalViewComponent.class, IdleViewComponent.class, }) public class CommunalModule { public interface CommunalModule { String IDLE_VIEW = "idle_view"; /** */ @Provides @Named(IDLE_VIEW) static View provideIdleView(Context context) { FrameLayout view = new FrameLayout(context); return view; } } packages/SystemUI/src/com/android/systemui/idle/IdleHostView.java 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.idle; import android.content.Context; import android.util.AttributeSet; import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; /** * {@link IdleHostView} houses a surface to be displayed when the device idle. */ public class IdleHostView extends FrameLayout { public IdleHostView(@NonNull Context context) { this(context, null); } public IdleHostView(@NonNull Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } public IdleHostView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } } Loading
packages/SystemUI/res/layout/idle_host_view.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 The Android Open Source Project ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <com.android.systemui.idle.IdleHostView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/idle_host_view" android:layout_width="match_parent" android:layout_height="match_parent"/>
packages/SystemUI/res/layout/status_bar_expanded.xml +6 −1 Original line number Diff line number Diff line Loading @@ -73,6 +73,11 @@ layout="@layout/keyguard_status_view" android:visibility="gone"/> <include layout="@layout/idle_host_view" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone"/> <include layout="@layout/dock_info_overlay"/> <FrameLayout Loading
packages/SystemUI/res/values/config.xml +7 −0 Original line number Diff line number Diff line Loading @@ -684,4 +684,11 @@ <!-- Component name of communal source service --> <string name="config_communalSourceComponent" translatable="false">@null</string> <!-- Whether idle mode should be enabled. When enabled, the lock screen will timeout to an idle screen on inactivity. --> <bool name="config_enableIdleMode">false</bool> <!-- Timeout to idle mode duration in milliseconds. --> <integer name="config_idleModeTimeout">10000</integer> </resources>
packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java +20 −1 Original line number Diff line number Diff line Loading @@ -16,13 +16,32 @@ package com.android.systemui.communal.dagger; import android.content.Context; import android.view.View; import android.widget.FrameLayout; import com.android.systemui.idle.dagger.IdleViewComponent; import javax.inject.Named; import dagger.Module; import dagger.Provides; /** * Dagger Module providing Communal-related functionality. */ @Module(subcomponents = { CommunalViewComponent.class, IdleViewComponent.class, }) public class CommunalModule { public interface CommunalModule { String IDLE_VIEW = "idle_view"; /** */ @Provides @Named(IDLE_VIEW) static View provideIdleView(Context context) { FrameLayout view = new FrameLayout(context); return view; } }
packages/SystemUI/src/com/android/systemui/idle/IdleHostView.java 0 → 100644 +42 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.idle; import android.content.Context; import android.util.AttributeSet; import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; /** * {@link IdleHostView} houses a surface to be displayed when the device idle. */ public class IdleHostView extends FrameLayout { public IdleHostView(@NonNull Context context) { this(context, null); } public IdleHostView(@NonNull Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } public IdleHostView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } }