Loading packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/AuthControllerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -923,14 +923,14 @@ public class AuthControllerTest extends SysuiTestCase { doReturn(500).when(mResources) .getDimensionPixelSize(eq(com.android.systemui.res.R.dimen .physical_fingerprint_sensor_center_screen_location_y)); mAuthController.onConfigurationChanged(null /* newConfig */); mAuthController.onConfigChanged(null /* newConfig */); final Point firstFpLocation = mAuthController.getFingerprintSensorLocation(); doReturn(1000).when(mResources) .getDimensionPixelSize(eq(com.android.systemui.res.R.dimen .physical_fingerprint_sensor_center_screen_location_y)); mAuthController.onConfigurationChanged(null /* newConfig */); mAuthController.onConfigChanged(null /* newConfig */); assertNotSame(firstFpLocation, mAuthController.getFingerprintSensorLocation()); } Loading packages/SystemUI/src/com/android/systemui/CoreStartable.java +0 −9 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui; import android.content.res.Configuration; import androidx.annotation.NonNull; import java.io.PrintWriter; Loading @@ -42,13 +40,6 @@ public interface CoreStartable extends Dumpable { /** Main entry point for implementations. Called shortly after SysUI startup. */ void start(); /** Called when the device configuration changes. This will not be called before * {@link #start()}, but it could be called before {@link #onBootCompleted()}. * * @see android.app.Application#onConfigurationChanged(Configuration) */ default void onConfigurationChanged(Configuration newConfig) { } @Override default void dump(@NonNull PrintWriter pw, @NonNull String[] args) { } Loading packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +5 −3 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ import com.android.systemui.settings.DisplayTracker; import com.android.systemui.settings.UserTracker; import com.android.systemui.statusbar.commandline.CommandRegistry; import com.android.systemui.statusbar.events.PrivacyDotViewController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.util.concurrency.DelayableExecutor; import com.android.systemui.util.concurrency.ThreadFactory; import com.android.systemui.util.settings.SecureSettings; Loading @@ -109,7 +110,8 @@ import javax.inject.Inject; * for antialiasing and emulation purposes. */ @SysUISingleton public class ScreenDecorations implements CoreStartable, Dumpable { public class ScreenDecorations implements CoreStartable, ConfigurationController.ConfigurationListener, Dumpable { private static final boolean DEBUG_LOGGING = false; private static final String TAG = "ScreenDecorations"; Loading Loading @@ -575,7 +577,7 @@ public class ScreenDecorations implements CoreStartable, Dumpable { if (mPendingManualConfigUpdate) { mPendingManualConfigUpdate = false; onConfigurationChanged(mContext.getResources().getConfiguration()); onConfigChanged(mContext.getResources().getConfiguration()); } } } Loading Loading @@ -1062,7 +1064,7 @@ public class ScreenDecorations implements CoreStartable, Dumpable { } @Override public void onConfigurationChanged(Configuration newConfig) { public void onConfigChanged(Configuration newConfig) { if (DEBUG_DISABLE_SCREEN_DECORATIONS) { Log.i(TAG, "ScreenDecorations is disabled"); return; Loading packages/SystemUI/src/com/android/systemui/ScreenDecorationsModule.kt 0 → 100644 +38 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 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 import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener import dagger.Binds import dagger.Module import dagger.multibindings.ClassKey import dagger.multibindings.IntoMap import dagger.multibindings.IntoSet @Module interface ScreenDecorationsModule { /** Start ScreenDecorations. */ @Binds @IntoMap @ClassKey(ScreenDecorations::class) fun bindScreenDecorationsCoreStartable(impl: ScreenDecorations): CoreStartable /** Listen to config changes for ScreenDecorations. */ @Binds @IntoSet fun bindScreenDecorationsConfigListener(impl: ScreenDecorations): ConfigurationListener } packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +1 −14 Original line number Diff line number Diff line Loading @@ -37,11 +37,11 @@ import android.view.SurfaceControl; import android.view.ThreadedRenderer; import android.view.View; import com.android.systemui.res.R; import com.android.internal.protolog.common.ProtoLog; import com.android.systemui.dagger.GlobalRootComponent; import com.android.systemui.dagger.SysUIComponent; import com.android.systemui.dump.DumpManager; import com.android.systemui.res.R; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.util.NotificationChannels; Loading Loading @@ -354,19 +354,6 @@ public class SystemUIApplication extends Application implements } configController.onConfigurationChanged(newConfig); Trace.endSection(); int len = mServices.length; for (int i = 0; i < len; i++) { if (mServices[i] != null) { if (Trace.isEnabled()) { Trace.traceBegin( Trace.TRACE_TAG_APP, mServices[i].getClass().getSimpleName() + ".onConfigurationChanged()"); } mServices[i].onConfigurationChanged(newConfig); Trace.endSection(); } } } } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/biometrics/AuthControllerTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -923,14 +923,14 @@ public class AuthControllerTest extends SysuiTestCase { doReturn(500).when(mResources) .getDimensionPixelSize(eq(com.android.systemui.res.R.dimen .physical_fingerprint_sensor_center_screen_location_y)); mAuthController.onConfigurationChanged(null /* newConfig */); mAuthController.onConfigChanged(null /* newConfig */); final Point firstFpLocation = mAuthController.getFingerprintSensorLocation(); doReturn(1000).when(mResources) .getDimensionPixelSize(eq(com.android.systemui.res.R.dimen .physical_fingerprint_sensor_center_screen_location_y)); mAuthController.onConfigurationChanged(null /* newConfig */); mAuthController.onConfigChanged(null /* newConfig */); assertNotSame(firstFpLocation, mAuthController.getFingerprintSensorLocation()); } Loading
packages/SystemUI/src/com/android/systemui/CoreStartable.java +0 −9 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.systemui; import android.content.res.Configuration; import androidx.annotation.NonNull; import java.io.PrintWriter; Loading @@ -42,13 +40,6 @@ public interface CoreStartable extends Dumpable { /** Main entry point for implementations. Called shortly after SysUI startup. */ void start(); /** Called when the device configuration changes. This will not be called before * {@link #start()}, but it could be called before {@link #onBootCompleted()}. * * @see android.app.Application#onConfigurationChanged(Configuration) */ default void onConfigurationChanged(Configuration newConfig) { } @Override default void dump(@NonNull PrintWriter pw, @NonNull String[] args) { } Loading
packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +5 −3 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ import com.android.systemui.settings.DisplayTracker; import com.android.systemui.settings.UserTracker; import com.android.systemui.statusbar.commandline.CommandRegistry; import com.android.systemui.statusbar.events.PrivacyDotViewController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.util.concurrency.DelayableExecutor; import com.android.systemui.util.concurrency.ThreadFactory; import com.android.systemui.util.settings.SecureSettings; Loading @@ -109,7 +110,8 @@ import javax.inject.Inject; * for antialiasing and emulation purposes. */ @SysUISingleton public class ScreenDecorations implements CoreStartable, Dumpable { public class ScreenDecorations implements CoreStartable, ConfigurationController.ConfigurationListener, Dumpable { private static final boolean DEBUG_LOGGING = false; private static final String TAG = "ScreenDecorations"; Loading Loading @@ -575,7 +577,7 @@ public class ScreenDecorations implements CoreStartable, Dumpable { if (mPendingManualConfigUpdate) { mPendingManualConfigUpdate = false; onConfigurationChanged(mContext.getResources().getConfiguration()); onConfigChanged(mContext.getResources().getConfiguration()); } } } Loading Loading @@ -1062,7 +1064,7 @@ public class ScreenDecorations implements CoreStartable, Dumpable { } @Override public void onConfigurationChanged(Configuration newConfig) { public void onConfigChanged(Configuration newConfig) { if (DEBUG_DISABLE_SCREEN_DECORATIONS) { Log.i(TAG, "ScreenDecorations is disabled"); return; Loading
packages/SystemUI/src/com/android/systemui/ScreenDecorationsModule.kt 0 → 100644 +38 −0 Original line number Diff line number Diff line /* * Copyright (C) 2023 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 import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener import dagger.Binds import dagger.Module import dagger.multibindings.ClassKey import dagger.multibindings.IntoMap import dagger.multibindings.IntoSet @Module interface ScreenDecorationsModule { /** Start ScreenDecorations. */ @Binds @IntoMap @ClassKey(ScreenDecorations::class) fun bindScreenDecorationsCoreStartable(impl: ScreenDecorations): CoreStartable /** Listen to config changes for ScreenDecorations. */ @Binds @IntoSet fun bindScreenDecorationsConfigListener(impl: ScreenDecorations): ConfigurationListener }
packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +1 −14 Original line number Diff line number Diff line Loading @@ -37,11 +37,11 @@ import android.view.SurfaceControl; import android.view.ThreadedRenderer; import android.view.View; import com.android.systemui.res.R; import com.android.internal.protolog.common.ProtoLog; import com.android.systemui.dagger.GlobalRootComponent; import com.android.systemui.dagger.SysUIComponent; import com.android.systemui.dump.DumpManager; import com.android.systemui.res.R; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.util.NotificationChannels; Loading Loading @@ -354,19 +354,6 @@ public class SystemUIApplication extends Application implements } configController.onConfigurationChanged(newConfig); Trace.endSection(); int len = mServices.length; for (int i = 0; i < len; i++) { if (mServices[i] != null) { if (Trace.isEnabled()) { Trace.traceBegin( Trace.TRACE_TAG_APP, mServices[i].getClass().getSimpleName() + ".onConfigurationChanged()"); } mServices[i].onConfigurationChanged(newConfig); Trace.endSection(); } } } } Loading