Merge "Reland "Set vendor: true for boot control HAL""
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 439333d..71b78f4 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -1172,6 +1172,14 @@
}
ASSERT_GT(firstApiLevel, 0); // first_api_level must exist
+ // all devices with first API level == 28 and <= 1GB of RAM must set low_ram
+ // and thus be allowed to continue using HAL1
+ if ((firstApiLevel == HAL1_PHASE_OUT_API_LEVEL) &&
+ (property_get_bool("ro.config.low_ram", /*default*/ false))) {
+ ALOGI("Hal1 allowed for low ram device");
+ return;
+ }
+
if (firstApiLevel >= HAL1_PHASE_OUT_API_LEVEL) {
hidl_vec<hidl_string> cameraDeviceNames = getCameraDeviceNames(mProvider);
for (const auto& name : cameraDeviceNames) {
diff --git a/fastboot/1.0/IFastboot.hal b/fastboot/1.0/IFastboot.hal
index c5979d9..a96755e 100644
--- a/fastboot/1.0/IFastboot.hal
+++ b/fastboot/1.0/IFastboot.hal
@@ -50,4 +50,13 @@
*/
getVariant() generates (string variant, Result result);
+ /**
+ * Returns whether off-mode-charging is enabled. If enabled, the device
+ * autoboots into a special mode when power is applied.
+ *
+ * @response state Returns whether off mode charging is enabled.
+ * @response result Returns the status SUCCESS if the operation is successful,
+ * FAILURE_UNKNOWN otherwise.
+ */
+ getOffModeChargeState() generates (bool state, Result result);
};
diff --git a/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp b/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp
index c9f840e..2d901f3 100644
--- a/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp
+++ b/gnss/1.1/vts/functional/gnss_hal_test_cases.cpp
@@ -119,6 +119,11 @@
struct ComparableBlacklistedSource {
IGnssConfiguration::BlacklistedSource id;
+ ComparableBlacklistedSource() {
+ id.constellation = GnssConstellationType::UNKNOWN;
+ id.svid = 0;
+ }
+
bool operator<(const ComparableBlacklistedSource& compare) const {
return ((id.svid < compare.id.svid) || ((id.svid == compare.id.svid) &&
(id.constellation < compare.id.constellation)));
@@ -191,18 +196,21 @@
* 3) Restart location, wait for 3 locations, ensuring they are valid, and checks corresponding
* GnssStatus does not use those satellites.
* 4a & b) Turns off location, and send in empty blacklist.
- * 5) Restart location, wait for 3 locations, ensuring they are valid, and checks corresponding
+ * 5a) Restart location, wait for 3 locations, ensuring they are valid, and checks corresponding
* GnssStatus does re-use at least the previously strongest satellite
+ * 5b) Retry a few times, in case GNSS search strategy takes a while to reacquire even the
+ * formerly strongest satellite
*/
TEST_F(GnssHalTest, BlacklistIndividualSatellites) {
const int kLocationsToAwait = 3;
+ const int kRetriesToUnBlacklist = 10;
StartAndCheckLocations(kLocationsToAwait);
// Tolerate 1 less sv status to handle edge cases in reporting.
EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
- ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
- kLocationsToAwait);
+ ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations (%d received)",
+ (int)list_gnss_sv_status_.size(), kLocationsToAwait, location_called_count_);
/*
* Identify strongest SV seen at least kLocationsToAwait -1 times
@@ -237,13 +245,18 @@
// retry and ensure satellite not used
list_gnss_sv_status_.clear();
- location_called_count_ = 0;
StartAndCheckLocations(kLocationsToAwait);
+ // early exit if test is being run with insufficient signal
+ if (location_called_count_ == 0) {
+ ALOGE("0 Gnss locations received - ensure sufficient signal and retry");
+ }
+ ASSERT_TRUE(location_called_count_ > 0);
+
// Tolerate 1 less sv status to handle edge cases in reporting.
EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
- ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
- kLocationsToAwait);
+ ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations (%d received)",
+ (int)list_gnss_sv_status_.size(), kLocationsToAwait, location_called_count_);
for (const auto& gnss_sv_status : list_gnss_sv_status_) {
for (uint32_t iSv = 0; iSv < gnss_sv_status.numSvs; iSv++) {
const auto& gnss_sv = gnss_sv_status.gnssSvList[iSv];
@@ -260,28 +273,40 @@
ASSERT_TRUE(result.isOk());
EXPECT_TRUE(result);
- StopAndClearLocations();
- list_gnss_sv_status_.clear();
-
- StartAndCheckLocations(kLocationsToAwait);
-
- // Tolerate 1 less sv status to handle edge cases in reporting.
- EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
- ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
- kLocationsToAwait);
-
bool strongest_sv_is_reobserved = false;
- for (const auto& gnss_sv_status : list_gnss_sv_status_) {
- for (uint32_t iSv = 0; iSv < gnss_sv_status.numSvs; iSv++) {
- const auto& gnss_sv = gnss_sv_status.gnssSvList[iSv];
- if ((gnss_sv.svid == source_to_blacklist.svid) &&
- (gnss_sv.constellation == source_to_blacklist.constellation) &&
- (gnss_sv.svFlag & IGnssCallback::GnssSvFlags::USED_IN_FIX)) {
- strongest_sv_is_reobserved = true;
- break;
- }
+ // do several loops awaiting a few locations, allowing non-immediate reacquisition strategies
+ int unblacklist_loops_remaining = kRetriesToUnBlacklist;
+ while (!strongest_sv_is_reobserved && (unblacklist_loops_remaining-- > 0)) {
+ StopAndClearLocations();
+ list_gnss_sv_status_.clear();
+
+ StartAndCheckLocations(kLocationsToAwait);
+
+ // early exit loop if test is being run with insufficient signal
+ if (location_called_count_ == 0) {
+ ALOGE("0 Gnss locations received - ensure sufficient signal and retry");
}
- if (strongest_sv_is_reobserved) break;
+ ASSERT_TRUE(location_called_count_ > 0);
+
+ // Tolerate 1 less sv status to handle edge cases in reporting.
+ EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
+ ALOGD(
+ "Clear blacklist, observed %d GnssSvStatus, while awaiting %d Locations"
+ ", tries remaining %d",
+ (int)list_gnss_sv_status_.size(), kLocationsToAwait, unblacklist_loops_remaining);
+
+ for (const auto& gnss_sv_status : list_gnss_sv_status_) {
+ for (uint32_t iSv = 0; iSv < gnss_sv_status.numSvs; iSv++) {
+ const auto& gnss_sv = gnss_sv_status.gnssSvList[iSv];
+ if ((gnss_sv.svid == source_to_blacklist.svid) &&
+ (gnss_sv.constellation == source_to_blacklist.constellation) &&
+ (gnss_sv.svFlag & IGnssCallback::GnssSvFlags::USED_IN_FIX)) {
+ strongest_sv_is_reobserved = true;
+ break;
+ }
+ }
+ if (strongest_sv_is_reobserved) break;
+ }
}
EXPECT_TRUE(strongest_sv_is_reobserved);
StopAndClearLocations();
@@ -304,8 +329,8 @@
// Tolerate 1 less sv status to handle edge cases in reporting.
EXPECT_GE((int)list_gnss_sv_status_.size() + 1, kLocationsToAwait);
- ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations", (int)list_gnss_sv_status_.size(),
- kLocationsToAwait);
+ ALOGD("Observed %d GnssSvStatus, while awaiting %d Locations (%d received)",
+ (int)list_gnss_sv_status_.size(), kLocationsToAwait, location_called_count_);
// Find first non-GPS constellation to blacklist
GnssConstellationType constellation_to_blacklist = GnssConstellationType::UNKNOWN;
diff --git a/health/2.0/default/Health.cpp b/health/2.0/default/Health.cpp
index 6d3be99..a2b81d1 100644
--- a/health/2.0/default/Health.cpp
+++ b/health/2.0/default/Health.cpp
@@ -46,7 +46,7 @@
}
{
- std::lock_guard<std::mutex> _lock(callbacks_lock_);
+ std::lock_guard<decltype(callbacks_lock_)> lock(callbacks_lock_);
callbacks_.push_back(callback);
// unlock
}
@@ -58,14 +58,14 @@
// ignore the error
}
- return update();
+ return updateAndNotify(callback);
}
bool Health::unregisterCallbackInternal(const sp<IBase>& callback) {
if (callback == nullptr) return false;
bool removed = false;
- std::lock_guard<std::mutex> _lock(callbacks_lock_);
+ std::lock_guard<decltype(callbacks_lock_)> lock(callbacks_lock_);
for (auto it = callbacks_.begin(); it != callbacks_.end();) {
if (interfacesEqual(*it, callback)) {
it = callbacks_.erase(it);
@@ -142,7 +142,7 @@
Return<Result> Health::update() {
if (!healthd_mode_ops || !healthd_mode_ops->battery_update) {
LOG(WARNING) << "health@2.0: update: not initialized. "
- << "update() should not be called in charger / recovery.";
+ << "update() should not be called in charger";
return Result::UNKNOWN;
}
@@ -156,6 +156,18 @@
return Result::SUCCESS;
}
+Return<Result> Health::updateAndNotify(const sp<IHealthInfoCallback>& callback) {
+ std::lock_guard<decltype(callbacks_lock_)> lock(callbacks_lock_);
+ std::vector<sp<IHealthInfoCallback>> storedCallbacks{std::move(callbacks_)};
+ callbacks_.clear();
+ if (callback != nullptr) {
+ callbacks_.push_back(callback);
+ }
+ Return<Result> result = update();
+ callbacks_ = std::move(storedCallbacks);
+ return result;
+}
+
void Health::notifyListeners(HealthInfo* healthInfo) {
std::vector<StorageInfo> info;
get_storage_info(info);
@@ -175,7 +187,7 @@
healthInfo->diskStats = stats;
healthInfo->storageInfos = info;
- std::lock_guard<std::mutex> _lock(callbacks_lock_);
+ std::lock_guard<decltype(callbacks_lock_)> lock(callbacks_lock_);
for (auto it = callbacks_.begin(); it != callbacks_.end();) {
auto ret = (*it)->healthInfoChanged(*healthInfo);
if (!ret.isOk() && ret.isDeadObject()) {
@@ -233,7 +245,7 @@
Return<void> Health::getHealthInfo(getHealthInfo_cb _hidl_cb) {
using android::hardware::health::V1_0::hal_conversion::convertToHealthInfo;
- update();
+ updateAndNotify(nullptr);
struct android::BatteryProperties p = getBatteryProperties(battery_monitor_.get());
V1_0::HealthInfo batteryInfo;
diff --git a/health/2.0/default/HealthImplDefault.cpp b/health/2.0/default/HealthImplDefault.cpp
index 15346bf..e3cbefd 100644
--- a/health/2.0/default/HealthImplDefault.cpp
+++ b/health/2.0/default/HealthImplDefault.cpp
@@ -46,9 +46,32 @@
return 0;
}
+void healthd_mode_default_impl_init(struct healthd_config*) {
+ // noop
+}
+
+int healthd_mode_default_impl_preparetowait(void) {
+ return -1;
+}
+
+void healthd_mode_default_impl_heartbeat(void) {
+ // noop
+}
+
+void healthd_mode_default_impl_battery_update(struct android::BatteryProperties*) {
+ // noop
+}
+
+static struct healthd_mode_ops healthd_mode_default_impl_ops = {
+ .init = healthd_mode_default_impl_init,
+ .preparetowait = healthd_mode_default_impl_preparetowait,
+ .heartbeat = healthd_mode_default_impl_heartbeat,
+ .battery_update = healthd_mode_default_impl_battery_update,
+};
+
extern "C" IHealth* HIDL_FETCH_IHealth(const char* name) {
const static std::string providedInstance{"backup"};
-
+ healthd_mode_ops = &healthd_mode_default_impl_ops;
if (providedInstance == name) {
// use defaults
// Health class stores static instance
diff --git a/health/2.0/default/include/health2/Health.h b/health/2.0/default/include/health2/Health.h
index 134cdc6..6410474 100644
--- a/health/2.0/default/include/health2/Health.h
+++ b/health/2.0/default/include/health2/Health.h
@@ -31,12 +31,10 @@
// Should only be called by implementation itself (-impl, -service).
// Clients should not call this function. Instead, initInstance() initializes and returns the
// global instance that has fewer functions.
- // TODO(b/62229583): clean up and hide these functions after update() logic is simplified.
static sp<Health> getImplementation();
Health(struct healthd_config* c);
- // TODO(b/62229583): clean up and hide these functions after update() logic is simplified.
void notifyListeners(HealthInfo* info);
// Methods from IHealth follow.
@@ -61,11 +59,15 @@
private:
static sp<Health> instance_;
- std::mutex callbacks_lock_;
+ std::recursive_mutex callbacks_lock_;
std::vector<sp<IHealthInfoCallback>> callbacks_;
std::unique_ptr<BatteryMonitor> battery_monitor_;
bool unregisterCallbackInternal(const sp<IBase>& cb);
+
+ // update() and only notify the given callback, but none of the other callbacks.
+ // If cb is null, do not notify any callback at all.
+ Return<Result> updateAndNotify(const sp<IHealthInfoCallback>& cb);
};
} // namespace implementation
diff --git a/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp b/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp
index bba4661..f895aec 100644
--- a/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp
+++ b/health/2.0/vts/functional/VtsHalHealthV2_0TargetTest.cpp
@@ -222,38 +222,83 @@
}
/*
- * Tests the values returned by getChargeCounter(),
- * getCurrentNow(), getCurrentAverage(), getCapacity(), getEnergyCounter(),
- * getChargeStatus(), getStorageInfo(), getDiskStats() and getHealthInfo() from
- * interface IHealth.
+ * Tests the values returned by getChargeCounter() from interface IHealth.
*/
-TEST_F(HealthHidlTest, Properties) {
+TEST_F(HealthHidlTest, getChargeCounter) {
EXPECT_OK(mHealth->getChargeCounter([](auto result, auto value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(result, std::to_string(value), value > 0);
}));
+}
+
+/*
+ * Tests the values returned by getCurrentNow() from interface IHealth.
+ */
+TEST_F(HealthHidlTest, getCurrentNow) {
EXPECT_OK(mHealth->getCurrentNow([](auto result, auto value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(result, std::to_string(value), value != INT32_MIN);
}));
+}
+
+/*
+ * Tests the values returned by getCurrentAverage() from interface IHealth.
+ */
+TEST_F(HealthHidlTest, getCurrentAverage) {
EXPECT_OK(mHealth->getCurrentAverage([](auto result, auto value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(result, std::to_string(value), value != INT32_MIN);
}));
+}
+
+/*
+ * Tests the values returned by getCapacity() from interface IHealth.
+ */
+TEST_F(HealthHidlTest, getCapacity) {
EXPECT_OK(mHealth->getCapacity([](auto result, auto value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(result, std::to_string(value), 0 <= value && value <= 100);
}));
+}
+
+/*
+ * Tests the values returned by getEnergyCounter() from interface IHealth.
+ */
+TEST_F(HealthHidlTest, getEnergyCounter) {
EXPECT_OK(mHealth->getEnergyCounter([](auto result, auto value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(result, std::to_string(value), value != INT64_MIN);
}));
+}
+
+/*
+ * Tests the values returned by getChargeStatus() from interface IHealth.
+ */
+TEST_F(HealthHidlTest, getChargeStatus) {
EXPECT_OK(mHealth->getChargeStatus([](auto result, auto value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(
result, toString(value),
value != BatteryStatus::UNKNOWN && verifyEnum<BatteryStatus>(value));
}));
+}
+
+/*
+ * Tests the values returned by getStorageInfo() from interface IHealth.
+ */
+TEST_F(HealthHidlTest, getStorageInfo) {
EXPECT_OK(mHealth->getStorageInfo([](auto result, auto& value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(result, toString(value), verifyStorageInfo(value));
}));
+}
+
+/*
+ * Tests the values returned by getDiskStats() from interface IHealth.
+ */
+TEST_F(HealthHidlTest, getDiskStats) {
EXPECT_OK(mHealth->getDiskStats([](auto result, auto& value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(result, toString(value), true);
}));
+}
+
+/*
+ * Tests the values returned by getHealthInfo() from interface IHealth.
+ */
+TEST_F(HealthHidlTest, getHealthInfo) {
EXPECT_OK(mHealth->getHealthInfo([](auto result, auto& value) {
EXPECT_VALID_OR_UNSUPPORTED_PROP(result, toString(value), verifyHealthInfo(value));
}));
diff --git a/keymaster/4.0/support/include/keymasterV4_0/authorization_set.h b/keymaster/4.0/support/include/keymasterV4_0/authorization_set.h
index 1869682..193e4ea 100644
--- a/keymaster/4.0/support/include/keymasterV4_0/authorization_set.h
+++ b/keymaster/4.0/support/include/keymasterV4_0/authorization_set.h
@@ -46,7 +46,7 @@
AuthorizationSet(const AuthorizationSet& other) : data_(other.data_) {}
// Move constructor.
- AuthorizationSet(AuthorizationSet&& other) : data_(std::move(other.data_)) {}
+ AuthorizationSet(AuthorizationSet&& other) noexcept : data_(std::move(other.data_)) {}
// Constructor from hidl_vec<KeyParameter>
AuthorizationSet(const hidl_vec<KeyParameter>& other) { *this = other; }
@@ -58,7 +58,7 @@
}
// Move assignment.
- AuthorizationSet& operator=(AuthorizationSet&& other) {
+ AuthorizationSet& operator=(AuthorizationSet&& other) noexcept {
data_ = std::move(other.data_);
return *this;
}
diff --git a/radio/1.3/Android.bp b/radio/1.3/Android.bp
index 5ac38cd..9424a85 100644
--- a/radio/1.3/Android.bp
+++ b/radio/1.3/Android.bp
@@ -22,6 +22,7 @@
"AccessNetwork",
"DataRegStateResult",
"EmergencyNumber",
+ "EmergencyNumberSource",
"EmergencyServiceCategory",
"LteVopsInfo",
],
diff --git a/radio/1.3/IRadio.hal b/radio/1.3/IRadio.hal
index 480a61f..2b14488 100644
--- a/radio/1.3/IRadio.hal
+++ b/radio/1.3/IRadio.hal
@@ -86,36 +86,19 @@
bool isRoaming, DataRequestReason reason, vec<string> addresses, vec<string> dnses);
/**
- * Request the current emergency number list.
- *
- * Each emergency number (@1.3::EmergencyNumber) in the emergency number list contains a
- * dialing number, one or more service category(s), and mobile country code.
- *
- * Radio must collect all sources of the emergency number to build the response.
- * For example, network operator signals, sim card information, modem configuration, OEM
- * configuration (for example, OEM system properties), always-available emergency numbers and
- * sim-absence emergency numbers, etc.
- *
- * 112, 911 are always available. Besides, 000, 08, 110, 999, 118 and 119 should be available
- * when sim is not present.
- *
- * Please refer the document of @1.3::EmergencyNumber to construct each emergency number to be
- * returned.
- *
- * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
- *
- * @param serial Serial number of request.
- *
- * Response function is IRadioResponse.getCurrentEmergencyNumberListResponse()
- */
- oneway getCurrentEmergencyNumberList(int32_t serial);
-
- /**
- * Initiate emergency voice call, with one or more emergency service category(s).
+ * Initiate emergency voice call, with zero or more emergency service category(s).
*
* Note this API is the same as IRadio.dial except using the
* @1.3::EmergencyServiceCategory as the input param.
*
+ * If the dialed emergency number does not have a specified emergency service category, the
+ * 'categories' field is set to @1.3::EmergencyServiceCategory#UNSPECIFIED; iff either the
+ * 'categories' field is set to @1.3::EmergencyServiceCategory#UNSPECIFIED or the underlying
+ * technology used to request emergency services does not support the emergency service
+ * category, the interpretation of the categories is defined by implementation.
+ *
+ * Reference: 3gpp TS 22.101, Section 10 - Emergency Calls
+ *
* @param serial Serial number of request.
* @param dialInfo the same @1.0::Dial information used by @1.0::IRadio.dial.
* @param categories bitfield<@1.3::EmergencyServiceCategory> the Emergency Service Category(s)
diff --git a/radio/1.3/IRadioIndication.hal b/radio/1.3/IRadioIndication.hal
index c80e762..509eef8 100644
--- a/radio/1.3/IRadioIndication.hal
+++ b/radio/1.3/IRadioIndication.hal
@@ -24,29 +24,28 @@
*/
interface IRadioIndication extends @1.2::IRadioIndication {
/**
- * Indicate and update all of the current Emergency Number information known to the radio,
- * when any of the Emergency Number sources (For example, network operator signals, sim card
- * information, modem configuration, OEM configuration or system properties, etc.) change the
- * list of emergency numbers.
+ * Report the current list of emergency numbers
*
- * 112, 911 are always available. Besides, 000, 08, 110, 999, 118 and 119 should be available
- * when sim is not present.
+ * Each emergency number (@1.3::EmergencyNumber) in the emergency number list contains a
+ * dialing number, zero or more service category(s), mobile country code, and source(s) that
+ * indicate where it comes from.
*
- * This should be the same information as returned by getCurrentEmergencyNumberList() in
- * 1.3::IRadio.
+ * Radio must report all the valid emergency numbers with known mobile country code and
+ * emergency service categories from all available sources including network signaling, sim,
+ * modem/oem configuration, and default configuration (112 and 911 must be always available;
+ * additionally, 000, 08, 110, 999, 118 and 119 must be available when sim is not present).
+ * Radio shall not report emergency numbers that are invalid in the current locale. The
+ * reported emergency number list must not have duplicate @1.3::EmergencyNumber entries. Please
+ * refer the documentation of @1.3::EmergencyNumber to construct each emergency number to
+ * report.
*
- * The indicated list of emergency numbers should not have duplicate @1.3::EmergencyNumber.
- * Please refer the document of @1.3::EmergencyNumber to construct each emergency number to be
- * returned.
+ * Radio must report the complete list of emergency numbers whenever the emergency numbers in
+ * the list are changed or whenever the client and the radio server are connected.
*
- * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
+ * Reference: 3gpp 22.101, Section 10 - Emergency Calls
*
* @param type Type of radio indication
- * @param emergencyNumberList List of current Emergency Number information
- * (@1.3::EmergencyNumber) known to radio. Radio must collect all sources of the emergency
- * numbers to build the indication. For example, network operator signals, sim card
- * information, modem configuration, OEM configuration (for example, OEM specific system
- * properties), always-available emergency numbers and sim-absence emergency numbers, etc.
+ * @param emergencyNumberList Current list of emergency numbers known to radio.
*/
oneway currentEmergencyNumberList(RadioIndicationType type,
vec<EmergencyNumber> emergencyNumberList);
diff --git a/radio/1.3/IRadioResponse.hal b/radio/1.3/IRadioResponse.hal
index 3604953..10e7d63 100644
--- a/radio/1.3/IRadioResponse.hal
+++ b/radio/1.3/IRadioResponse.hal
@@ -25,30 +25,6 @@
interface IRadioResponse extends @1.2::IRadioResponse {
/**
* @param info Response info struct containing response type, serial no. and error
- * @param emergencyNumberList List of current Emergency Number information known to radio.
- *
- * Radio must collect all sources of the emergency number to build the response. For example,
- * network operator signals, sim card information, modem configuration, OEM configuration (for
- * example, OEM system properties), always-available emergency numbers and sim-absence
- * emergency numbers, etc.
- *
- * The returned list of emergency numbers must not have duplicate @1.3::EmergencyNumber. Please
- * refer the document of @1.3::EmergencyNumber to construct each emergency number to be
- * returned.
- *
- * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
- *
- * Valid errors returned:
- * RadioError:NONE
- * RadioError:RADIO_NOT_AVAILABLE
- * RadioError:NO_MEMORY
- * RadioError:MODEM_ERR
- */
- oneway getCurrentEmergencyNumberListResponse(RadioResponseInfo info,
- vec<EmergencyNumber> emergencyNumberList);
-
- /**
- * @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
diff --git a/radio/1.3/types.hal b/radio/1.3/types.hal
index d472ca7..09202a5 100644
--- a/radio/1.3/types.hal
+++ b/radio/1.3/types.hal
@@ -29,14 +29,14 @@
};
/**
- * Emergency number contains information of number, one or more service category(s), and mobile
- * country code (mcc).
+ * Emergency number contains information of number, one or more service category(s), mobile country
+ * code (mcc), and source(s) that indicate where it comes from.
*
* If the source of the emergency number is associated with country, field ‘mcc’ must be
* provided; otherwise the field ‘mcc’ must be an empty string.
*
- * A unique EmergencyNumber has a unique combination of ‘number’ and ‘mcc’ fields.
- * Multiple @1.3::EmergencyServiceCategory should be merged into the bitfield for the same
+ * A unique EmergencyNumber has a unique combination of ‘number’, ‘mcc’ and 'categories' fields.
+ * Multiple @1.3::EmergencyNumberSource should be merged into the bitfield for the same
* EmergencyNumber.
*
* Reference: 3GPP TS 22.101 version 9.1.0 Release 9
@@ -56,6 +56,11 @@
* the value of each bit.
*/
bitfield<EmergencyServiceCategory> categories;
+ /**
+ * The bitfield of @1.3::EmergencyNumberSource(s). See @1.3::EmergencyNumberSource for the
+ * value of each bit.
+ */
+ bitfield<EmergencyNumberSource> sources;
};
/**
@@ -69,20 +74,55 @@
* - Manually Initiated eCall (MIeC);
* - Automatically Initiated eCall (AIeC);
*
- * Type GENERIC (General emergency call, all categories) is considered to use if the reported type
- * is not any of the other specific types.
+ * Category UNSPECIFIED (General emergency call, all categories) indicates that no specific
+ * services are associated with this emergency number.
*
- * Reference: 3GPP TS 22.101 version 9.1.0 Release 9
+ * Reference: 3gpp 22.101, Section 10 - Emergency Calls
*/
enum EmergencyServiceCategory : int32_t {
- GENERIC = 0, // General emergency call, all categories
+ /**
+ * General emergency call, all categories
+ */
+ UNSPECIFIED = 0,
POLICE = 1 << 0,
AMBULANCE = 1 << 1,
FIRE_BRIGADE = 1 << 2,
MARINE_GUARD = 1 << 3,
MOUNTAIN_RESCUE = 1 << 4,
- MIEC = 1 << 5, // Manually Initiated eCall (MIeC)
- AIEC = 1 << 6, // Automatically Initiated eCall (AIeC)
+ /**
+ * Manually Initiated eCall (MIeC)
+ */
+ MIEC = 1 << 5,
+ /**
+ * Automatically Initiated eCall (AIeC)
+ */
+ AIEC = 1 << 6,
+};
+
+/**
+ * The source to tell where the corresponding @1.3::EmergencyNumber comes from.
+ *
+ * Reference: 3gpp 22.101, Section 10 - Emergency Calls
+ */
+enum EmergencyNumberSource : int32_t {
+ /**
+ * Indicates the number is from the network signal.
+ */
+ NETWORK_SIGNALING = 1 << 0,
+ /**
+ * Indicates the number is from the sim card.
+ */
+ SIM = 1 << 1,
+ /**
+ * Indicates the number is from the modem config.
+ */
+ MODEM_CONFIG = 1 << 2,
+ /**
+ * Indicates the number is available as default. Per the reference, 112, 911 must always be
+ * available; additionally, 000, 08, 110, 999, 118 and 119 must be available when sim is not
+ * present.
+ */
+ DEFAULT = 1 << 3,
};
/**