protected internal JniObject(JniEnvironment environment, IntPtr handle, JniObjectLifecycle lifecycle) { if (handle == IntPtr.Zero) { throw new JniException("TODO"); } if (lifecycle == JniObjectLifecycle.Dead) { throw new JniException("Invalid starting state"); } mHandle = handle; mLifeCycle = lifecycle; if (mLifeCycle == JniObjectLifecycle.Local) { environment.AddToCurrentFrame(this); } else if (mLifeCycle == JniObjectLifecycle.LocalJ2N) { mWillFinalize = false; GC.SuppressFinalize(this); } }