summaryrefslogtreecommitdiff
path: root/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
blob: b9992e78bbaea934ca25f05733029144911603cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * 
 */
package com.smartdevicelink.proxy;

import java.util.Hashtable;

public class RPCNotification extends RPCMessage {

	public RPCNotification(String functionName) {
		super(functionName, RPCMessage.KEY_NOTIFICATION);
	}

	public RPCNotification(Hashtable<String, Object> hash) {
		super(hash);
	}

	public RPCNotification(RPCMessage rpcMsg) {
		super(preprocessMsg(rpcMsg));
	}
	
	static RPCMessage preprocessMsg (RPCMessage rpcMsg) {
		if (rpcMsg.getMessageType() != RPCMessage.KEY_NOTIFICATION) {
			rpcMsg.messageType = RPCMessage.KEY_NOTIFICATION;
		}
		
		return rpcMsg;
	}
}