Merge "Stop screensaver on incoming phone call." into jb-mr1-dev

This commit is contained in:
John Spurlock
2012-08-13 14:34:43 -07:00
committed by Android (Google) Code Review

View File

@ -51,6 +51,7 @@ import android.os.ServiceManager;
import android.os.UserId;
import android.os.Vibrator;
import android.provider.Settings;
import android.service.dreams.IDreamManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.AtomicFile;
@ -148,6 +149,8 @@ public class NotificationManagerService extends INotificationManager.Stub
private AtomicFile mPolicyFile;
private HashSet<String> mBlockedPackages = new HashSet<String>();
private IDreamManager mSandman;
private static final int DB_VERSION = 1;
private static final String TAG_BODY = "notification-policy";
@ -634,6 +637,8 @@ public class NotificationManagerService extends INotificationManager.Stub
void systemReady() {
mAudioService = IAudioService.Stub.asInterface(
ServiceManager.getService(Context.AUDIO_SERVICE));
mSandman = IDreamManager.Stub.asInterface(
ServiceManager.getService("dreams"));
// no beeping until we're basically done booting
mSystemReady = true;
@ -972,6 +977,16 @@ public class NotificationManagerService extends INotificationManager.Stub
| Notification.FLAG_NO_CLEAR;
}
// Stop screensaver if the notification has a full-screen intent.
// (like an incoming phone call)
if (notification.fullScreenIntent != null && mSandman != null) {
try {
mSandman.awaken();
} catch (RemoteException e) {
// noop
}
}
if (notification.icon != 0) {
StatusBarNotification n = new StatusBarNotification(pkg, id, tag,
r.uid, r.initialPid, score, notification);