Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7440ddb7 authored by Steven Moreland's avatar Steven Moreland Committed by Felipe Leme
Browse files

dumpstate: remove references to legacy dumpstate

Test: dumpstate_tests pass
Test: manual verification
Bug: 31982882

Change-Id: If48cccec2e334d54acf6f3a67098475d3122117a
parent f6b96f91
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -107,8 +107,6 @@ LOCAL_SHARED_LIBRARIES := $(COMMON_SHARED_LIBRARIES) \

LOCAL_STATIC_LIBRARIES := $(COMMON_STATIC_LIBRARIES)

LOCAL_HAL_STATIC_LIBRARIES := libdumpstate

LOCAL_CFLAGS += $(COMMON_LOCAL_CFLAGS)

LOCAL_INIT_RC := dumpstate.rc
@@ -181,14 +179,3 @@ LOCAL_GENERATED_SOURCES += $(GEN)
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)
+15 −9
Original line number Diff line number Diff line
@@ -107,6 +107,9 @@ static int DumpFile(const std::string& title, const std::string& path) {
// 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";
@@ -1080,7 +1083,7 @@ static void dumpstate() {

    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.
@@ -1149,21 +1152,18 @@ void Dumpstate::DumpstateBoard() {
    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 =
@@ -1182,7 +1182,13 @@ void Dumpstate::DumpstateBoard() {
    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");
+0 −3
Original line number Diff line number Diff line
@@ -399,9 +399,6 @@ void dump_route_tables();
/* Play a sound via Stagefright */
void play_sound(const char *path);

/* Implemented by libdumpstate_board to dump board-specific info */
void dumpstate_board();

/* Checks if a given path is a directory. */
bool is_dir(const char* pathname);

+0 −21
Original line number Diff line number Diff line
/*
 * 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)
{
}
+0 −4
Original line number Diff line number Diff line
@@ -56,10 +56,6 @@ using os::DumpstateService;
using os::IDumpstateListener;
using os::IDumpstateToken;

// Not used on test cases yet...
void dumpstate_board(void) {
}

class DumpstateListenerMock : public IDumpstateListener {
  public:
    MOCK_METHOD1(onProgressUpdated, binder::Status(int32_t progress));