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