Merge "canned_fs_config.cpp is written in C++"
diff --git a/healthd/Android.bp b/healthd/Android.bp
index eaa8e5b..24777c8 100644
--- a/healthd/Android.bp
+++ b/healthd/Android.bp
@@ -216,8 +216,6 @@
shared_libs: [
// common
- "android.hardware.health@2.0",
- "android.hardware.health@2.1",
"libbase",
"libcutils",
"libhidlbase",
@@ -255,6 +253,10 @@
"charger.cpp",
"charger_utils.cpp",
],
+ shared_libs: [
+ "android.hardware.health@2.0",
+ "android.hardware.health@2.1",
+ ],
target: {
recovery: {
@@ -280,6 +282,11 @@
name: "charger_test",
defaults: ["charger_defaults"],
srcs: ["charger_test.cpp"],
+ static_libs: [
+ "android.hardware.health@1.0",
+ "android.hardware.health@2.0",
+ "android.hardware.health@2.1",
+ ],
}
cc_test {
@@ -290,6 +297,9 @@
"healthd_mode_charger_test.cpp"
],
static_libs: [
+ "android.hardware.health@1.0",
+ "android.hardware.health@2.0",
+ "android.hardware.health@2.1",
"libgmock",
],
test_suites: [
diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp
index 6e293c7..3bf5779 100644
--- a/libutils/Threads.cpp
+++ b/libutils/Threads.cpp
@@ -317,10 +317,7 @@
if (pri >= ANDROID_PRIORITY_BACKGROUND) {
rc = SetTaskProfiles(tid, {"SCHED_SP_SYSTEM"}, true) ? 0 : -1;
} else if (curr_pri >= ANDROID_PRIORITY_BACKGROUND) {
- SchedPolicy policy = SP_FOREGROUND;
- // Change to the sched policy group of the process.
- get_sched_policy(getpid(), &policy);
- rc = SetTaskProfiles(tid, {get_sched_policy_profile_name(policy)}, true) ? 0 : -1;
+ rc = SetTaskProfiles(tid, {"SCHED_SP_FOREGROUND"}, true) ? 0 : -1;
}
if (rc) {