Fallback for empty local name
Since 2020 (https://r.android.com/1400927) native errors are no longer reported, and notably, if the name is an empty value, the error is silently discarded in the stack. When setting a name that only contains spaces, this will work temporarily until the stack restarts, read the config and trim the output — since at least 2020 (https://r.android.com/1324998) This CL does a couple things to address the issue. * Warn the user at API level when the name result is an empty name * Fallback to "Android" as local name if no property exist (unlikely) * Use local name if config stored return in an empty string This way we are preventing new wrong usage while also fixing existing wrong config also, nit cleanup on some native struct initialization Bug: 393733290 Bug: 395178934 Test: atest CtsBluetoothTestCases Test: manual set the name to null and check no crash Flag: com.android.bluetooth.flags.empty_name_are_invalid Change-Id: I0cb23cd26ca2273dcccda47e147183117777d920
Loading
Please register or sign in to comment