LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES)
-LOCAL_HAL_STATIC_LIBRARIES := libdumpstate
-
LOCAL_CFLAGS += $(COMMON_LOCAL_CFLAGS)
LOCAL_INIT_RC := dumpstate.rc
LOCAL_PICKUP_FILES := $(dumpstate_tests_intermediates)
include $(BUILD_NATIVE_TEST)
-
-# =======================#
-# libdumpstate.default #
-# =======================#
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := libdumpstate_default.cpp
-LOCAL_MODULE := libdumpstate.default
-
-LOCAL_STATIC_LIBRARIES := libdumpstateheaders
-include $(BUILD_STATIC_LIBRARY)
// Relative directory (inside the zip) for all files copied as-is into the bugreport.
static const std::string ZIP_ROOT_DIR = "FS";
+// Must be hardcoded because dumpstate HAL implementation need SELinux access to it
+static const std::string kDumpstateBoardPath = "/bugreports/dumpstate_board.txt";
+
static constexpr char PROPERTY_EXTRA_OPTIONS[] = "dumpstate.options";
static constexpr char PROPERTY_LAST_ID[] = "dumpstate.last_id";
static constexpr char PROPERTY_VERSION[] = "dumpstate.version";
ds.DumpstateBoard();
- /* Migrate the ril_dumpstate to a dumpstate_board()? */
+ /* Migrate the ril_dumpstate to a device specific dumpstate? */
int rilDumpstateTimeout = android::base::GetIntProperty("ril.dumpstate.timeout", 0);
if (rilDumpstateTimeout > 0) {
// su does not exist on user builds, so try running without it.
printf("== Board\n");
printf("========================================================\n");
- ::android::sp<IDumpstateDevice> dumpstate_device(
- IDumpstateDevice::getService("DumpstateDevice"));
+ ::android::sp<IDumpstateDevice> dumpstate_device(IDumpstateDevice::getService("dumpstate"));
if (dumpstate_device == nullptr) {
- // TODO: temporary workaround until devices on master implement it
- MYLOGE("no IDumpstateDevice implementation; using legacy dumpstate_board()\n");
- dumpstate_board();
+ MYLOGE("No IDumpstateDevice implementation\n");
return;
}
if (!IsZipping()) {
- MYLOGE("Not dumping board info because it's not a zipped bugreport\n");
+ MYLOGD("Not dumping board info because it's not a zipped bugreport\n");
return;
}
- std::string path = ds.GetPath("-dumpstate-board.txt");
+ std::string path = kDumpstateBoardPath;
MYLOGI("Calling IDumpstateDevice implementation using path %s\n", path.c_str());
int fd =
handle->data[0] = fd;
// TODO: need a timeout mechanism so dumpstate does not hang on device implementation call.
- dumpstate_device->dumpstateBoard(handle);
+ android::hardware::Return<void> status = dumpstate_device->dumpstateBoard(handle);
+ if (!status.isOk()) {
+ MYLOGE("dumpstateBoard failed: %s\n", status.description().c_str());
+ native_handle_close(handle);
+ native_handle_delete(handle);
+ return;
+ }
AddZipEntry("dumpstate-board.txt", path);
printf("*** See dumpstate-board.txt entry ***\n");
+++ /dev/null
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * 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.
- */
-#include "dumpstate.h"
-
-void dumpstate_board(void)
-{
-}
-