platform_hardware_tequila_c.../libbase/strings.cpp
bengris32 015d90baa5 libbase: Shim old StartsWith function prototype
* The str parameter StartsWith function in libbase got changed
  from std::string to std::string_view in later android versions [1].

* Create a shim that provides the older StartsWith function.

[1]: ef973cee17

Change-Id: I116a32a739d6fa34ecc0d1a4acf8b2e3756910ea
2023-10-03 08:31:35 +00:00

16 lines
337 B
C++

/*
* Copyright (C) 2023 The LineageOS Project
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <string.h>
#include <string>
namespace android {
namespace base {
bool StartsWith(const std::string& s, const char* prefix) {
return strncmp(s.c_str(), prefix, strlen(prefix)) == 0;
}
} // namespace base
} // namespace android