2012-06-29 00:23:19 +08:00
|
|
|
#include "IPackageManager.h"
|
|
|
|
#include "CommonPackageManager.h"
|
|
|
|
#include <jni.h>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class JavaBasedPackageManager: public CommonPackageManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
JavaBasedPackageManager(JavaVM* JavaMashine, jobject MarketConector);
|
|
|
|
virtual ~JavaBasedPackageManager();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool InstallPackage(const PackageInfo& package);
|
|
|
|
virtual std::vector<PackageInfo> GetInstalledPackages();
|
2012-10-17 07:18:30 +08:00
|
|
|
|
2012-06-29 00:23:19 +08:00
|
|
|
private:
|
|
|
|
JavaVM* JavaContext;
|
|
|
|
jobject JavaPackageManager;
|
2012-10-17 07:18:30 +08:00
|
|
|
|
2012-06-29 00:23:19 +08:00
|
|
|
JavaBasedPackageManager();
|
|
|
|
PackageInfo ConvertPackageFromJava(jobject package, JNIEnv* jenv);
|
|
|
|
};
|