mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 14:19:53 +01:00
cleanup and minor refactoring
This commit is contained in:
@@ -47,11 +47,17 @@ import dagger.Component;
|
|||||||
})
|
})
|
||||||
public interface AndroidComponent extends CoreEagerSingletons {
|
public interface AndroidComponent extends CoreEagerSingletons {
|
||||||
// Exposed objects
|
// Exposed objects
|
||||||
@CryptoExecutor Executor cryptoExecutor();
|
@CryptoExecutor
|
||||||
|
Executor cryptoExecutor();
|
||||||
|
|
||||||
PasswordStrengthEstimator passwordStrengthIndicator();
|
PasswordStrengthEstimator passwordStrengthIndicator();
|
||||||
|
|
||||||
CryptoComponent cryptoComponent();
|
CryptoComponent cryptoComponent();
|
||||||
|
|
||||||
DatabaseConfig databaseConfig();
|
DatabaseConfig databaseConfig();
|
||||||
|
|
||||||
AuthorFactory authFactory();
|
AuthorFactory authFactory();
|
||||||
|
|
||||||
ReferenceManager referenceMangager();
|
ReferenceManager referenceMangager();
|
||||||
|
|
||||||
@DatabaseExecutor
|
@DatabaseExecutor
|
||||||
|
|||||||
@@ -48,16 +48,6 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPostCreate(Bundle savedInstanceState) {
|
|
||||||
super.onPostCreate(savedInstanceState);
|
|
||||||
// Post call used for controllers to ensure that the onCreate method
|
|
||||||
// override in inherited Activities has finished
|
|
||||||
// for (ActivityLifecycleController alc : lifecycleControllers) {
|
|
||||||
// alc.onActivityCreate();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ public abstract class BriarActivity extends BaseActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle state) {
|
public void onCreate(Bundle state) {
|
||||||
super.onCreate(state);
|
super.onCreate(state);
|
||||||
|
|
||||||
briarController.startAndBindService();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ public class BriarService extends Service {
|
|||||||
|
|
||||||
/** Starts the shutdown process. */
|
/** Starts the shutdown process. */
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
stopSelf(); // This will call onActivityDestroy()
|
stopSelf(); // This will call onDestroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BriarBinder extends Binder {
|
public class BriarBinder extends Binder {
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ public interface BriarController extends ActivityLifecycleController {
|
|||||||
|
|
||||||
void startAndBindService();
|
void startAndBindService();
|
||||||
|
|
||||||
void unbindService();
|
|
||||||
|
|
||||||
boolean encryptionKey();
|
boolean encryptionKey();
|
||||||
|
|
||||||
void signOut(ResultHandler<Void> eventHandler);
|
void signOut(ResultHandler<Void> eventHandler);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class BriarControllerImp implements BriarController {
|
|||||||
@Override
|
@Override
|
||||||
@CallSuper
|
@CallSuper
|
||||||
public void onActivityCreate() {
|
public void onActivityCreate() {
|
||||||
|
LOG.info("onActivityCreate : " + databaseConfig.getEncryptionKey());
|
||||||
if (databaseConfig.getEncryptionKey() != null) startAndBindService();
|
if (databaseConfig.getEncryptionKey() != null) startAndBindService();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +98,7 @@ public class BriarControllerImp implements BriarController {
|
|||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unbindService() {
|
private void unbindService() {
|
||||||
if (bound) activity.unbindService(serviceConnection);
|
if (bound) activity.unbindService(serviceConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user