Defer service requests if the app hasn't finished startup
If an app is still in the 'pending finish attach' state, we should not schedule any service requests to the app because: 1. Pending requests will be dispatched as soon as its startup completes 2. Even if we dispatch a request, it doesn't actually expedite the request because it will be blocked on the apps main thread which is currently busy starting up. 3. Lastly and most importantly, this could lead to multiple onCreate requests to the same service when the app completes startup if there were multiple bind requests prior to its startup. This is easy to repro with a test app that sleeps in the Application#onCreate while a bindService is sent multiple times during the sleep. Test: Manual (CTS pending) Bug: 289688173 Change-Id: Iedaa62354418428a98b612067dd6439daf9dd530
Loading
Please register or sign in to comment