mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-08-01 11:16:09 -04:00
checkpoint before android work
This commit is contained in:
parent
2a9522cc24
commit
82f680b35f
14 changed files with 61 additions and 88 deletions
|
@ -74,6 +74,7 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.veilid.veilid">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
|
||||
</manifest>
|
||||
|
|
|
@ -64,5 +64,6 @@ flutter {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ Future<VeilidConfig> getDefaultVeilidConfig() async {
|
|||
return VeilidConfig(
|
||||
programName: "Veilid Plugin Test",
|
||||
namespace: "",
|
||||
apiLogLevel: VeilidConfigLogLevel.trace,
|
||||
apiLogLevel: VeilidConfigLogLevel.info,
|
||||
capabilities: VeilidConfigCapabilities(
|
||||
protocolUDP: !kIsWeb,
|
||||
protocolConnectTCP: !kIsWeb,
|
||||
|
|
|
@ -42,9 +42,9 @@ void setRootLogLevel(LogLevel? level) {
|
|||
|
||||
void initLoggy() {
|
||||
Loggy.initLoggy(
|
||||
logPrinter: ConsolePrinter(
|
||||
logPrinter: StreamPrinter(ConsolePrinter(
|
||||
const PrettyDeveloperPrinter(),
|
||||
),
|
||||
)),
|
||||
logOptions: getLogOptions(null),
|
||||
);
|
||||
}
|
||||
|
@ -90,14 +90,16 @@ class _MyAppState extends State<MyApp> with UiLoggy {
|
|||
// We also handle the message potentially returning null.
|
||||
try {
|
||||
veilidVersion = Veilid.instance.veilidVersionString();
|
||||
} on PlatformException {
|
||||
} on Exception {
|
||||
veilidVersion = 'Failed to get veilid version.';
|
||||
}
|
||||
loggy.error("Error test");
|
||||
loggy.warning("Warning test");
|
||||
loggy.info("Info test");
|
||||
loggy.debug("Debug test");
|
||||
loggy.trace("Trace test");
|
||||
|
||||
// In case of hot restart shut down first
|
||||
try {
|
||||
await Veilid.instance.shutdownVeilidCore();
|
||||
} on Exception {
|
||||
//
|
||||
}
|
||||
|
||||
// If the widget was removed from the tree while the asynchronous platform
|
||||
// message was in flight, we want to discard the reply rather than calling
|
||||
|
|
|
@ -115,21 +115,17 @@ pub extern "C" fn startup_veilid_core(port: i64, config: FfiStr) {
|
|||
}
|
||||
|
||||
let sink = stream.clone();
|
||||
let update_callback = Arc::new(
|
||||
move |update: veilid_core::VeilidUpdate| -> veilid_core::SystemPinBoxFuture<()> {
|
||||
let sink = sink.clone();
|
||||
Box::pin(async move {
|
||||
match update {
|
||||
veilid_core::VeilidUpdate::Shutdown => {
|
||||
sink.close();
|
||||
}
|
||||
_ => {
|
||||
sink.item_json(update);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
);
|
||||
let update_callback = Arc::new(move |update: veilid_core::VeilidUpdate| {
|
||||
let sink = sink.clone();
|
||||
match update {
|
||||
veilid_core::VeilidUpdate::Shutdown => {
|
||||
sink.close();
|
||||
}
|
||||
_ => {
|
||||
sink.item_json(update);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let res = veilid_core::api_startup_json(update_callback, config_json).await;
|
||||
let veilid_api = check_err_json!(stream, res);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue