File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
hellodaemon/src/main/java/com/xdandroid/hellodaemon Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,22 @@ public static void startServiceMayBind(@NonNull final Class<? extends Service> s
39
39
ServiceConnection bound = BIND_STATE_MAP .get (serviceClass );
40
40
if (bound == null ) sApp .bindService (i , new ServiceConnection () {
41
41
@ Override
42
- public void onServiceConnected (ComponentName componentName , IBinder iBinder ) {
42
+ public void onServiceConnected (ComponentName name , IBinder service ) {
43
43
BIND_STATE_MAP .put (serviceClass , this );
44
44
}
45
45
46
46
@ Override
47
- public void onServiceDisconnected (ComponentName componentName ) {
47
+ public void onServiceDisconnected (ComponentName name ) {
48
48
BIND_STATE_MAP .remove (serviceClass );
49
49
startServiceSafely (i );
50
50
if (!sInitialized ) return ;
51
51
sApp .bindService (i , this , Context .BIND_AUTO_CREATE );
52
52
}
53
+
54
+ @ Override
55
+ public void onBindingDied (ComponentName name ) {
56
+ onServiceDisconnected (name );
57
+ }
53
58
}, Context .BIND_AUTO_CREATE );
54
59
}
55
60
You can’t perform that action at this time.
0 commit comments