-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from learningequality/task-reconcile
Access kolibri's job storage database to reconcile tasks
- Loading branch information
Showing
37 changed files
with
2,505 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.9.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
137 changes: 94 additions & 43 deletions
137
python-for-android/dists/kolibri/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
python-for-android/dists/kolibri/src/main/java/org/kivy/android/PythonContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.kivy.android; | ||
|
||
import android.content.Context; | ||
|
||
public class PythonContext { | ||
public static PythonContext mInstance; | ||
|
||
private final Context context; | ||
|
||
private PythonContext(Context context) { | ||
this.context = context; | ||
} | ||
|
||
public static PythonContext getInstance(Context context) { | ||
if (mInstance == null) { | ||
synchronized (PythonContext.class) { | ||
if (mInstance == null) { | ||
mInstance = new PythonContext( | ||
context.getApplicationContext() | ||
); | ||
} | ||
} | ||
} | ||
return PythonContext.mInstance; | ||
} | ||
|
||
public static Context get() { | ||
if (PythonContext.mInstance == null) { | ||
return null; | ||
} | ||
return PythonContext.mInstance.context; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
python-for-android/dists/kolibri/src/main/java/org/kivy/android/PythonLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.kivy.android; | ||
|
||
import android.content.Context; | ||
|
||
import java.io.File; | ||
import java.util.concurrent.atomic.AtomicBoolean; | ||
|
||
public class PythonLoader { | ||
protected static PythonLoader mInstance; | ||
|
||
private final File src; | ||
private final AtomicBoolean isLoaded = new AtomicBoolean(false); | ||
|
||
private PythonLoader(File src) { | ||
this.src = src; | ||
} | ||
|
||
public void load() { | ||
synchronized (isLoaded) { | ||
if (isLoaded.get()) { | ||
return; | ||
} | ||
PythonUtil.loadLibraries(src); | ||
isLoaded.set(true); | ||
} | ||
} | ||
|
||
public static PythonLoader getInstance(Context context) { | ||
if (mInstance == null) { | ||
synchronized (PythonLoader.class) { | ||
if (mInstance == null) { | ||
mInstance = new PythonLoader( | ||
new File(context.getApplicationInfo().nativeLibraryDir) | ||
); | ||
} | ||
} | ||
} | ||
return PythonLoader.mInstance; | ||
} | ||
|
||
public static void doLoad(Context context) { | ||
PythonLoader.getInstance(context).load(); | ||
} | ||
} |
Oops, something went wrong.