am f864401c: Merge changes I00665385,Ic76db232 into jb-mr1-dev
* commit 'f864401cfa1fdf863003f9d2d624fd742f7b5f4b': Send accessibility notification events only for the current user. No sound produced on global actions dialog pops up if no vibrator is present.
This commit is contained in:
@@ -4302,6 +4302,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean always) {
|
public boolean performHapticFeedbackLw(WindowState win, int effectId, boolean always) {
|
||||||
|
if (!mVibrator.hasVibrator()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
final boolean hapticsDisabled = Settings.System.getIntForUser(mContext.getContentResolver(),
|
final boolean hapticsDisabled = Settings.System.getIntForUser(mContext.getContentResolver(),
|
||||||
Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) == 0;
|
Settings.System.HAPTIC_FEEDBACK_ENABLED, 0, UserHandle.USER_CURRENT) == 0;
|
||||||
if (!always && (hapticsDisabled || mKeyguardMediator.isShowingAndNotHidden())) {
|
if (!always && (hapticsDisabled || mKeyguardMediator.isShowingAndNotHidden())) {
|
||||||
|
|||||||
@@ -991,6 +991,14 @@ public class NotificationManagerService extends INotificationManager.Stub
|
|||||||
| Notification.FLAG_NO_CLEAR;
|
| Notification.FLAG_NO_CLEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final int currentUser;
|
||||||
|
final long token = Binder.clearCallingIdentity();
|
||||||
|
try {
|
||||||
|
currentUser = ActivityManager.getCurrentUser();
|
||||||
|
} finally {
|
||||||
|
Binder.restoreCallingIdentity(token);
|
||||||
|
}
|
||||||
|
|
||||||
if (notification.icon != 0) {
|
if (notification.icon != 0) {
|
||||||
final StatusBarNotification n = new StatusBarNotification(
|
final StatusBarNotification n = new StatusBarNotification(
|
||||||
pkg, id, tag, r.uid, r.initialPid, score, notification, user);
|
pkg, id, tag, r.uid, r.initialPid, score, notification, user);
|
||||||
@@ -1015,7 +1023,10 @@ public class NotificationManagerService extends INotificationManager.Stub
|
|||||||
Binder.restoreCallingIdentity(identity);
|
Binder.restoreCallingIdentity(identity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sendAccessibilityEvent(notification, pkg);
|
// Send accessibility events only for the current user.
|
||||||
|
if (currentUser == userId) {
|
||||||
|
sendAccessibilityEvent(notification, pkg);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Slog.e(TAG, "Ignoring notification with icon==0: " + notification);
|
Slog.e(TAG, "Ignoring notification with icon==0: " + notification);
|
||||||
if (old != null && old.statusBarKey != null) {
|
if (old != null && old.statusBarKey != null) {
|
||||||
@@ -1029,14 +1040,6 @@ public class NotificationManagerService extends INotificationManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final int currentUser;
|
|
||||||
final long token = Binder.clearCallingIdentity();
|
|
||||||
try {
|
|
||||||
currentUser = ActivityManager.getCurrentUser();
|
|
||||||
} finally {
|
|
||||||
Binder.restoreCallingIdentity(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we're not supposed to beep, vibrate, etc. then don't.
|
// If we're not supposed to beep, vibrate, etc. then don't.
|
||||||
if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0)
|
if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0)
|
||||||
&& (!(old != null
|
&& (!(old != null
|
||||||
|
|||||||
Reference in New Issue
Block a user