use of android.app.Service in project DroidPlugin by DroidPluginTeam.
the class ServcesManager method onTaskRemoved.
public void onTaskRemoved(Context context, Intent intent) throws Exception {
Intent targetIntent = intent.getParcelableExtra(Env.EXTRA_TARGET_INTENT);
if (targetIntent != null) {
ServiceInfo info = PluginManager.getInstance().resolveServiceInfo(targetIntent, 0);
Service service = mNameService.get(info.name);
if (service == null) {
handleCreateServiceOne(context, intent, info);
}
handleOnTaskRemovedOne(targetIntent);
}
}
use of android.app.Service in project DroidPlugin by DroidPluginTeam.
the class ServcesManager method handleOnBindOne.
private IBinder handleOnBindOne(Intent intent) throws Exception {
ServiceInfo info = PluginManager.getInstance().resolveServiceInfo(intent, 0);
if (info != null) {
Service service = mNameService.get(info.name);
if (service != null) {
ClassLoader classLoader = getClassLoader(info.applicationInfo);
intent.setExtrasClassLoader(classLoader);
return service.onBind(intent);
}
}
return null;
}
use of android.app.Service in project DroidPlugin by DroidPluginTeam.
the class ServcesManager method handleOnRebindOne.
private void handleOnRebindOne(Intent intent) throws Exception {
ServiceInfo info = PluginManager.getInstance().resolveServiceInfo(intent, 0);
if (info != null) {
Service service = mNameService.get(info.name);
if (service != null) {
ClassLoader classLoader = getClassLoader(info.applicationInfo);
intent.setExtrasClassLoader(classLoader);
service.onRebind(intent);
}
}
}
use of android.app.Service in project DroidPlugin by DroidPluginTeam.
the class ServcesManager method handleOnStartOne.
private void handleOnStartOne(Intent intent, int flags, int startIds) throws Exception {
ServiceInfo info = PluginManager.getInstance().resolveServiceInfo(intent, 0);
if (info != null) {
Service service = mNameService.get(info.name);
if (service != null) {
ClassLoader classLoader = getClassLoader(info.applicationInfo);
intent.setExtrasClassLoader(classLoader);
Object token = findTokenByService(service);
Integer integer = mServiceTaskIds.get(token);
if (integer == null) {
integer = -1;
}
int startId = integer + 1;
mServiceTaskIds.put(token, startId);
int res = service.onStartCommand(intent, flags, startId);
QueuedWorkCompat.waitToFinish();
}
}
}
use of android.app.Service in project DroidPlugin by DroidPluginTeam.
the class ServcesManager method handleOnTaskRemovedOne.
private void handleOnTaskRemovedOne(Intent intent) throws Exception {
if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) {
ServiceInfo info = PluginManager.getInstance().resolveServiceInfo(intent, 0);
if (info != null) {
Service service = mNameService.get(info.name);
if (service != null) {
ClassLoader classLoader = getClassLoader(info.applicationInfo);
intent.setExtrasClassLoader(classLoader);
service.onTaskRemoved(intent);
QueuedWorkCompat.waitToFinish();
}
QueuedWorkCompat.waitToFinish();
}
}
}
Aggregations