Merge "port NotificationStation to new interface."

This commit is contained in:
Chris Wren
2014-05-12 20:53:24 +00:00
committed by Android (Google) Code Review

View File

@@ -36,6 +36,7 @@ import android.os.RemoteException;
import android.os.ServiceManager; import android.os.ServiceManager;
import android.os.UserHandle; import android.os.UserHandle;
import android.service.notification.INotificationListener; import android.service.notification.INotificationListener;
import android.service.notification.NotificationOrderUpdate;
import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@@ -74,11 +75,12 @@ public class NotificationStation extends SettingsPreferenceFragment {
private INotificationListener.Stub mListener = new INotificationListener.Stub() { private INotificationListener.Stub mListener = new INotificationListener.Stub() {
@Override @Override
public void onListenerConnected(String[] notificationKeys) throws RemoteException { public void onListenerConnected(NotificationOrderUpdate update) throws RemoteException {
// noop // noop
} }
@Override @Override
public void onNotificationPosted(StatusBarNotification notification) throws RemoteException { public void onNotificationPosted(StatusBarNotification notification,
NotificationOrderUpdate update) throws RemoteException {
Log.v(TAG, "onNotificationPosted: " + notification); Log.v(TAG, "onNotificationPosted: " + notification);
final Handler h = getListView().getHandler(); final Handler h = getListView().getHandler();
h.removeCallbacks(mRefreshListRunnable); h.removeCallbacks(mRefreshListRunnable);
@@ -86,11 +88,17 @@ public class NotificationStation extends SettingsPreferenceFragment {
} }
@Override @Override
public void onNotificationRemoved(StatusBarNotification notification) throws RemoteException { public void onNotificationRemoved(StatusBarNotification notification,
NotificationOrderUpdate update) throws RemoteException {
final Handler h = getListView().getHandler(); final Handler h = getListView().getHandler();
h.removeCallbacks(mRefreshListRunnable); h.removeCallbacks(mRefreshListRunnable);
h.postDelayed(mRefreshListRunnable, 100); h.postDelayed(mRefreshListRunnable, 100);
} }
@Override
public void onNotificationOrderUpdate(NotificationOrderUpdate update)
throws RemoteException {
}
}; };
private NotificationHistoryAdapter mAdapter; private NotificationHistoryAdapter mAdapter;