Loading
Initialize ProtoLog once on first activity launch
Fixes an IllegalStateException crash caused by using ProtoLog before it was initialized. This could happen in UI processes where logging code was called during the activity lifecycle before ProtoLog.start() was invoked. This change moves the initialization to handleLaunchActivity(), ensuring it runs in processes that have a UI. A static boolean, sProtoLogInitialized, is used to guarantee that the initialization occurs only once per process, on the first activity launch. The ProtoLog initialization here will be guarded by a flag to roll out gradually and safely. Bug: 432646252 Flag: android.tracing.imetracker_protolog Change-Id: Ia9160a26702550d7bc7ef6a0c2e1e7e4f4cdf490