提交 4b808b11 编写于 作者: A Alexander Smorkalov

RESTART_REQUIRED status removed from OpenCV Manager API;

OpenCV info library name fixed;
Minimum API level for OpenCV library project increased up to 3 for using message dialogs.
上级 408e0dcb
......@@ -3,4 +3,6 @@
package="org.opencv"
android:versionCode="242"
android:versionName="2.4.2">
<uses-sdk android:minSdkVersion="8" />
</manifest>
......@@ -85,10 +85,8 @@ class AsyncServiceHelper
if (result)
{
mServiceInstallationProgress = true;
int Status = LoaderCallbackInterface.RESTART_REQUIRED;
Log.d(TAG, "Init finished with status " + Status);
Log.d(TAG, "Calling using callback");
mUserAppCallback.onManagerConnected(Status);
Log.d(TAG, "Package installation started");
}
else
{
......@@ -195,29 +193,35 @@ class AsyncServiceHelper
}
public void install() {
Log.d(TAG, "Trying to install OpenCV lib via Google Play");
boolean result;
try
{
if (mEngineService.installVersion(mOpenCVersion))
{
mLibraryInstallationProgress = true;
mStatus = LoaderCallbackInterface.RESTART_REQUIRED;
result = true;
Log.d(TAG, "Package installation statred");
}
else
{
result = false;
Log.d(TAG, "OpenCV package was not installed!");
mStatus = LoaderCallbackInterface.MARKET_ERROR;
}
} catch (RemoteException e) {
e.printStackTrace();
result = false;
mStatus = LoaderCallbackInterface.INIT_FAILED;
}
if (!result)
{
Log.d(TAG, "Init finished with status " + mStatus);
Log.d(TAG, "Unbind from service");
mAppContext.unbindService(mServiceConnection);
Log.d(TAG, "Calling using callback");
mUserAppCallback.onManagerConnected(mStatus);
}
}
public void cancel() {
Log.d(TAG, "OpenCV library installation was canceled");
mStatus = LoaderCallbackInterface.INSTALL_CANCELED;
......@@ -260,11 +264,7 @@ class AsyncServiceHelper
Log.d(TAG, "Waiting for current installation");
try
{
if (mEngineService.installVersion(mOpenCVersion))
{
mStatus = LoaderCallbackInterface.RESTART_REQUIRED;
}
else
if (!mEngineService.installVersion(mOpenCVersion))
{
Log.d(TAG, "OpenCV package was not installed!");
mStatus = LoaderCallbackInterface.MARKET_ERROR;
......
......@@ -24,11 +24,6 @@ public abstract class BaseLoaderCallback implements LoaderCallbackInterface {
{
/** Application must override this method to handle successful library initialization. **/
} break;
/** OpenCV Manager or library package installation is in progress. Restart the application. **/
case LoaderCallbackInterface.RESTART_REQUIRED:
{
Log.d(TAG, "OpenCV downloading. App restart is needed!");
} break;
/** OpenCV loader can not start Google Play Market. **/
case LoaderCallbackInterface.MARKET_ERROR:
{
......
......@@ -9,10 +9,6 @@ public interface LoaderCallbackInterface
* OpenCV initialization finished successfully.
*/
static final int SUCCESS = 0;
/**
* OpenCV library installation via Google Play service has been initialized. Restart the application.
*/
static final int RESTART_REQUIRED = 1;
/**
* Google Play Market cannot be invoked.
*/
......
......@@ -15,7 +15,7 @@ class StaticHelper {
try
{
System.loadLibrary("opencvinfo");
System.loadLibrary("opencv_info");
libs = getLibraryList();
}
catch(UnsatisfiedLinkError e)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册