package org.bbs.apklauncher.emb.auto_gen; import org.bbs.apklauncher.AndroidUtil; import org.bbs.apklauncher.TargetContext; import android.annotation.SuppressLint; import android.app.IntentService; import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.os.IBinder; import android.util.Log; @SuppressLint("NewApi") public abstract class StubBase_Service extends Service { //do NOT edit this file, auto-generated from StubBase_Service.java.template private static final String TAG = StubBase_Service.class.getSimpleName(); public static boolean DEBUG_LIEFT_CYCLE = true; protected static boolean DEBUG_MEMORY = true; private static boolean DEBUG = true; Target_Service mTargetService; private boolean mCreated; // tag_start:IntentService // tag_end:IntentService abstract protected void onPrepareServiceStub(Intent intent) ; @Override public IBinder onBind(Intent intent) { if (DEBUG) { Log.d(TAG, "onBind(). intent: " + intent); //do NOT edit this file, auto-generated from StubBase_Service.java.template } prepareServiceStub(intent); return mTargetService.onBind(intent); } @Override public void onCreate() { if (DEBUG_LIEFT_CYCLE) { Log.d(TAG, "onCreate(). "); } super.onCreate(); if (null != mTargetService) { mTargetService.onCreate(); } } @Override //do NOT edit this file, auto-generated from StubBase_Service.java.template @Deprecated public void onStart(Intent intent, int startId) { if (DEBUG_LIEFT_CYCLE) { Log.d(TAG, "onStart(). "); } prepareServiceStub(intent); super.onStart(intent, startId); if (null != mTargetService) { mTargetService.onStart(intent, startId); } } @Override public int onStartCommand(Intent intent, int flags, int startId) { if (DEBUG_LIEFT_CYCLE) { Log.d(TAG, "onStartCommand(). intent: " + intent + " flags: " + flags + " startId: " + startId); } //do NOT edit this file, auto-generated from StubBase_Service.java.template prepareServiceStub(intent); // return super.onStartCommand(intent, flags, startId); return mTargetService.onStartCommand(intent, flags, startId); } @Override public void onDestroy() { if (DEBUG_LIEFT_CYCLE) { Log.d(TAG, "onDestroy(). "); } super.onDestroy(); if (null != mTargetService) { mTargetService.onDestroy(); } } @Override //do NOT edit this file, auto-generated from StubBase_Service.java.template public void onConfigurationChanged(Configuration newConfig) { if (DEBUG) { Log.d(TAG, "onConfigurationChanged(). newConfig: " + newConfig); } super.onConfigurationChanged(newConfig); if (null != mTargetService) { mTargetService.onConfigurationChanged(newConfig); } } @Override public void onLowMemory() { if (DEBUG_MEMORY) { Log.d(TAG, "onLowMemory(). "); } super.onLowMemory(); if (null != mTargetService) { //do NOT edit this file, auto-generated from StubBase_Service.java.template mTargetService.onLowMemory(); } } @Override public void onTrimMemory(int level) { if (DEBUG_MEMORY) { Log.d(TAG, "onTrimMemory(). level: " + AndroidUtil.toMemoryLevel(level)); } super.onTrimMemory(level); if (null != mTargetService) { mTargetService.onTrimMemory(level); } } @Override public boolean onUnbind(Intent intent) { //do NOT edit this file, auto-generated from StubBase_Service.java.template // return super.onUnbind(intent); if (DEBUG || DEBUG_LIEFT_CYCLE) { Log.d(TAG, "onUnbind(). intent: " + intent); } if (null != mTargetService) { return mTargetService.onUnbind(intent); } else { return false; } } @Override public void onRebind(Intent intent) { if (DEBUG || DEBUG_LIEFT_CYCLE) { Log.d(TAG, "onRebind(). intent: " + intent); } super.onRebind(intent); //do NOT edit this file, auto-generated from StubBase_Service.java.template if (null != mTargetService) { mTargetService.onRebind(intent); } } @Override public void onTaskRemoved(Intent rootIntent) { super.onTaskRemoved(rootIntent); if (null != mTargetService) { mTargetService.onTaskRemoved(rootIntent); } } private void prepareServiceStub(Intent intent) { if (!mCreated) { onPrepareServiceStub(intent);; mCreated = true; //do NOT edit this file, auto-generated from StubBase_Service.java.template } } // tag_start:IntentService // tag_end:IntentService }