Fixed
Status Update
Comments
ve...@google.com <ve...@google.com> #2
Thank you for reporting this issue. For us to further analyze this issue more efficiently, please provide the following additional information:
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Android bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Screen record of the issue, for clarity
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Android bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method
After reproducing the issue, navigate to “developer settings”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Screen record of the issue, for clarity
Please capture screen record or video of the issue using following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4
Attach the file to this issue.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
ve...@google.com <ve...@google.com> #3
Please share the details requested in comment #2 , to proceed further with the bug.
ma...@gmail.com <ma...@gmail.com> #4
I believe I have already provided adequate information in my original comment to start investigating this bug.
Asking me to invest more time in creating a sample project, when you haven’t even commented on what I have noted already is not respectful of my time. At the very least, I would appreciate you taking the time to read what I have written, comment on what you think is still missing, and then ask me for that.
I have also included the relevant logcat output, and the issue is straightforward enough for any engineer with basic Android knowledge to understand, and is 100% reproducible.
If you are unable to proceed further, or uninterested in fixing this issue, please feel free to close it.
Asking me to invest more time in creating a sample project, when you haven’t even commented on what I have noted already is not respectful of my time. At the very least, I would appreciate you taking the time to read what I have written, comment on what you think is still missing, and then ask me for that.
I have also included the relevant logcat output, and the issue is straightforward enough for any engineer with basic Android knowledge to understand, and is 100% reproducible.
If you are unable to proceed further, or uninterested in fixing this issue, please feel free to close it.
ve...@google.com <ve...@google.com> #5
We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
ve...@google.com <ve...@google.com> #6
Please check this issue on Q Beta 4 build and share the observation.
Please refer the updated "Conditions that allow for activity starts" documentation:
https://developer.android.com/preview/privacy/background-activity-starts#conditions-allow-activity-starts
Specifically, "The app has an activity that was started very recently" addresses the issue you reported.
Please refer the updated "Conditions that allow for activity starts" documentation:
Specifically, "The app has an activity that was started very recently" addresses the issue you reported.
ve...@google.com <ve...@google.com> #7
Please share the details requested in comment #6 , to proceed further with the bug.
ma...@gmail.com <ma...@gmail.com> #8
Thanks, yes, this is now fixed in Q Beta 4.
Description
* Is this a regression from P to Q? Yes
* What device are you using? (for example, Pixel XL): Emulator
* What are the steps to reproduce the problem?
Step 1. AndroidManifest.xml
1. <activity
2. android:name=".TrampolineActivity"
3. android:theme="@android:style/Theme.NoDisplay">
4. </activity>
Step 2. TrampolineActivity.java
1. public class TrampolineActivity extends AppCompatActivity {
2.
3. // ...
4.
5. @Override
6. protected void onCreate(Bundle savedInstanceState) {
7. super.onCreate(savedInstanceState);
8.
9. new AsyncTask<Void, Void, ParsedIntent>() {
10. @Override
11. protected ParsedIntent doInBackground(Void... voids) {
12. return parseIncomingIntent(getIntent());
13. }
14.
15. @Override
16. protected void onPostExecute(ParsedIntent parsedIntent) {
17. startActivity(createForwardedIntent(parsedIntent));
18. }
19. }.execute();
20.
21. finishAndRemoveTask();
22. }
23. }
Step 3. User launches TrampolineActivity from the launcher.
* What was the expected result?
TrampolineActivity successfully launches a different Activity on line 17.
* What was the actual result?
startActivity on line 17 fails, only on Q.
* Relevant logcat output.
W/ActivityTaskManager: Background activity start [
callingPackage: com.example;
callingUid: 12345;
isCallingUidForeground: false;
isCallingUidPersistentSystemProcess: false;
realCallingUid: 12345;
isRealCallingUidForeground: false;
isRealCallingUidPersistentSystemProcess: false;
originatingPendingIntent: null;
isBgStartWhitelisted: false;
intent: Intent {
act=android.intent.action.VIEW
dat=
cmp=com.example/.TargetActivity
};
callerApp: ProcessRecord{a6a0cd 16123:com.example/u0a131}
]
* Notes:
- When user launches TrampolineActivity via an explicit user action, it is a foreground task (without a doubt).
- parseIncomingIntent() requires disk access, so a good practice is to perform it on a background thread to prevent ANRs, to be a good citizen, and to provide a good user experience.
- When the AsyncTask completes, startActivity on line 17 is really in response to a user-initiated action, but the Platform does not see it that way. (*bug*)
In general, restricting background activity starts is a good idea, but in this particular edge case, it requires us to implement workarounds that make the user experience worse (e.g. by doing long processing on the main thread simply to get around this restriction.)
Please reconsider how an Activity start is detected as being not in response to a user-initiated action, e.g. allowed within x milliseconds of a user-initiated action.
* Issue Category: Framework (platform)
* Can you provide the API document where this expected behavior is explained?