From 79c3146161bd1938caa20bbc10a1c7609fc6fc73 Mon Sep 17 00:00:00 2001 From: BlueMatthew Date: Mon, 25 Mar 2024 13:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=20=E7=89=88=E6=9C=AC=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E7=9A=84=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 308d326c..455ff16c 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -358,10 +358,21 @@ bool CPhoneDevice::QuerySystemProperties(std::map& pro } else if (it->first == PROP_VERSION) { + // FOR Protocol snprintf(value, sizeof(value), "%u.%03u", (mVersionCode / 1000), (mVersionCode % 1000)); // __system_property_get("ro.build.version.release", value); it->second = value; } + else if (it->first == (PROP_VERSION_ABBR)) + { + // FOR OSD + string version = std::to_string(mVersionCode / 100000); + version += "."; + version += std::to_string((mVersionCode % 100000) / 1000); + version += "."; + version += std::to_string(mVersionCode % 1000); + it->second = version; + } else if (it->first == PROP_PROD_DATE) { __system_property_get("ro.build.date.utc", value); @@ -465,15 +476,6 @@ bool CPhoneDevice::QuerySystemProperties(std::map& pro { it->second = std::to_string(m_signalLevel); } - else if (it->first == (PROP_VERSION) || it->first == (PROP_VERSION_ABBR)) - { - string version = std::to_string(mVersionCode / 100000); - version += "."; - version += std::to_string((mVersionCode % 100000) / 1000); - version += "."; - version += std::to_string(mVersionCode % 1000); - it->second = version; - } else if (startsWith(it->first, PROP_JAVA_PREFIX)) { if (powerInfo.empty()) @@ -486,8 +488,6 @@ bool CPhoneDevice::QuerySystemProperties(std::map& pro it->second = it2->second; } } - - } // __system_property_get("ro.telephony.default_network", value);