so performance optimization is a major concern in automotive infotainment like it should not lag it should not display black screen RL and all that so we faced some issues while I was working in con man feature so yeah I have faced these kind of issues so let me describe you first the issue and how we have resolved that so the issue was like there is a requirement when android auto or CarPlay is connected and user do cold start after cold start whatever source was connected it should connect again automatically and it should play like if android auto music is playing then after cold start also it should play but we were received an issue that after cold start con man shows black screen and black screen and also it is taking some time to connect android auto back again and starting the android auto music sometimes like three out of 15 occurrence is there so it was a sporadic issue so we have to anyhow tackle that issue so what we have done is we have removed all the long running tasks from main thread and also whatever UI we need to update to the user we have added that to main thread and other than that all the API calls or database calls are moved to background thread or another thread so that is one point another point we have prioritized the items that are required after startup after cold boot so like if previously android auto is connected then after startup after cold boot we are prioritizing android auto related items or android auto related things like from database we have fetched data particularly android auto device only and other devices data is not required at that time so we have filtered out that so this kind of small optimizations lead to like major improvement in performance optimization performance of con man feature con man application so yeah we have optimized performance for con man application in that way also we have removed unused code and prioritize the data prioritize the items that are required at that time and moving long running tasks to another thread is a major factor for performance improvement
