noficicaion_kind -> notificationKind

live-activity-data
Andreas Shimokawa 2015-09-13 13:38:11 +02:00
parent 44d8294f8c
commit 4f80844016
9 changed files with 18 additions and 18 deletions

View File

@ -20,7 +20,7 @@ public interface EventHandler {
void onEmail(String from, String subject, String body);
void onGenericNotification(String title, String details, int handle, NotificationKind notification_kind);
void onGenericNotification(String title, String details, int handle, NotificationKind notificationKind);
void onSetTime();

View File

@ -155,17 +155,17 @@ public class NotificationListener extends NotificationListenerService {
}
// Set application icons for generic notifications
NotificationKind notification_kind;
NotificationKind notificationKind;
if (source.equals("org.mariotaku.twidere") ||
source.equals("com.twitter.android") ||
source.equals("org.andstatus.app")) {
notification_kind = NotificationKind.TWITTER;
notificationKind = NotificationKind.TWITTER;
} else if (source.equals("com.fsck.k9")) {
notification_kind = NotificationKind.EMAIL;
notificationKind = NotificationKind.EMAIL;
} else if (source.equals("eu.siacs.conversations")) {
notification_kind = NotificationKind.CHAT;
notificationKind = NotificationKind.CHAT;
} else {
notification_kind = NotificationKind.UNDEFINED;
notificationKind = NotificationKind.UNDEFINED;
}
LOG.info("Processing notification from source " + source);
@ -181,7 +181,7 @@ public class NotificationListener extends NotificationListenerService {
}
if (content != null) {
GBApplication.deviceService().onGenericNotification(title, content, (int) sbn.getPostTime(), notification_kind); //FIMXE: a truly unique id would be better
GBApplication.deviceService().onGenericNotification(title, content, (int) sbn.getPostTime(), notificationKind); //FIMXE: a truly unique id would be better
}
}

View File

@ -97,12 +97,12 @@ public class GBDeviceService implements DeviceService {
}
@Override
public void onGenericNotification(String title, String details, int handle, NotificationKind notification_kind) {
public void onGenericNotification(String title, String details, int handle, NotificationKind notificationKind) {
Intent intent = createIntent().setAction(ACTION_NOTIFICATION_GENERIC)
.putExtra(EXTRA_NOTIFICATION_TITLE, title)
.putExtra(EXTRA_NOTIFICATION_BODY, details)
.putExtra(EXTRA_NOTIFICATION_HANDLE, handle)
.putExtra(EXTRA_NOTIFICATION_KIND, notification_kind);
.putExtra(EXTRA_NOTIFICATION_KIND, notificationKind);
invokeService(intent);
}

View File

@ -37,7 +37,7 @@ public interface DeviceService extends EventHandler {
static final String EXTRA_NOTIFICATION_SENDER = "notification_sender";
static final String EXTRA_NOTIFICATION_SUBJECT = "notification_subject";
static final String EXTRA_NOTIFICATION_HANDLE = "notification_handle";
static final String EXTRA_NOTIFICATION_KIND = "notification_kind";
static final String EXTRA_NOTIFICATION_KIND = "notificationKind";
static final String EXTRA_FIND_START = "find_start";
static final String EXTRA_CALL_COMMAND = "call_command";
static final String EXTRA_CALL_PHONENUMBER = "call_phonenumber";

View File

@ -184,8 +184,8 @@ public class DeviceCommunicationService extends Service {
String title = intent.getStringExtra(EXTRA_NOTIFICATION_TITLE);
String body = intent.getStringExtra(EXTRA_NOTIFICATION_BODY);
int handle = intent.getIntExtra(EXTRA_NOTIFICATION_HANDLE,-1);
NotificationKind notification_kind = (NotificationKind) intent.getSerializableExtra(EXTRA_NOTIFICATION_KIND);
mDeviceSupport.onGenericNotification(title, body, handle, notification_kind);
NotificationKind notificationKind = (NotificationKind) intent.getSerializableExtra(EXTRA_NOTIFICATION_KIND);
mDeviceSupport.onGenericNotification(title, body, handle, notificationKind);
break;
}
case ACTION_NOTIFICATION_SMS: {

View File

@ -128,11 +128,11 @@ public class ServiceDeviceSupport implements DeviceSupport {
}
@Override
public void onGenericNotification(String title, String details, int handle, NotificationKind notification_kind) {
public void onGenericNotification(String title, String details, int handle, NotificationKind notificationKind) {
if (checkBusy("generic notification") || checkThrottle("generic notification")) {
return;
}
delegate.onGenericNotification(title, details, handle, notification_kind);
delegate.onGenericNotification(title, details, handle, notificationKind);
}
@Override

View File

@ -412,7 +412,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
}
@Override
public void onGenericNotification(String title, String details, int handle, NotificationKind notification_kind) {
public void onGenericNotification(String title, String details, int handle, NotificationKind notificationKind) {
performPreferredNotification("generic notification received", ORIGIN_GENERIC, null);
}

View File

@ -119,8 +119,8 @@ public abstract class AbstractSerialDeviceSupport extends AbstractDeviceSupport
}
@Override
public void onGenericNotification(String title, String details, int handle, NotificationKind notification_kind) {
byte[] bytes = gbDeviceProtocol.encodeGenericNotification(title, details, handle, notification_kind);
public void onGenericNotification(String title, String details, int handle, NotificationKind notificationKind) {
byte[] bytes = gbDeviceProtocol.encodeGenericNotification(title, details, handle, notificationKind);
sendToDevice(bytes);
}

View File

@ -16,7 +16,7 @@ public abstract class GBDeviceProtocol {
return null;
}
public byte[] encodeGenericNotification(String title, String details, int handle, NotificationKind notification_kind) {
public byte[] encodeGenericNotification(String title, String details, int handle, NotificationKind notificationKind) {
return null;
}