Android support part 1

This commit is contained in:
Linus Dierheimer
2022-01-09 16:51:57 +01:00
parent 31d0729cdd
commit bf60429e36
5 changed files with 56 additions and 15 deletions
+51
View File
@@ -47,6 +47,55 @@ static const FFlogo* getLogoNone()
FF_LOGO_RETURN
}
static const FFlogo* getLogoAndroid()
{
FF_LOGO_INIT
FF_LOGO_NAMES("android")
FF_LOGO_LINES(
"$1 -o o- \n"
"$1 +hydNNNNdyh+ \n"
"$1 +mMMMMMMMMMMMMm+ \n"
"$1 `dMM$2m:$1NMMMMMMN$2:m$1MMd` \n"
"$1 hMMMMMMMMMMMMMMMMMMh \n"
"$1 .. yyyyyyyyyyyyyyyyyyyy .. \n"
"$1.mMMm`MMMMMMMMMMMMMMMMMMMM`mMMm.\n"
"$1:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:\n"
"$1:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:\n"
"$1:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:\n"
"$1:MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM:\n"
"$1-MMMM-MMMMMMMMMMMMMMMMMMMM-MMMM-\n"
"$1 +yy+ MMMMMMMMMMMMMMMMMMMM +yy+ \n"
"$1 mMMMMMMMMMMMMMMMMMMm \n"
"$1 `/++MMMMh++hMMMM++/` \n"
"$1 MMMMo oMMMM \n"
"$1 MMMMo oMMMM \n"
"$1 oNMm- -mMNs "
)
FF_LOGO_COLORS(
"32", //green
"37" //white
)
FF_LOGO_RETURN
}
static const FFlogo* getLogoAndroidSmall()
{
FF_LOGO_INIT
FF_LOGO_NAMES("android-small", "android_small")
FF_LOGO_LINES(
"$1 ;, ,; \n"
"$1 ';,.-----.,;' \n"
"$1 ,' ', \n"
"$1 / O O \\ \n"
"$1| |\n"
"$1'-----------------'"
)
FF_LOGO_COLORS(
"32" //green
)
FF_LOGO_RETURN
}
static const FFlogo* getLogoArch()
{
FF_LOGO_INIT
@@ -765,6 +814,8 @@ static GetLogoMethod* getLogoMethods()
static GetLogoMethod logoMethods[] = {
getLogoNone,
getLogoUnknown,
getLogoAndroid,
getLogoAndroidSmall,
getLogoArch,
getLogoArchSmall,
getLogoArcoLinux,
+1 -1
View File
@@ -271,6 +271,6 @@ FFvariant ffSettingsGetXFConf(FFinstance* instance, const char* channelName, con
#include <sys/system_properties.h>
void ffSettingsGetAndroidProperty(const char* propName, FFstrbuf* result) {
ffStrbufEnsureCapacity(result, PROP_VALUE_MAX);
result->length = __system_property_get(propName, result->chars);
result->length = (uint32_t) __system_property_get(propName, result->chars);
}
#endif
-10
View File
@@ -32,12 +32,6 @@ static inline void* connectDisplayServerThreadMain(void* instance)
return NULL;
}
static inline void* detectTerminalShellThreadMain(void* instance)
{
ffDetectTerminalShell((FFinstance*)instance);
return NULL;
}
static inline void* startThreadsThreadMain(void* instance)
{
pthread_t dsThread;
@@ -56,10 +50,6 @@ static inline void* startThreadsThreadMain(void* instance)
pthread_create(&gtk4Thread, NULL, detectGTK4ThreadMain, instance);
pthread_detach(gtk4Thread);
pthread_t terminalShellThread;
pthread_create(&terminalShellThread, NULL, detectTerminalShellThreadMain, instance);
pthread_detach(terminalShellThread);
pthread_t plasmaThread;
pthread_create(&plasmaThread, NULL, detectPlasmaThreadMain, instance);
pthread_detach(plasmaThread);
+2 -2
View File
@@ -249,8 +249,8 @@ const FFTerminalShellResult* ffDetectTerminalShell(FFinstance* instance)
result.userShellExeName = result.userShellExe.chars;
ffStrbufInit(&result.userShellVersion);
char ppid[256];
snprintf(ppid, 255, "%i", getppid());
char ppid[32];
snprintf(ppid, sizeof(ppid) - 1, "%i", getppid());
getTerminalShell(&result, ppid);
getTerminalFromEnv(&result);
+2 -2
View File
@@ -153,10 +153,10 @@ void ffPrintCPU(FFinstance* instance)
else if(vendor.length > 0)
{
ffStrbufAppend(&cpu, &vendor);
ffStrbufAppendS(&cpu, " unknown processor");
ffStrbufAppendS(&cpu, " CPU");
}
else
ffStrbufAppendS(&cpu, "unknown processor");
ffStrbufAppendS(&cpu, "CPU");
if(numProcs > 1)
ffStrbufAppendF(&cpu, " (%i)", numProcs);