am 74a0b820: Merge change 25089 into eclair
Merge commit '74a0b8209e0228bb48739a4b25e489e2eba2a2c4' into eclair-plus-aosp * commit '74a0b8209e0228bb48739a4b25e489e2eba2a2c4': DockObserver wakes the display when broadcasting a change
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user