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

Commit f02c0740 authored by Ken Schultz's avatar Ken Schultz Committed by Mike Lockwood
Browse files

DockObserver wakes the display when broadcasting a change


	- normal display timeout applies after wake

Signed-off-by: default avatarKen Schultz <kschultz@motorola.com>
parent f73f91c5
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.os.Handler;
import android.os.Handler;
import android.os.Message;
import android.os.Message;
import android.os.SystemClock;
import android.os.UEventObserver;
import android.os.UEventObserver;
import android.util.Log;
import android.util.Log;


@@ -41,8 +42,11 @@ class DockObserver extends UEventObserver {


    private final Context mContext;
    private final Context mContext;


    public DockObserver(Context context) {
    private PowerManagerService mPowerManager;

    public DockObserver(Context context, PowerManagerService pm) {
        mContext = context;
        mContext = context;
        mPowerManager = pm;
        init();  // set initial status
        init();  // set initial status
        startObserving(DOCK_UEVENT_MATCH);
        startObserving(DOCK_UEVENT_MATCH);
    }
    }
@@ -103,6 +107,7 @@ class DockObserver extends UEventObserver {
            synchronized (this) {
            synchronized (this) {
                Log.d(TAG, "Broadcasting dock state " + mDockState);
                Log.d(TAG, "Broadcasting dock state " + mDockState);
                // Pack up the values and broadcast them to everyone
                // Pack up the values and broadcast them to everyone
                mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
                Intent intent = new Intent(Intent.ACTION_DOCK_EVENT);
                Intent intent = new Intent(Intent.ACTION_DOCK_EVENT);
                intent.putExtra(Intent.EXTRA_DOCK_STATE, mDockState);
                intent.putExtra(Intent.EXTRA_DOCK_STATE, mDockState);
                mContext.sendStickyBroadcast(intent);
                mContext.sendStickyBroadcast(intent);
+1 −1
Original line number Original line Diff line number Diff line
@@ -330,7 +330,7 @@ class ServerThread extends Thread {
            try {
            try {
                Log.i(TAG, "Dock Observer");
                Log.i(TAG, "Dock Observer");
                // Listen for dock station changes
                // Listen for dock station changes
                dock = new DockObserver(context);
                dock = new DockObserver(context, power);
            } catch (Throwable e) {
            } catch (Throwable e) {
                Log.e(TAG, "Failure starting DockObserver", e);
                Log.e(TAG, "Failure starting DockObserver", e);
            }
            }