Merge changes from topic "cf-from-4.19-to-5.4"
* changes:
Update kernel to 5.4
SEPolicy needed for 5.4
Adding UClamp support for cuttlefish
diff --git a/guest/hals/ril/cuttlefish_ril.cpp b/guest/hals/ril/cuttlefish_ril.cpp
index d3c3817..40fc393 100644
--- a/guest/hals/ril/cuttlefish_ril.cpp
+++ b/guest/hals/ril/cuttlefish_ril.cpp
@@ -2289,6 +2289,12 @@
return;
}
+static void request_set_radio_power_1_5(RIL_Token t) {
+ ALOGV("request_set_radio_power_1_5");
+ gce_ril_env->OnRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
+ return;
+}
+
static void gce_ril_on_request(int request, void* data, size_t datalen,
RIL_Token t) {
// Ignore all requests except RIL_REQUEST_GET_SIM_STATUS
@@ -2588,6 +2594,9 @@
case RIL_REQUEST_START_NETWORK_SCAN_1_5:
request_start_network_scan_1_5(t);
break;
+ case RIL_REQUEST_SET_RADIO_POWER_1_5:
+ request_set_radio_power_1_5(t);
+ break;
default:
ALOGE("Request %d not supported.", request);
gce_ril_env->OnRequestComplete(t, RIL_E_REQUEST_NOT_SUPPORTED, NULL, 0);
diff --git a/guest/hals/ril/libril/ril.cpp b/guest/hals/ril/libril/ril.cpp
index 8d3497e..03d469a 100644
--- a/guest/hals/ril/libril/ril.cpp
+++ b/guest/hals/ril/libril/ril.cpp
@@ -1173,6 +1173,7 @@
case RIL_REQUEST_GET_CARRIER_RESTRICTIONS_1_4: return "GET_CARRIER_RESTRICTIONS_1_4";
case RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION: return "SET_CARRIER_INFO_IMSI_ENCRYPTION";
case RIL_REQUEST_SET_SIGNAL_STRENGTH_REPORTING_CRITERIA_1_5: return "SET_SIGNAL_STRENGTH_REPORTING_CRITERIA_1_5";
+ case RIL_REQUEST_SET_RADIO_POWER_1_5: return "SET_RADIO_POWER_1_5";
case RIL_RESPONSE_ACKNOWLEDGEMENT: return "RESPONSE_ACKNOWLEDGEMENT";
case RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED: return "UNSOL_RESPONSE_RADIO_STATE_CHANGED";
case RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED: return "UNSOL_RESPONSE_CALL_STATE_CHANGED";
diff --git a/guest/hals/ril/libril/ril.h b/guest/hals/ril/libril/ril.h
index fde868c..32d5aa0 100644
--- a/guest/hals/ril/libril/ril.h
+++ b/guest/hals/ril/libril/ril.h
@@ -6710,6 +6710,21 @@
*/
#define RIL_REQUEST_START_NETWORK_SCAN_1_5 159
+
+/**
+ * RIL_REQUEST_SET_RADIO_POWER_1_5
+ *
+ * Turn on or off radio power. It can also specify whether turning on radio power is to place an
+ * emergency call and whether the call will be placed on this logical modem.
+ *
+ * Valid errors:
+ * SUCCESS
+ * INTERNAL_ERR
+ * INVALID_ARGUMENTS
+ *
+ */
+#define RIL_REQUEST_SET_RADIO_POWER_1_5 160
+
/***********************************************************************/
/**
diff --git a/guest/hals/ril/libril/ril_commands.h b/guest/hals/ril/libril/ril_commands.h
index aa5df50..6cf94ba 100644
--- a/guest/hals/ril/libril/ril_commands.h
+++ b/guest/hals/ril/libril/ril_commands.h
@@ -174,3 +174,4 @@
{RIL_REQUEST_ARE_UICC_APPLICATIONS_ENABLED, radio_1_5::areUiccApplicationsEnabledResponse},
{RIL_REQUEST_SET_SYSTEM_SELECTION_CHANNELS_1_5, radio_1_5::setSystemSelectionChannelsResponse_1_5},
{RIL_REQUEST_START_NETWORK_SCAN_1_5, radio_1_5::startNetworkScanResponse_1_5},
+ {RIL_REQUEST_SET_RADIO_POWER_1_5, radio_1_5::setRadioPowerResponse_1_5},
diff --git a/guest/hals/ril/libril/ril_service.cpp b/guest/hals/ril/libril/ril_service.cpp
index dcfafc8..176b383 100755
--- a/guest/hals/ril/libril/ril_service.cpp
+++ b/guest/hals/ril/libril/ril_service.cpp
@@ -550,6 +550,8 @@
const ::android::hardware::radio::V1_5::DataProfileInfo& dataProfileInfo);
Return<void> setDataProfile_1_5(int32_t serial,
const hidl_vec<::android::hardware::radio::V1_5::DataProfileInfo>& profiles);
+ Return<void> setRadioPower_1_5(int32_t serial, bool powerOn, bool forEmergencyCall,
+ bool preferredForEmergencyCall);
};
struct OemHookImpl : public IOemHook {
@@ -3607,6 +3609,16 @@
return Void();
}
+Return<void> RadioImpl_1_5::setRadioPower_1_5(int32_t serial, bool powerOn, bool forEmergencyCall,
+ bool preferredForEmergencyCall) {
+#if VDBG
+ RLOGD("setRadioPower_1_5: serial %d powerOn %d forEmergency %d preferredForEmergencyCall %d",
+ serial, powerOn, forEmergencyCall, preferredForEmergencyCall);
+#endif
+ dispatchVoid(serial, mSlotId, RIL_REQUEST_SET_RADIO_POWER_1_5);
+ return Void();
+}
+
Return<void> RadioImpl_1_5::areUiccApplicationsEnabled(int32_t serial) {
#if VDBG
RLOGD("areUiccApplicationsEnabled: serial %d", serial);
@@ -8070,6 +8082,27 @@
return 0;
}
+int radio_1_5::setRadioPowerResponse_1_5(int slotId, int responseType, int serial, RIL_Errno e,
+ void* /* response */, size_t responseLen) {
+#if VDBG
+ RLOGD("%s(): %d", __FUNCTION__, serial);
+#endif
+ RadioResponseInfo responseInfo = {};
+ populateResponseInfo(responseInfo, serial, responseType, e);
+
+ // If we don't have a radio service, there's nothing we can do
+ if (radioService[slotId]->mRadioResponseV1_5 == NULL) {
+ RLOGE("%s: radioService[%d]->mRadioResponseV1_5 == NULL", __FUNCTION__, slotId);
+ return 0;
+ }
+
+ Return<void> retStatus =
+ radioService[slotId]->mRadioResponseV1_5->setRadioPowerResponse_1_5(
+ responseInfo);
+ radioService[slotId]->checkReturnStatus(retStatus);
+ return 0;
+}
+
/***************************************************************************************************
* INDICATION FUNCTIONS
* The below function handle unsolicited messages coming from the Radio
diff --git a/guest/hals/ril/libril/ril_service.h b/guest/hals/ril/libril/ril_service.h
index 8c3fd71..7bf86ba 100644
--- a/guest/hals/ril/libril/ril_service.h
+++ b/guest/hals/ril/libril/ril_service.h
@@ -798,6 +798,10 @@
int responseType, int serial, RIL_Errno e,
void *response, size_t responselen);
+int setRadioPowerResponse_1_5(int slotId, int responseType, int serial, RIL_Errno e,
+ void *response, size_t responselen);
+
+
pthread_rwlock_t * getRadioServiceRwlock(int slotId);
void setNitzTimeReceived(int slotId, long timeReceived);
diff --git a/host/libs/config/cuttlefish_config.cpp b/host/libs/config/cuttlefish_config.cpp
index 4b2451c..1ada1a0 100644
--- a/host/libs/config/cuttlefish_config.cpp
+++ b/host/libs/config/cuttlefish_config.cpp
@@ -827,7 +827,7 @@
for (const auto& arg : android::base::Split(extra_cmdline, " ")) {
args_json_obj.append(arg);
}
- (*dictionary_)[kExtraKernelCmdline] = extra_cmdline;
+ (*dictionary_)[kExtraKernelCmdline] = args_json_obj;
}
std::vector<std::string> CuttlefishConfig::extra_kernel_cmdline() const {
std::vector<std::string> cmdline;