Enables lifecycle callbacks for Android devices
@param application App's Application object
484528
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    public static synchronized void register(android.app.Application application) {
        if (application == null) {
            Logger.i("Application instance is null/system API is too old");
            return;
        }

        if (registered) {
            Logger.v("Lifecycle callbacks have already been registered");
            return;
        }

        registered = true;
        application.registerActivityLifecycleCallbacks(
                new android.app.Application.ActivityLifecycleCallbacks() {

                    @Override
                    public void onActivityCreated(Activity activity, Bundle bundle) {
                        CleverTapAPI.onActivityCreated(activity);
                    }

                    @Override
                    public void onActivityStarted(Activity activity) {}

                    @Override
                    public void onActivityResumed(Activity activity) {
                       CleverTapAPI.onActivityResumed(activity);
                    }

                    @Override
                    public void onActivityPaused(Activity activity) {
                        CleverTapAPI.onActivityPaused();
                    }

                    @Override
                    public void onActivityStopped(Activity activity) {}

                    @Override
                    public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {}

                    @Override
                    public void onActivityDestroyed(Activity activity) {}
                }

        );
        Logger.i("Activity Lifecycle Callback successfully registered");
    }
1207530
function(app, opts) {
  this.app = app;
  this.handlerMap = {};
  if(!!opts.reloadHandlers) {
    watchHandlers(app, this.handlerMap);
  }

  this.enableForwardLog = opts.enableForwardLog || false;
}
870797
public void invoke(StartupLifecycle lifecycle) {
        this.initializeAsciiLogo();
        this.printLogo();

        lifecycle.willInitialize();
        this.logInitializationStart();

        lifecycle.willCreateSpringContext();
        this.initializeApplicationContext();

        lifecycle.didCreateSpringContext(this.context);
        this.initializeVersionProvider();
        this.initializeSystemInfo();
        this.initializeProfile();
        this.initializeExternalProperties();
        this.initializePropertyPlaceholderConfigurer();

        this.initializeSpark();
        lifecycle.willCreateDefaultSparkRoutes(this.context);

        this.initializeJsonTransformer();
        this.initializeDefaultResources();
        this.initializeActuators();

        lifecycle.willScanForComponents(this.context);
        this.initializeSpringComponentScan();

        lifecycle.willRefreshSpringContext(this.context);
        this.refreshApplicationContext();
        this.completeSystemInfoInitialization();
        lifecycle.didInitializeSpring(this.context);

        this.enableApplicationReloading();
        Optional<CharSequence> statusMessages = lifecycle.didInitialize();
        this.logInitializationFinished(statusMessages);
    }
731280
public final void addLifecycleListener(@NonNull LifecycleListener lifecycleListener) {
        if (!lifecycleListeners.contains(lifecycleListener)) {
            lifecycleListeners.add(lifecycleListener);
        }
    }
231228
@Override
    public void setStoreCallback(IStoreCallback callback) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            String s = callback + appNameForLogging;
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "setStoreCallback", s);
        }
        _storeCallback = callback;
    }
1129706
@Override
    protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        mExpandableAdapter.onRestoreInstanceState(savedInstanceState);
    }
913553
@Override
	public synchronized void enable(boolean on)
	{
		if (!on)
		{
			dump(true);
			cached = null;
		}

		enabled = on;
	}
532238
@Override
    public void applicationStopped(ApplicationInfo appInfo) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "application stopped : " + appInfo.getName());

        runFutureGeneratePluginTask();
        this.appsInService--;
    }
1215431
@Override
    @SuppressWarnings("deprecation")
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        binderHelper.bindIfNecessary();
        lifeCycleDispatcher.onAttach(host(), activity);
    }
638291
@Override
    public void onActivityResumed(Activity activity) {
        HMSAgentLog.d("onResumed:" + StrUtils.objDesc(activity));
        setCurActivity(activity);

        List<IActivityResumeCallback> tmdCallbacks = new ArrayList<IActivityResumeCallback>(resumeCallbacks);
        for (IActivityResumeCallback callback : tmdCallbacks) {
            callback.onActivityResume(activity);
        }
    }
1128474
void gotoState(@Nonnull ConnectivityState newState) {
    checkNotNull(newState, "newState");
    if (state != newState && state != ConnectivityState.SHUTDOWN) {
      state = newState;
      if (listeners.isEmpty()) {
        return;
      }
      // Swap out callback list before calling them, because a callback may register new callbacks,
      // if run in direct executor, can cause ConcurrentModificationException.
      ArrayList<Listener> savedListeners = listeners;
      listeners = new ArrayList<>();
      for (Listener listener : savedListeners) {
        listener.runInExecutor();
      }
    }
  }
1294502
public static void initialise(@NonNull final Application app, @NonNull final ChatConfig chatConfig, final Callback<ComapiChatClient> callback) {

        final CallbackAdapter adapter = chatConfig.getComapiCallbackAdapter();
        adapter.adapt(initialise(app, chatConfig), callback);
    }
529787
final static void enable() {
		if (lifeCycle.getStatus().equals(RunStatus.READY) || lifeCycle.getStatus().equals(RunStatus.STOPPED)) {
			init();
		} else if (lifeCycle.getStatus().equals(RunStatus.DISABLED)) {
			lifeCycle.setStatus(RunStatus.RUNNING);
		}
	}
794843
public static void init(Application application) {
        if (!hasInit) {
            logger = _ARouter.logger;
            _ARouter.logger.info(Consts.TAG, "ARouter init start.");
            hasInit = _ARouter.init(application);

            if (hasInit) {
                _ARouter.afterInit();
            }

            _ARouter.logger.info(Consts.TAG, "ARouter init over.");
        }
    }
296556
function(app) {
  var filePath = path.join(app.getBase(), Constants.FILEPATH.SERVER_DIR, app.serverType, Constants.FILEPATH.LIFECYCLE);
  if(!fs.existsSync(filePath)) {
    return;
  }
  var lifecycle = require(filePath);
  for(var key in lifecycle) {
    if(typeof lifecycle[key] === 'function') {
      app.lifecycleCbs[key] = lifecycle[key];
    } else {
      logger.warn('lifecycle.js in %s is error format.', filePath);
    }
  }
}
1172054
public final synchronized void initEVCache(String app) {
        if (app == null || (app = app.trim()).length() == 0) throw new IllegalArgumentException(
                "param app name null or space");
        final String APP = getAppName(app);
        if (poolMap.containsKey(APP)) return;
        final EVCacheNodeList provider;
        if (EVCacheConfig.getInstance().getChainedBooleanProperty(APP + ".use.simple.node.list.provider", "evcache.use.simple.node.list.provider", Boolean.FALSE, null).get()) {
            provider = new SimpleNodeListProvider();
        } else {
            provider = new DiscoveryNodeListProvider(applicationInfoManager, discoveryClient, APP);
        }

        final EVCacheClientPool pool = new EVCacheClientPool(APP, provider, asyncExecutor, this);
        scheduleRefresh(pool);
        poolMap.put(APP, pool);
    }
299267
public void onApplicationEvent(ApplicationEvent event)
    {
        if ((event instanceof LoginEvent)
                && (event.getSource() != LoginEvent.NO_AUTHENTICATION))
            handleLoginEvent((LoginEvent) event);
        else if ((event instanceof LogoutEvent))
            handleLogoutEvent((LogoutEvent) event);
    }