/*
 * Copyright 2014-present Facebook, Inc.
 *
 * 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 exotest;

import com.facebook.buck.android.support.exopackage.ExopackageSoLoader;

import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.os.Process;
import android.util.Log;

public class LogActivity extends Activity {

  @Override
  public void onCreate(Bundle bundle) {
    Log.i("EXOPACKAGE_TEST", "VALUE=" + Value.VALUE);

    ExopackageSoLoader.loadLibrary("one");
    ExopackageSoLoader.loadLibrary("two");

    Log.i("EXOPACKAGE_TEST", "NATIVE_ONE=" + stringOneFromJNI());
    Log.i("EXOPACKAGE_TEST", "NATIVE_TWO=" + stringTwoFromJNI());

    finish();
  }

  @Override
  public void onDestroy() {
    // Workaround for the fact that that "am force-stop" doesn't work on Gingerbread.
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
      Process.killProcess(Process.myPid());
    }
  }

  public native String stringOneFromJNI();
  public native String stringTwoFromJNI();
}

@@ -917,24 +917,53 @@
 e bundle) %7B%0A
+    super.onCreate(bundle);%0A%0A
     Log.i(%22E
@@ -1280,24 +1280,48 @@
 Destroy() %7B%0A
+    super.onDestroy();%0A%0A
     // Worka

Call super.on{Create,Destroy} in exopackage test