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

Commit b049d18b authored by Jin Qian's avatar Jin Qian
Browse files

storaged: use AIDL to generate storaged binder calls.

Split binder calls into two separate services.

"storaged" service will be used by external clients, e.g. vold.
- Added stub onUserStarted/onUserStopped to prepare for moving
storaged.proto into ce area.

"storaged_pri" private service will be used by storaged cmdline,
e.g. adb shell storaged -u
- Added parcelable UidInfo for private service.
- Change format of perf history to one vector with first 3 elements
showing size of recent/daily/weekly perf history.

Test: adb shell storaged -u -p
Bug: 63740245
Change-Id: Ib0367282a95b6cb0a38f064f0456e849ecccc210
parent 337b9514
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -42,6 +42,12 @@ cc_library_static {

    defaults: ["storaged_defaults"],

    aidl: {
        export_aidl_headers: true,
        local_include_dirs: ["binder"],
        include_dirs: ["frameworks/native/aidl/binder"],
    },

    srcs: [
        "storaged.cpp",
        "storaged_diskstats.cpp",
@@ -49,7 +55,10 @@ cc_library_static {
        "storaged_service.cpp",
        "storaged_utils.cpp",
        "storaged_uid_monitor.cpp",
        "uid_info.cpp",
        "storaged.proto",
        "binder/android/os/IStoraged.aidl",
        "binder/android/os/storaged/IStoragedPrivate.aidl",
    ],

    logtags: ["EventLogTags.logtags"],
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

package android.os;

/** {@hide} */
interface IStoraged {
    void onUserStarted(int userId);
    void onUserStopped(int userId);
}
 No newline at end of file
+25 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

package android.os.storaged;

import android.os.storaged.UidInfo;

/** {@hide} */
interface IStoragedPrivate {
    UidInfo[] dumpUids();
    int[] dumpPerfHistory();
}
 No newline at end of file
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

package android.os.storaged;

parcelable UidInfo cpp_header "include/uid_info.h";
+5 −4
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ friend class test_case_name##_##test_name##_Test
#include "storaged_info.h"
#include "storaged_uid_monitor.h"
#include "storaged.pb.h"
#include "uid_info.h"

using namespace std;
using namespace android;
@@ -96,11 +97,11 @@ public:
        return mStarttime;
    }

    unordered_map<uint32_t, struct uid_info> get_uids(void) {
    unordered_map<uint32_t, uid_info> get_uids(void) {
        return mUidm.get_uid_io_stats();
    }

    vector<vector<uint32_t>> get_perf_history(void) {
    vector<int> get_perf_history(void) {
        return storage_info->get_perf_history();
    }

Loading