summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Abhishek Pandit-Subedi <abhishekpandit@google.com> 2021-05-21 00:39:23 +0000
committer Abhishek Pandit-Subedi <abhishekpandit@google.com> 2021-05-21 02:32:52 +0000
commit52efc13647e951880f352d6ed51525f18ca14d64 (patch)
treef65871610c73102139333637fd0be4c2509e40fc
parent63fff77b6d3d2652c496d7afebb66df652313199 (diff)
Missing "base/notreached.h"
A libchrome change (on ChromeOS) has removed the "base/notreached.h" include inside "base/logging.h". Import this header explicitly where it's used. Bug: 188832714 Test: atest --host bluetooth_test_gd Tag: #floss Change-Id: I1e3360bb7c75450ac4e0179932a6fd5649f2b65e
-rw-r--r--system/include/notreached.h24
-rw-r--r--system/service/adapter.cc1
-rw-r--r--system/service/avrcp_control.cc1
-rw-r--r--system/service/client/main.cc2
4 files changed, 28 insertions, 0 deletions
diff --git a/system/include/notreached.h b/system/include/notreached.h
new file mode 100644
index 0000000000..1bc849776e
--- /dev/null
+++ b/system/include/notreached.h
@@ -0,0 +1,24 @@
+//
+// Copyright 2021 Google, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#pragma once
+
+// On all old libchrome, NOTREACHED is available via logging.h
+// After 822064, this was moved into base/notreached.h
+#if defined(BASE_VER) && BASE_VER >= 822064
+#include <base/notreached.h>
+#else
+#include <base/logging.h>
+#endif
diff --git a/system/service/adapter.cc b/system/service/adapter.cc
index 65e58e878b..4f324a5f9c 100644
--- a/system/service/adapter.cc
+++ b/system/service/adapter.cc
@@ -25,6 +25,7 @@
#include <base/observer_list.h>
#include "abstract_observer_list.h"
+#include "notreached.h"
#include "service/a2dp_sink.h"
#include "service/a2dp_source.h"
#include "service/avrcp_control.h"
diff --git a/system/service/avrcp_control.cc b/system/service/avrcp_control.cc
index 18dc2aa9e6..5a2be476dd 100644
--- a/system/service/avrcp_control.cc
+++ b/system/service/avrcp_control.cc
@@ -24,6 +24,7 @@
#include <base/memory/ptr_util.h>
#include <base/strings/string_number_conversions.h>
+#include "notreached.h"
#include "service/logging_helpers.h"
#include "stack/include/avrc_defs.h"
diff --git a/system/service/client/main.cc b/system/service/client/main.cc
index 6458b2da5c..b4ab06e382 100644
--- a/system/service/client/main.cc
+++ b/system/service/client/main.cc
@@ -44,6 +44,8 @@
#include <bluetooth/scan_settings.h>
#include <bluetooth/uuid.h>
+#include "notreached.h"
+
using namespace std;
using android::sp;