mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Changed the root package from net.sf.briar to org.briarproject.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package org.briarproject.api.android;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
/**
|
||||
* Enables background threads to make Android API calls that must be made from
|
||||
* a thread with a message queue.
|
||||
*/
|
||||
public interface AndroidExecutor {
|
||||
|
||||
/**
|
||||
* Runs the given task on a thread with a message queue and returns the
|
||||
* result of the task.
|
||||
*/
|
||||
<V> V call(Callable<V> c) throws InterruptedException, ExecutionException;
|
||||
|
||||
void shutdown();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.briarproject.api.android;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import com.google.inject.BindingAnnotation;
|
||||
|
||||
/**
|
||||
* Annotation for injecting the executor for accessing the database from the UI.
|
||||
*/
|
||||
@BindingAnnotation
|
||||
@Target({ FIELD, METHOD, PARAMETER })
|
||||
@Retention(RUNTIME)
|
||||
public @interface DatabaseUiExecutor {}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.briarproject.api.android;
|
||||
|
||||
/**
|
||||
* Manages mappings between object references and serialisable handles. This
|
||||
* enables references to be passed between Android UI objects that belong to
|
||||
* the same process but can only communicate via serialisation.
|
||||
*/
|
||||
public interface ReferenceManager {
|
||||
|
||||
/**
|
||||
* Returns the object with the given handle, or null if no mapping exists
|
||||
* for the handle.
|
||||
*/
|
||||
<T> T getReference(long handle, Class<T> c);
|
||||
|
||||
/**
|
||||
* Creates a mapping between the given reference and a handle, and returns
|
||||
* the handle.
|
||||
*/
|
||||
<T> long putReference(T reference, Class<T> c);
|
||||
|
||||
/**
|
||||
* Removes and returns the object with the given handle, or returns null
|
||||
* if no mapping exists for the handle.
|
||||
*/
|
||||
<T> T removeReference(long handle, Class<T> c);
|
||||
}
|
||||
Reference in New Issue
Block a user