Skip to content

Commit 6bdfc21

Browse files
author
Memfault Inc.
committed
Memfault BORT SDK 5.5.0 (Build 3483284)
1 parent ff99d7d commit 6bdfc21

File tree

130 files changed

+6619
-543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+6619
-543
lines changed

CHANGELOG.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,184 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66
This project currently does not attempt to adhere to Semantic Versioning, but
77
breaking changes are avoided unless absolutely necessary.
88

9+
## v5.5.0 - November 18, 2025
10+
11+
### :rocket: New Features
12+
13+
- Added ability to ignore common WTF patterns. These were chosen across multiple
14+
projects based off of WTF volume and usefulness. Ignoring these will make the
15+
WTFs that do show up more useful. In addition, introduces new SDK settings to
16+
control whether these patterns are used, and to add additional WTF ignore
17+
patterns.
18+
- The default ignored patterns are:
19+
- "No service published for: appwidget at
20+
android.app.SystemServiceRegistry.onServiceNotFound.\*"
21+
- "EXTRA_USER_HANDLE missing or invalid, value=0.\*"
22+
- "Failed to read field SystemLocale.\*"
23+
- "BUG: NetworkAgentInfo.\*"
24+
- "Attempt to decrement existing alarm count 0 by 1 for uid 1000.\*"
25+
- "Removed TIME_TICK alarm.\*"
26+
- "requesting nits when no mapping exists.\*"
27+
- "Could not open /sys/kernel/tracing/instances/bootreceiver/trace_pipe.\*"
28+
- Added Bluetooth quality metrics.
29+
- `bluetooth.ble_scan_result.count` tracks the number of BLE devices found in
30+
each scan
31+
- `bluetooth.ble_scan_result.attribution` tracks the initiator of the BLE scan
32+
- `bluetooth.device_rssi.(min|mean|max)` tracks the Bluetooth RSSI
33+
distribution
34+
- `bluetooth.device_rssi.device_id.latest` tracks the Bluetooth device
35+
reporting the RSSI value
36+
- `bluetooth.device_tx_power_level.(min|mean|max)` tracks the Bluetooth TX
37+
power level distribution
38+
- `bluetooth.device_tx_power_level.device_id` tracks the Bluetooth device
39+
reporting the TX power level value
40+
- `bluetooth.quality_report.rssi.(min|mean|max)` tracks the Bluetooth RSSI
41+
distribution reported by the Bluetooth quality report (if available)
42+
- `bluetooth.quality_report.snr.(min|mean|max)` tracks the Bluetooth SNR
43+
distribution reported by the Bluetooth quality report (if available)
44+
- `bluetooth.quality_report.retransmission_count.(mean|max|sum)` tracks the
45+
number of retransmissions reported by the Bluetooth quality report (if
46+
available).
47+
- `bluetooth.quality_report.reported.latest` reports the latest Bluetooth
48+
quality report.
49+
- Added heartbeat metrics for any batterystats metrics that were previously only
50+
used in HRT.
51+
- camera
52+
- `camera_on_ratio`
53+
- video
54+
- `video_on_ratio`
55+
- flashlight
56+
- `flashlight_on_ratio`
57+
- bluetooth
58+
- `bluetooth_on_ratio`
59+
- usb_data
60+
- `usb_data_on_ratio`
61+
- wake_lock
62+
- `wake_lock_on_ratio`
63+
- wifi_full_lock
64+
- `wifi_full_lock_ratio`
65+
- long_wake_lock
66+
- `long_wake_lock_on_ratio`
67+
- screen_wake
68+
- `screen_wake_count`
69+
- package_install
70+
- `package_install_count`
71+
- phone_connection
72+
- `phone_connection_latest`
73+
- phone_in_call
74+
- `phone_in_call_ratio`
75+
- phone_state
76+
- `phone_state_in_ratio`
77+
- `phone_state_out_ratio`
78+
- `phone_state_em_ratio`
79+
- cellular_high_tx_power
80+
- `cellular_high_tx_power_on_ratio`
81+
- nr_state
82+
- `nr_state_none_ratio`
83+
- `nr_state_restricted_ratio`
84+
- `nr_state_not_restricted_ratio`
85+
- `nr_state_connected_ratio`
86+
- Added support for reporting USB contaminant events.
87+
- `usb.contaminant_reported.latest`
88+
- Updated existing network metrics to generate a heartbeat metric as well.
89+
- `connectivity.airplane_mode.latest`
90+
- `connectivity.internet.latest`
91+
- `connectivity.validated.latest`
92+
- `connectivity.captive_portal.latest`
93+
- `connectivity.roaming.latest`
94+
- `connectivity.unmetered_temporarily.latest`
95+
- Added basic IPv4 and IPv6 connectivity metrics.
96+
- `connectivity.ip_version.latest` with states "IPv4", "IPv6", "IPv4+IPv6",
97+
"?"
98+
- `connectivity.ipv4_status.latest` with states "Internet Available",
99+
"Configuration Error", "Not Available"
100+
- `connectivity.ipv6_status.latest` with states "Internet Available", "Local
101+
Only", "Not Available"
102+
- Added Wi-Fi RSSI time-based moving average metric. This metric is calculated
103+
from raw values obtained from WifiManager broadcasts using an exponential
104+
moving average.
105+
- `connectivity.wifi.rssi.moving_avg`
106+
- Added Wi-Fi roaming and channel hop counters.
107+
- `connectivity.wifi.roaming_count` increments when connected to the same
108+
configured network but the connected access point changed
109+
- `connectivity.wifi.channel_hop_count` increments when connected to the same
110+
network, but the channel changed
111+
- Added metric to distinguish between 2.4/5/6 GHz Wi-Fi frequency bands for
112+
easier device identification.
113+
- `connectivity.wifi.frequency`
114+
- `connectivity.wifi.frequency_band`
115+
- Added count of scanned Wi-Fi networks metric from statsd.
116+
- `connectivity.wifi.scan_network_count`
117+
- `connectivity.wifi.scan_network_count.count`
118+
- `connectivity.wifi.scan_network_count.mean`
119+
- Added low memory event reporting when low memory is reported by the System
120+
Server.
121+
- `memory.low_mem_reported`
122+
- Added slow I/O event metrics which contain a 24h count of the slow I/O events
123+
of a given type.
124+
- `disk.slow_io_(read|write|unmap|sync|unknown)_24h_count`
125+
- Added USB device attached/detached event reports. These will be reported when
126+
USB devices are attached or detached and will contain the full list of
127+
connected devices in each category.
128+
- `usb.devices`
129+
- `usb.accessories`
130+
- Added Wi-Fi OUI (Organizationally Unique Identifier) support. The OUI is
131+
queried via the Dumpster service using `dumpsys wifi`. Memfault will
132+
automatically calculate the manufacturer of the device based off of its OUI.
133+
- `connectivity.wifi.ap_oui`
134+
- Added Wi-Fi disconnected session metric. The event contains the disconnect
135+
reason, time connected, last RSSI and link speed as well as channel. These
136+
metrics are available in Android 12+.
137+
- `wifi_disconnect_session`
138+
- `wifi.frequency-band-bucket`
139+
- `wifi.frequency-band`
140+
- `wifi.failure-code-name`
141+
- `wifi.failure-code`
142+
- `wifi.last-rssi`
143+
- `wifi.last-link-speed`
144+
- Added low memory kill event reporting when applications are killed by the
145+
system due to low memory.
146+
- `memory.lmk_kill_occurred`
147+
148+
### :construction: Fixes
149+
150+
- Coalesced consecutive logcat "switch to" separators. This should reduce the
151+
spam where multiple log lines in a row are just buffer switches.
152+
- Fixed incorrect session end time. The session end will now be recorded when
153+
end is called, instead of at the heartbeat collection time.
154+
- Cleaned up continuous logcat "switch to" buffer logs to always append a
155+
newline. This avoids the "switch to" lines intermixing with normal output.
156+
- Fixed invalid boot id parsing in Bort Lite. Returns a zero'd UUID instead of
157+
"unknown" for the Linux boot id. Also, falls back to "reboot,permissiondenied"
158+
instead of "reboot,bort_unknown" for better clarity.
159+
- Fixed potential memory leak in UsageReporter found by LeakCanary.
160+
- Fixed session deadlock when the sessions rate limit is hit.
161+
- Increased rate limit defaults.
162+
- The Sessions rate limit was thought to be 125 every day, but ended up being
163+
125, and then 1 back every day due to the token bucket algorithm.
164+
- Similarly, the mar_file/client server mar file rate limit implied 500 files
165+
per hour but ended up being 24 a day once the limit was hit.
166+
- Ignored potential Room database migration failures. Fallback to destructive
167+
migration if the database migration fails on downgrade.
168+
169+
### :chart_with_upwards_trend: Improvements
170+
171+
- Bumped to reporting library 1.6.0.
172+
- Added support for Gradle testFixtures.
173+
- Changed Android Studio default project. Load the project root in Android
174+
Studio instead of `MemfaultPackages/`. `MemfaultDumpstateRunner`,
175+
`MemfaultDumpster`, and `MemfaultStructuredLogd` will now be visible in the
176+
IDE.
177+
- Updated MAR unspooling to use new `data_upload_start_date` device config
178+
variable to control what data should be uploaded.
179+
- Added leakcanary to the Bort, OTA, and Reporter apps to check for leaks.
180+
- Enabled Android lint.
181+
- Deleted `log_buffer_expired` counter metric. This was too spammy.
182+
183+
### :house: Internal
184+
185+
- Fixed MetricsIntegrationTest race condition.
186+
9187
## v5.4.2 - August 4, 2025
10188

11189
### :construction: Fixes

MemfaultDumpster/ContinuousLogcat.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@
1919
#include <utils/String8.h>
2020
#include <utils/String16.h>
2121
#include <utils/SystemClock.h>
22-
#include <reporting.h>
2322

2423
namespace memfault {
2524

26-
static constexpr char kLogBufferExpiredCounterName[] = "log_buffer_expired_counter";
27-
2825
ContinuousLogcat::ContinuousLogcat() :
2926
logger_list(nullptr, android_logger_list_close),
3027
log_format(nullptr, android_log_format_free),
3128
total_bytes_written(0),
3229
last_collection_uptime_ms(android::uptimeMillis()) {
33-
report_ = std::make_unique<Report>();
34-
log_buffer_expired_counter_ = report_->counter(kLogBufferExpiredCounterName);
3530
// Compute the list of buffers we want to read from. Buffers
3631
// may vary between platform versions we use the liblog API
3732
// to match names to buffer ids.
@@ -277,7 +272,6 @@ void ContinuousLogcat::run() {
277272

278273
if ((log_mode & ANDROID_LOG_WRAP) && !expiry_reported) {
279274
expiry_reported = true;
280-
log_buffer_expired_counter_->increment();
281275
}
282276

283277
AndroidLogEntry entry;
@@ -345,13 +339,24 @@ void ContinuousLogcat::run() {
345339
snprintf(buf, sizeof(buf), "--------- %s %s\n",
346340
hasPrinted ? "switch to" : "beginning of", name->second);
347341
auto len = strlen(buf);
342+
#if PLATFORM_SDK_VERSION <= 32
348343
if (write(output_fd, buf, len) >= 0) {
349344
total_bytes_written += len;
350345
last_printed_log_id = log_id;
351346
fsync(output_fd);
352347
} else {
353348
ALOGW("Failed to write separator to continuous log output");
354349
}
350+
#else
351+
if (fwrite(buf, 1, len, output_fp) == len) {
352+
total_bytes_written += len;
353+
last_printed_log_id = log_id;
354+
fflush(output_fp);
355+
fsync(output_fd);
356+
} else {
357+
ALOGW("Failed to write separator to continuous log output");
358+
}
359+
#endif
355360
}
356361
}
357362

MemfaultDumpster/ContinuousLogcat.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <log/log_time.h>
1414
#include <log/log_id.h>
1515
#include <utils/String16.h>
16-
#include <reporting.h>
1716

1817
#define CONTINUOUS_LOGCAT_TAG "memfault_clog"
1918
#define CONTINUOUS_LOGCAT_FILE "/data/system/MemfaultDumpster/clog"
@@ -111,9 +110,6 @@ class ContinuousLogcat {
111110
FILE *output_fp;
112111
ContinuousLogcatConfig config;
113112

114-
std::unique_ptr<Report> report_;
115-
std::unique_ptr<Counter> log_buffer_expired_counter_;
116-
117113
std::unique_ptr<EventTagMap, decltype(&android_closeEventTagMap)> event_tag_map_{
118114
nullptr, &android_closeEventTagMap};
119115
bool has_opened_event_tag_map_ = false;

MemfaultPackages/bort-ota-lib/src/main/java/com/memfault/bort/ota/lib/OtaAppModule.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ package com.memfault.bort.ota
33
import android.app.Application
44
import android.content.Context
55
import android.content.SharedPreferences
6-
import com.memfault.bort.BasicCommandTimeout
76
import com.memfault.bort.ota.lib.ABUpdateActionHandler
87
import com.memfault.bort.ota.lib.DEFAULT_STATE_PREFERENCE_FILE
98
import com.memfault.bort.ota.lib.IsAbDevice
109
import com.memfault.bort.ota.lib.RecoveryBasedUpdateActionHandler
1110
import com.memfault.bort.ota.lib.SoftwareUpdateSettingsProvider
1211
import com.memfault.bort.ota.lib.UpdateActionHandler
13-
import com.memfault.bort.shared.BASIC_COMMAND_TIMEOUT_MS
1412
import com.memfault.cloud.sdk.MemfaultCloud
1513
import dagger.Lazy
1614
import dagger.Module
@@ -25,10 +23,6 @@ class OtaAppModule {
2523
fun updaterSharedPreferences(application: Application): SharedPreferences =
2624
application.getSharedPreferences(DEFAULT_STATE_PREFERENCE_FILE, Context.MODE_PRIVATE)
2725

28-
@Provides
29-
@BasicCommandTimeout
30-
fun basicTimeout(): Long = BASIC_COMMAND_TIMEOUT_MS
31-
3226
@Provides
3327
fun createDefaultActionHandlerFactory(
3428
isAbDevice: IsAbDevice,

MemfaultPackages/bort-ota/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ dependencies {
4949
api project(':bort-ota-lib')
5050
api project(':bort-shared')
5151

52+
debugImplementation deps.leakcanary
53+
5254
implementation deps.android.activity
5355
implementation deps.android.appcompat
5456
implementation deps.android.fragment

MemfaultPackages/bort-shared/src/debug/java/com/memfault/bort/DebugConfigureStrictMode.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.memfault.bort
22

33
import android.os.Build
44
import android.os.StrictMode
5-
import com.memfault.bort.scopes.ForScope
65
import com.memfault.bort.scopes.Scope
76
import com.memfault.bort.scopes.Scoped
87
import com.memfault.bort.scopes.Scoped.ScopedPriority
@@ -12,7 +11,6 @@ import dagger.hilt.components.SingletonComponent
1211
import java.util.concurrent.Executors
1312
import javax.inject.Inject
1413

15-
@ForScope(SingletonComponent::class)
1614
@ContributesMultibinding(SingletonComponent::class)
1715
class DebugConfigureStrictMode
1816
@Inject constructor() : Scoped {

MemfaultPackages/bort-shared/src/main/java/com/memfault/bort/android/BroadcastReceivers.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import kotlinx.coroutines.channels.awaitClose
88
import kotlinx.coroutines.flow.Flow
99
import kotlinx.coroutines.flow.callbackFlow
1010

11-
suspend fun Context.registerForIntents(
11+
fun Context.registerForIntents(
1212
vararg actions: String,
1313
sticky: Boolean = false,
1414
): Flow<Intent> {

MemfaultPackages/bort-shared/src/main/java/com/memfault/bort/android/ConnectivityManagers.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.memfault.bort.android
22

33
import android.annotation.SuppressLint
44
import android.net.ConnectivityManager
5+
import android.net.LinkProperties
56
import android.net.Network
67
import android.net.NetworkCapabilities
78
import kotlinx.coroutines.channels.awaitClose
@@ -15,6 +16,10 @@ sealed class NetworkCallbackEvent {
1516
val network: Network,
1617
val networkCapabilities: NetworkCapabilities,
1718
) : NetworkCallbackEvent()
19+
data class OnLinkPropertiesChanged(
20+
val network: Network,
21+
val linkProperties: LinkProperties,
22+
) : NetworkCallbackEvent()
1823
}
1924

2025
/**
@@ -38,6 +43,10 @@ suspend fun ConnectivityManager.registerForDefaultNetworkCallback(): Flow<Networ
3843
) {
3944
trySend(NetworkCallbackEvent.OnCapabilitiesChanged(network, networkCapabilities))
4045
}
46+
47+
override fun onLinkPropertiesChanged(network: Network, linkProperties: LinkProperties) {
48+
trySend(NetworkCallbackEvent.OnLinkPropertiesChanged(network, linkProperties))
49+
}
4150
}
4251

4352
registerDefaultNetworkCallback(callback)

MemfaultPackages/bort-shared/src/main/java/com/memfault/bort/android/SharedAndroidModule.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ import android.net.wifi.WifiManager
1313
import android.os.BatteryManager
1414
import android.os.DropBoxManager
1515
import android.os.Looper
16+
import com.memfault.bort.BasicCommandTimeout
1617
import com.memfault.bort.Default
1718
import com.memfault.bort.IO
1819
import com.memfault.bort.Main
20+
import com.memfault.bort.shared.BASIC_COMMAND_TIMEOUT_MS
1921
import com.squareup.anvil.annotations.ContributesTo
2022
import dagger.Module
2123
import dagger.Provides
@@ -85,4 +87,8 @@ class SharedAndroidModule {
8587
@Provides
8688
fun usageStatsManager(application: Application): UsageStatsManager =
8789
application.getSystemService(UsageStatsManager::class.java)
90+
91+
@Provides
92+
@BasicCommandTimeout
93+
fun basicTimeout(): Long = BASIC_COMMAND_TIMEOUT_MS
8894
}

0 commit comments

Comments
 (0)