X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fandroid%2Fappmgr%2Fsrc%2Forg%2Fanbox%2Fappmgr%2FLauncherService.java;fp=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fandroid%2Fappmgr%2Fsrc%2Forg%2Fanbox%2Fappmgr%2FLauncherService.java;h=09a94ec2a681f6262fcbbeeb974f9c7a3b44bea5;hb=e26c1ec581be598521517829adba8c8dd23a768f;hp=0000000000000000000000000000000000000000;hpb=6699c1aea74eeb0eb400e6299079f0c7576f716f;p=iec.git diff --git a/src/type3_AndroidCloud/anbox-master/android/appmgr/src/org/anbox/appmgr/LauncherService.java b/src/type3_AndroidCloud/anbox-master/android/appmgr/src/org/anbox/appmgr/LauncherService.java new file mode 100644 index 0000000..09a94ec --- /dev/null +++ b/src/type3_AndroidCloud/anbox-master/android/appmgr/src/org/anbox/appmgr/LauncherService.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2016 Simon Fels + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + */ + +package org.anbox.appmgr; + +import android.app.Service; +import android.util.Log; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.IBinder; + +public final class LauncherService extends Service { + public static final String TAG = "AnboxAppMgr"; + + private PlatformService mPlatformService; + private PackageEventReceiver mPkgEventReceiver; + + public LauncherService() { + super(); + Log.i(TAG, "Service created"); + } + + @Override + public void onCreate() { + mPlatformService = new PlatformService(getBaseContext()); + + // Send the current list of applications over to the host so + // it can rebuild its list of available applications. + mPlatformService.sendApplicationListUpdate(); + + IntentFilter filter = new IntentFilter(); + filter.addAction(Intent.ACTION_PACKAGE_ADDED); + filter.addAction(Intent.ACTION_PACKAGE_CHANGED); + filter.addAction(Intent.ACTION_PACKAGE_REMOVED); + filter.addDataScheme("package"); + + mPkgEventReceiver = new PackageEventReceiver(); + registerReceiver(mPkgEventReceiver, filter); + + Log.i(TAG, "Service started"); + } + + @Override + public void onDestroy() { + Log.i(TAG, "Service stopped"); + } + + @Override + public IBinder onBind(Intent intent) { + return null; + } +}