Loading services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java +16 −6 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import static com.android.server.accessibility.autoclick.AutoclickTypePanel.Clic import android.accessibilityservice.AccessibilityTrace; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityThread; import android.content.ContentResolver; import android.content.Context; import android.database.ContentObserver; Loading Loading @@ -289,14 +290,23 @@ public class AutoclickController extends BaseEventStreamTransformation { * click will happen. See {@code AutoclickIndicatorView} class. */ private void initiateAutoclickIndicator(Handler handler) { // Try to get the SystemUI context which has dynamic colors properly themed. // Fall back to the regular context if it's not available (in tests). Context uiContext; if (!mContext.getClass().getSimpleName().contains("Testable")) { // Use SystemUI context in production. uiContext = ActivityThread.currentActivityThread().getSystemUiContext(); } else { // Use the original context in test environments. uiContext = mContext; } mAutoclickIndicatorScheduler = new AutoclickIndicatorScheduler(handler); mAutoclickIndicatorView = new AutoclickIndicatorView(mContext); mAutoclickIndicatorView = new AutoclickIndicatorView(uiContext); mWindowManager = mContext.getSystemService(WindowManager.class); mAutoclickTypePanel = new AutoclickTypePanel(mContext, mWindowManager, mUserId, clickPanelController); mAutoclickScrollPanel = new AutoclickScrollPanel(mContext, mWindowManager, mScrollPanelController); mAutoclickTypePanel = new AutoclickTypePanel( uiContext, mWindowManager, mUserId, clickPanelController); mAutoclickScrollPanel = new AutoclickScrollPanel( uiContext, mWindowManager, mScrollPanelController); // Initialize continuous scroll handler and runnable. mContinuousScrollHandler = new Handler(handler.getLooper()); Loading Loading
services/accessibility/java/com/android/server/accessibility/autoclick/AutoclickController.java +16 −6 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ import static com.android.server.accessibility.autoclick.AutoclickTypePanel.Clic import android.accessibilityservice.AccessibilityTrace; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityThread; import android.content.ContentResolver; import android.content.Context; import android.database.ContentObserver; Loading Loading @@ -289,14 +290,23 @@ public class AutoclickController extends BaseEventStreamTransformation { * click will happen. See {@code AutoclickIndicatorView} class. */ private void initiateAutoclickIndicator(Handler handler) { // Try to get the SystemUI context which has dynamic colors properly themed. // Fall back to the regular context if it's not available (in tests). Context uiContext; if (!mContext.getClass().getSimpleName().contains("Testable")) { // Use SystemUI context in production. uiContext = ActivityThread.currentActivityThread().getSystemUiContext(); } else { // Use the original context in test environments. uiContext = mContext; } mAutoclickIndicatorScheduler = new AutoclickIndicatorScheduler(handler); mAutoclickIndicatorView = new AutoclickIndicatorView(mContext); mAutoclickIndicatorView = new AutoclickIndicatorView(uiContext); mWindowManager = mContext.getSystemService(WindowManager.class); mAutoclickTypePanel = new AutoclickTypePanel(mContext, mWindowManager, mUserId, clickPanelController); mAutoclickScrollPanel = new AutoclickScrollPanel(mContext, mWindowManager, mScrollPanelController); mAutoclickTypePanel = new AutoclickTypePanel( uiContext, mWindowManager, mUserId, clickPanelController); mAutoclickScrollPanel = new AutoclickScrollPanel( uiContext, mWindowManager, mScrollPanelController); // Initialize continuous scroll handler and runnable. mContinuousScrollHandler = new Handler(handler.getLooper()); Loading