OSDN Git Service

Merge "AOD: Pause FalsingManager prox sensor while showing AOD" into oc-dr1-dev
authorTreeHugger Robot <treehugger-gerrit@google.com>
Sat, 1 Jul 2017 03:39:06 +0000 (03:39 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Sat, 1 Jul 2017 03:39:06 +0000 (03:39 +0000)
1  2 
packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java

@@@ -24,8 -23,8 +24,9 @@@ import android.hardware.SensorManager
  import android.os.Handler;
  
  import com.android.internal.hardware.AmbientDisplayConfiguration;
 +import com.android.systemui.R;
  import com.android.systemui.SystemUIApplication;
+ import com.android.systemui.classifier.FalsingManager;
  import com.android.systemui.statusbar.phone.DozeParameters;
  import com.android.systemui.util.wakelock.DelayedWakeLock;
  import com.android.systemui.util.wakelock.WakeLock;
@@@ -48,11 -47,14 +49,12 @@@ public class DozeFactory 
          WakeLock wakeLock = new DelayedWakeLock(handler,
                  WakeLock.createPartial(context, "Doze"));
  
 -        DozeMachine machine = new DozeMachine(
 -                DozeSuspendScreenStatePreventingAdapter.wrapIfNeeded(
 -                        DozeScreenStatePreventingAdapter.wrapIfNeeded(dozeService, params), params),
 -                config,
 -                wakeLock);
 +        DozeMachine.Service wrappedService = DozeSuspendScreenStatePreventingAdapter.wrapIfNeeded(
 +                DozeScreenStatePreventingAdapter.wrapIfNeeded(dozeService, params), params);
 +        DozeMachine machine = new DozeMachine(wrappedService, config, wakeLock);
          machine.setParts(new DozeMachine.Part[]{
                  new DozePauser(handler, machine, alarmManager),
+                 new DozeFalsingManagerAdapter(FalsingManager.getInstance(context)),
                  createDozeTriggers(context, sensorManager, host, alarmManager, config, params,
                          handler, wakeLock, machine),
                  createDozeUi(context, host, wakeLock, machine, handler, alarmManager),