Commit c4429633 authored by Max Lv's avatar Max Lv

unblock the service callback

parent 110a4eb0
......@@ -7,8 +7,8 @@ interface IShadowsocksService {
int getMode();
int getState();
void registerCallback(IShadowsocksServiceCallback cb);
void unregisterCallback(IShadowsocksServiceCallback cb);
oneway void registerCallback(IShadowsocksServiceCallback cb);
oneway void unregisterCallback(IShadowsocksServiceCallback cb);
oneway void start(in Config config);
oneway void stop();
......
package com.github.shadowsocks.aidl;
interface IShadowsocksServiceCallback {
void stateChanged(int state, String msg);
oneway void stateChanged(int state, String msg);
}
......@@ -106,9 +106,8 @@ trait BaseService {
override def run() {
if (state != s) {
val n = callbacks.beginBroadcast()
val m = if (msg != null) msg.substring(0, 64) else null
for (i <- 0 to n - 1) {
callbacks.getBroadcastItem(i).stateChanged(s, m)
callbacks.getBroadcastItem(i).stateChanged(s, msg)
}
callbacks.finishBroadcast()
state = s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment