|
|
@@ -103,8 +103,9 @@ public class DDSService extends Service { |
|
|
|
public int onStartCommand(Intent intent, int flags, int startId) { |
|
|
|
if (intent != null) { |
|
|
|
String action = intent.getAction(); |
|
|
|
Log.i("testkd", "action:" + action); |
|
|
|
Log.i("testkd", "action:" + action + " TextUtils.equals(action, stop) " +TextUtils.equals(action, "stop")); |
|
|
|
if (TextUtils.equals(action, "start")) { |
|
|
|
Log.i("testkd", "releaseSync start"); |
|
|
|
if (isStarted) { |
|
|
|
Log.i("testkd", "already started"); |
|
|
|
LogUtils.e("testh", "already start"); |
|
|
@@ -114,10 +115,12 @@ public class DDSService extends Service { |
|
|
|
} |
|
|
|
return super.onStartCommand(intent, flags, startId); |
|
|
|
} |
|
|
|
Log.i("testkd", "releaseSync start"); |
|
|
|
init(); |
|
|
|
isStarted = true; |
|
|
|
} else if (TextUtils.equals(action, "stop")) { |
|
|
|
//关闭timerstopRefreshTokenTimer() |
|
|
|
Log.i("testkd", "releaseSync stop"); |
|
|
|
if (!isStarted) { |
|
|
|
Log.i(TAG, "already stopped"); |
|
|
|
return super.onStartCommand(intent, flags, startId); |
|
|
@@ -125,6 +128,12 @@ public class DDSService extends Service { |
|
|
|
isStarted = false; |
|
|
|
Log.i("testkd", "releaseSync stop"); |
|
|
|
DDS.getInstance().releaseSync(); |
|
|
|
} else if (TextUtils.equals(action, "stopForce")) { |
|
|
|
//关闭timerstopRefreshTokenTimer() |
|
|
|
Log.i("testkd", "releaseSync stop"); |
|
|
|
isStarted = false; |
|
|
|
Log.i("testkd", "releaseSync stop"); |
|
|
|
DDS.getInstance().releaseSync(); |
|
|
|
} |
|
|
|
} |
|
|
|
return super.onStartCommand(intent, flags, startId); |
|
|
|