Skip to content

Commit

Permalink
添加额外反馈获取监听
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxudong committed Jun 4, 2020
1 parent b560535 commit ffcdebe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions serial/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 28
versionCode 11
versionName "1.2.7"
versionCode 12
versionName "1.2.8"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
Expand Down
12 changes: 11 additions & 1 deletion serial/src/main/java/org/sheedon/serial/Dispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ public void addCallback(long backNameCode, Callback callback) {
callbacks.put(backNameCode, callback);
}

/**
* 是否存在指定反馈
*
* @param backNameCode 反馈名
*/
public boolean hasCallback(long backNameCode) {
Callback callback = callbacks.get(backNameCode);
return callback != null;
}

public void removeCallback(long backNameCode) {
callbacks.remove(backNameCode);
}
Expand Down Expand Up @@ -256,7 +266,7 @@ public synchronized void finishedByNet(String id, long backNameCode, Response re
* 反馈通知
*
* @param backNameCode 反馈名Code
* @param response 反馈结果
* @param response 反馈结果
*/
private void noticeCallback(long backNameCode, Response response) {
if (backNameCode == -1)
Expand Down

0 comments on commit ffcdebe

Please sign in to comment.