Skip to content

Commit bb2d80a

Browse files
committed
Everywhere: Gently remove the ladybird android port
With Ladybird now being its own repository, there's little reason to keep the Ladybird Android port in the SerenityOS repository. (The Qt port is useful to be able to test changes to LibWeb in lagom so it'll stay around. Similar for the AppKit port, since getting Qt on macOS is a bit annoying. But if the AppKit port is too much pain to keep working, we should toss that too. Eventually, the lagom browser ports should move out from Ladybird/ to Meta/Lagom/Contrib, but for now it might make sense to leave them where they are to keep cherry-picks from ladybird easier.)
1 parent ce11613 commit bb2d80a

File tree

84 files changed

+27
-2994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+27
-2994
lines changed

AK/Assertions.cpp

+3-11
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@
1010
#include <AK/StringBuilder.h>
1111
#include <AK/StringView.h>
1212

13-
#if (defined(AK_OS_LINUX) && !defined(AK_OS_ANDROID)) || defined(AK_LIBC_GLIBC) || defined(AK_OS_BSD_GENERIC) || defined(AK_OS_SOLARIS) || defined(AK_OS_HAIKU)
13+
#if defined(AK_OS_LINUX) || defined(AK_LIBC_GLIBC) || defined(AK_OS_BSD_GENERIC) || defined(AK_OS_SOLARIS) || defined(AK_OS_HAIKU)
1414
# define EXECINFO_BACKTRACE
1515
#endif
1616

17-
#if defined(AK_OS_ANDROID) && (__ANDROID_API__ >= 33)
18-
# include <android/log.h>
19-
# define EXECINFO_BACKTRACE
20-
# define PRINT_ERROR(s) __android_log_write(ANDROID_LOG_WARN, "AK", (s))
21-
#else
22-
# define PRINT_ERROR(s) (void)fputs((s), stderr)
23-
#endif
17+
#define PRINT_ERROR(s) (void)fputs((s), stderr)
2418

2519
#if defined(EXECINFO_BACKTRACE)
2620
# include <cxxabi.h>
@@ -74,9 +68,7 @@ ALWAYS_INLINE void dump_backtrace()
7468
} else {
7569
error_builder.append(sym);
7670
}
77-
# if !defined(AK_OS_ANDROID)
7871
error_builder.append('\n');
79-
# endif
8072
error_builder.append('\0');
8173
PRINT_ERROR(error_builder.string_view().characters_without_null_termination());
8274
}
@@ -89,7 +81,7 @@ extern "C" {
8981

9082
void ak_verification_failed(char const* message)
9183
{
92-
# if defined(AK_OS_SERENITY) || defined(AK_OS_ANDROID)
84+
# if defined(AK_OS_SERENITY)
9385
bool colorize_output = true;
9486
# elif defined(AK_OS_WINDOWS)
9587
bool colorize_output = false;

AK/Format.cpp

+1-51
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
# include <time.h>
2929
#endif
3030

31-
#if defined(AK_OS_ANDROID)
32-
# include <android/log.h>
33-
#endif
34-
3531
#ifndef KERNEL
3632
# include <AK/StringFloatingPointConversions.h>
3733
#endif
@@ -1090,45 +1086,6 @@ void vout(FILE* file, StringView fmtstr, TypeErasedFormatParams& params, bool ne
10901086
}
10911087
#endif
10921088

1093-
#ifdef AK_OS_ANDROID
1094-
static char const* s_log_tag_name = "Serenity";
1095-
void set_log_tag_name(char const* tag_name)
1096-
{
1097-
static String s_log_tag_storage;
1098-
// NOTE: Make sure to copy the null terminator
1099-
s_log_tag_storage = MUST(String::from_utf8({ tag_name, strlen(tag_name) + 1 }));
1100-
s_log_tag_name = s_log_tag_storage.bytes_as_string_view().characters_without_null_termination();
1101-
}
1102-
1103-
void vout(LogLevel log_level, StringView fmtstr, TypeErasedFormatParams& params, bool newline)
1104-
{
1105-
StringBuilder builder;
1106-
MUST(vformat(builder, fmtstr, params));
1107-
1108-
if (newline)
1109-
builder.append('\n');
1110-
builder.append('\0');
1111-
1112-
auto const string = builder.string_view();
1113-
1114-
auto ndk_log_level = ANDROID_LOG_UNKNOWN;
1115-
switch (log_level) {
1116-
case LogLevel ::Debug:
1117-
ndk_log_level = ANDROID_LOG_DEBUG;
1118-
break;
1119-
case LogLevel ::Info:
1120-
ndk_log_level = ANDROID_LOG_INFO;
1121-
break;
1122-
case LogLevel::Warning:
1123-
ndk_log_level = ANDROID_LOG_WARN;
1124-
break;
1125-
}
1126-
1127-
__android_log_write(ndk_log_level, s_log_tag_name, string.characters_without_null_termination());
1128-
}
1129-
1130-
#endif
1131-
11321089
#ifndef KERNEL
11331090
// FIXME: Deduplicate with Core::Process:get_name()
11341091
[[gnu::used]] static ByteString process_name_helper()
@@ -1139,7 +1096,7 @@ void vout(LogLevel log_level, StringView fmtstr, TypeErasedFormatParams& params,
11391096
if (rc != 0)
11401097
return ByteString {};
11411098
return StringView { buffer, strlen(buffer) };
1142-
# elif defined(AK_LIBC_GLIBC) || (defined(AK_OS_LINUX) && !defined(AK_OS_ANDROID))
1099+
# elif defined(AK_LIBC_GLIBC) || defined(AK_OS_LINUX)
11431100
return StringView { program_invocation_name, strlen(program_invocation_name) };
11441101
# elif defined(AK_OS_BSD_GENERIC) || defined(AK_OS_HAIKU)
11451102
auto const* progname = getprogname();
@@ -1235,9 +1192,6 @@ void vdbg(StringView fmtstr, TypeErasedFormatParams& params, bool newline)
12351192
MUST(vformat(builder, fmtstr, params));
12361193
if (newline)
12371194
builder.append('\n');
1238-
#ifdef AK_OS_ANDROID
1239-
builder.append('\0');
1240-
#endif
12411195
auto const string = builder.string_view();
12421196

12431197
#ifdef AK_OS_SERENITY
@@ -1248,11 +1202,7 @@ void vdbg(StringView fmtstr, TypeErasedFormatParams& params, bool newline)
12481202
}
12491203
# endif
12501204
#endif
1251-
#ifdef AK_OS_ANDROID
1252-
__android_log_write(ANDROID_LOG_DEBUG, s_log_tag_name, string.characters_without_null_termination());
1253-
#else
12541205
dbgputstr(string.characters_without_null_termination(), string.length());
1255-
#endif
12561206
}
12571207

12581208
#ifdef KERNEL

AK/Format.h

-44
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ void outln(FILE* file, CheckedFormatString<Parameters...>&& fmtstr, Parameters c
592592

593593
inline void outln(FILE* file) { fputc('\n', file); }
594594

595-
# ifndef AK_OS_ANDROID
596595
template<typename... Parameters>
597596
void out(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
598597
{
@@ -614,49 +613,6 @@ template<typename... Parameters>
614613
void warnln(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters) { outln(stderr, move(fmtstr), parameters...); }
615614

616615
inline void warnln() { outln(stderr); }
617-
# else // v Android ^ No Android
618-
enum class LogLevel {
619-
Debug,
620-
Info,
621-
Warning,
622-
};
623-
624-
void vout(LogLevel, StringView fmtstr, TypeErasedFormatParams&, bool newline = false);
625-
626-
template<typename... Parameters>
627-
void out(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
628-
{
629-
VariadicFormatParams<AllowDebugOnlyFormatters::Yes, Parameters...> variadic_format_params { parameters... };
630-
vout(LogLevel::Info, fmtstr.view(), variadic_format_params);
631-
}
632-
633-
template<typename... Parameters>
634-
void outln(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
635-
{
636-
VariadicFormatParams<AllowDebugOnlyFormatters::Yes, Parameters...> variadic_format_params { parameters... };
637-
vout(LogLevel::Info, fmtstr.view(), variadic_format_params, true);
638-
}
639-
640-
inline void outln() { outln(""); }
641-
642-
template<typename... Parameters>
643-
void warn(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
644-
{
645-
VariadicFormatParams<AllowDebugOnlyFormatters::Yes, Parameters...> variadic_format_params { parameters... };
646-
vout(LogLevel::Warning, fmtstr.view(), variadic_format_params);
647-
}
648-
649-
template<typename... Parameters>
650-
void warnln(CheckedFormatString<Parameters...>&& fmtstr, Parameters const&... parameters)
651-
{
652-
VariadicFormatParams<AllowDebugOnlyFormatters::Yes, Parameters...> variadic_format_params { parameters... };
653-
vout(LogLevel::Warning, fmtstr.view(), variadic_format_params, true);
654-
}
655-
656-
inline void warnln() { warnln(""); }
657-
658-
void set_log_tag_name(char const*);
659-
# endif // AK_OS_ANDROID
660616

661617
# define outln_if(flag, fmt, ...) \
662618
do { \

AK/Platform.h

-12
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,6 @@
127127
# define AK_OS_WINDOWS
128128
#endif
129129

130-
#if defined(__ANDROID__)
131-
# define STR(x) __STR(x)
132-
# define __STR(x) #x
133-
# if __ANDROID_API__ < 30
134-
# pragma message "Invalid android API " STR(__ANDROID_API__)
135-
# error "Build configuration not tested on configured Android API version"
136-
# endif
137-
# undef STR
138-
# undef __STR
139-
# define AK_OS_ANDROID
140-
#endif
141-
142130
#if defined(__EMSCRIPTEN__)
143131
# define AK_OS_EMSCRIPTEN
144132
#endif

AK/Random.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace AK {
2020

2121
inline void fill_with_random([[maybe_unused]] Bytes bytes)
2222
{
23-
#if defined(AK_OS_SERENITY) || defined(AK_OS_ANDROID) || defined(AK_OS_BSD_GENERIC) || defined(AK_OS_HAIKU) || AK_LIBC_GLIBC_PREREQ(2, 36)
23+
#if defined(AK_OS_SERENITY) || defined(AK_OS_BSD_GENERIC) || defined(AK_OS_HAIKU) || AK_LIBC_GLIBC_PREREQ(2, 36)
2424
arc4random_buf(bytes.data(), bytes.size());
2525
#elif defined(OSS_FUZZ)
2626
#else

AK/StackInfo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ StackInfo::StackInfo()
9797

9898
m_top = m_base + m_size;
9999

100-
#if defined(AK_OS_LINUX) && !defined(AK_OS_ANDROID) && !defined(AK_LIBC_GLIBC)
100+
#if defined(AK_OS_LINUX) && !defined(AK_LIBC_GLIBC)
101101
// Note: musl libc always gives the initial size of the main thread's stack
102102
if (getpid() == static_cast<pid_t>(gettid())) {
103103
rlimit limit;

AK/String.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ namespace AK {
2828

2929
// FIXME: Remove this when OpenBSD Clang fully supports consteval.
3030
// And once oss-fuzz updates to clang >15.
31-
// And once Android ships an NDK with clang >14
32-
#if defined(AK_OS_OPENBSD) || defined(OSS_FUZZ) || defined(AK_OS_ANDROID)
31+
#if defined(AK_OS_OPENBSD) || defined(OSS_FUZZ)
3332
# define AK_SHORT_STRING_CONSTEVAL constexpr
3433
#else
3534
# define AK_SHORT_STRING_CONSTEVAL consteval

AK/StringView.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,7 @@ struct CaseInsensitiveASCIIStringViewTraits : public Traits<StringView> {
408408
// See: https://github.com/llvm/llvm-project/issues/48230
409409
// Additionally, oss-fuzz currently ships an llvm-project commit that is a pre-release of 15.0.0.
410410
// See: https://github.com/google/oss-fuzz/issues/9989
411-
// Android currently doesn't ship clang-15 in any NDK
412-
#if defined(AK_OS_BSD_GENERIC) || defined(OSS_FUZZ) || defined(AK_OS_ANDROID)
411+
#if defined(AK_OS_BSD_GENERIC) || defined(OSS_FUZZ)
413412
# define AK_STRING_VIEW_LITERAL_CONSTEVAL constexpr
414413
#else
415414
# define AK_STRING_VIEW_LITERAL_CONSTEVAL consteval

Documentation/AndroidStudioConfiguration.md

-35
This file was deleted.

Documentation/BuildInstructionsLadybird.md

+1-7
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ On Windows:
8484
WSL2/WSLg are preferred, as they provide a linux environment that matches one of the above distributions.
8585
MinGW/MSYS2 are not supported, but may work with sufficient elbow grease. Native Windows builds are not supported with either clang-cl or MSVC.
8686

87-
For Android:
88-
89-
On a Unix-like platform, install the prerequisites for that platform and then see the [Android Studio guide](AndroidStudioConfiguration.md).
90-
Or, download a version of Gradle >= 8.0.0, and run the ``gradlew`` program in ``Ladybird/Android``
91-
9287
## Build steps
9388

9489
### Using serenity.sh
@@ -102,11 +97,10 @@ The simplest way to build and run ladybird is via the serenity.sh script:
10297
```
10398

10499
The above commands will build Ladybird with one of the following browser chromes, depending on the platform:
105-
* [Android UI](https://developer.android.com/develop/ui) - The native chrome on Android.
106100
* [AppKit](https://developer.apple.com/documentation/appkit?language=objc) - The native chrome on macOS.
107101
* [Qt](https://doc.qt.io/qt-6/) - The chrome used on all other platforms.
108102

109-
The Qt chrome is available on platforms where it is not the default as well (except on Android). To build the
103+
The Qt chrome is available on platforms where it is not the default as well. To build the
110104
Qt chrome, install the Qt dependencies for your platform, and enable the Qt chrome via CMake:
111105

112106
```bash

Ladybird/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ moc_*
55
Build
66
build
77
CMakeLists.txt.user
8-
Android/src/main/assets/

Ladybird/Android/BuildLagomTools.sh

-27
This file was deleted.

0 commit comments

Comments
 (0)