Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
febfdc9f
Commit
febfdc9f
authored
Oct 08, 2012
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wating for OpenCV library package installation added.
parent
11839e2c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
android+AsyncServiceHelper.java
...s/java/generator/src/java/android+AsyncServiceHelper.java
+55
-0
No files found.
modules/java/generator/src/java/android+AsyncServiceHelper.java
View file @
febfdc9f
...
@@ -185,6 +185,8 @@ class AsyncServiceHelper
...
@@ -185,6 +185,8 @@ class AsyncServiceHelper
Log
.
d
(
TAG
,
"Trying to get library path"
);
Log
.
d
(
TAG
,
"Trying to get library path"
);
String
path
=
mEngineService
.
getLibPathByVersion
(
mOpenCVersion
);
String
path
=
mEngineService
.
getLibPathByVersion
(
mOpenCVersion
);
if
((
null
==
path
)
||
(
path
.
length
()
==
0
))
if
((
null
==
path
)
||
(
path
.
length
()
==
0
))
{
if
(!
mLibraryInstallationProgress
)
{
{
InstallCallbackInterface
InstallQuery
=
new
InstallCallbackInterface
()
{
InstallCallbackInterface
InstallQuery
=
new
InstallCallbackInterface
()
{
public
String
getPackageName
()
public
String
getPackageName
()
...
@@ -197,6 +199,7 @@ class AsyncServiceHelper
...
@@ -197,6 +199,7 @@ class AsyncServiceHelper
{
{
if
(
mEngineService
.
installVersion
(
mOpenCVersion
))
if
(
mEngineService
.
installVersion
(
mOpenCVersion
))
{
{
mLibraryInstallationProgress
=
true
;
mStatus
=
LoaderCallbackInterface
.
RESTART_REQUIRED
;
mStatus
=
LoaderCallbackInterface
.
RESTART_REQUIRED
;
}
}
else
else
...
@@ -230,11 +233,63 @@ class AsyncServiceHelper
...
@@ -230,11 +233,63 @@ class AsyncServiceHelper
};
};
mUserAppCallback
.
onPackageInstall
(
InstallCallbackInterface
.
NEW_INSTALLATION
,
InstallQuery
);
mUserAppCallback
.
onPackageInstall
(
InstallCallbackInterface
.
NEW_INSTALLATION
,
InstallQuery
);
}
else
{
InstallCallbackInterface
WaitQuery
=
new
InstallCallbackInterface
()
{
public
String
getPackageName
()
{
return
"OpenCV library"
;
}
public
void
install
()
{
Log
.
e
(
TAG
,
"Nothing to install we just wait current installation"
);
}
public
void
cancel
()
{
Log
.
d
(
TAG
,
"OpenCV library installation was canceled"
);
mLibraryInstallationProgress
=
false
;
mStatus
=
LoaderCallbackInterface
.
INSTALL_CANCELED
;
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
wait_install
()
{
Log
.
d
(
TAG
,
"Waiting for current installation"
);
try
{
if
(
mEngineService
.
installVersion
(
mOpenCVersion
))
{
mStatus
=
LoaderCallbackInterface
.
RESTART_REQUIRED
;
}
else
{
Log
.
d
(
TAG
,
"OpenCV package was not installed!"
);
mStatus
=
LoaderCallbackInterface
.
MARKET_ERROR
;
}
}
catch
(
RemoteException
e
)
{
e
.
printStackTrace
();
mStatus
=
LoaderCallbackInterface
.
INIT_FAILED
;
}
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
);
}
};
mUserAppCallback
.
onPackageInstall
(
InstallCallbackInterface
.
INSTALLATION_PROGRESS
,
WaitQuery
);
}
return
;
return
;
}
}
else
else
{
{
Log
.
d
(
TAG
,
"Trying to get library list"
);
Log
.
d
(
TAG
,
"Trying to get library list"
);
mLibraryInstallationProgress
=
false
;
String
libs
=
mEngineService
.
getLibraryList
(
mOpenCVersion
);
String
libs
=
mEngineService
.
getLibraryList
(
mOpenCVersion
);
Log
.
d
(
TAG
,
"Library list: \""
+
libs
+
"\""
);
Log
.
d
(
TAG
,
"Library list: \""
+
libs
+
"\""
);
Log
.
d
(
TAG
,
"First attempt to load libs"
);
Log
.
d
(
TAG
,
"First attempt to load libs"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment