/*
 * Copyright 2016 Peter Kenji Yamanaka
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.pyamsoft.pydroid;

import android.annotation.SuppressLint;
import android.app.Application;

@SuppressWarnings("unused") @SuppressLint("Registered") public abstract class PYDroidApplication
    extends Application {

  @Override public final void onCreate() {
    super.onCreate();
    if (BuildConfigChecker.getInstance().isDebugMode()) {
      onCreateInDebugMode();
    } else {
      onCreateInReleaseMode();
    }
    onCreateNormalMode();
  }

  @SuppressWarnings({ "WeakerAccess", "EmptyMethod" }) protected void onCreateNormalMode() {

  }

  @SuppressWarnings({ "WeakerAccess", "EmptyMethod" }) protected void onCreateInDebugMode() {

  }

  @SuppressWarnings({ "WeakerAccess", "EmptyMethod" }) protected void onCreateInReleaseMode() {

  }
}

@@ -703,16 +703,89 @@
 ication;
+%0Aimport android.support.annotation.CheckResult;%0Aimport timber.log.Timber;
 %0A%0A@Suppr
@@ -963,24 +963,155 @@
 onCreate();%0A
+    if (exitBeforeInitialization()) %7B%0A      Timber.w(%22Exiting out before PYDroidApplication initialization%22);%0A      return;%0A    %7D%0A%0A
     if (Buil
@@ -1235,16 +1235,16 @@
 ;%0A    %7D%0A
-
     onCr
@@ -1262,24 +1262,331 @@
 ode();%0A  %7D%0A%0A
+  /**%0A   * Because the Application class can exist multiple times in a Multi process application,%0A   * we do not always want to initialize it. This allows us to early bail out%0A   * of a multi process initialization.%0A   */%0A  @CheckResult protected boolean exitBeforeInitialization() %7B%0A    return false;%0A  %7D%0A%0A
   @SuppressW

Add hook to stop initialization early