Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera icon not show in Android 12 #129

Closed
young310 opened this issue Sep 1, 2022 · 13 comments
Closed

Camera icon not show in Android 12 #129

young310 opened this issue Sep 1, 2022 · 13 comments
Labels

Comments

@young310
Copy link

young310 commented Sep 1, 2022

Describe the bug
In MessageFragment, when you click the picture button, only album will show.
The camera button never shows in Android 12 and above.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any chat message fragment
  2. Click on the picture button
  3. See error. It will go album directly, but not showing options(camera, or album)

Expected behavior
There should be at least two options (camera, or album)

Screenshots
N/A

Tindroid (please complete the following information):

  • Version 0.20
  • Device Pixcel 6 with Android 12
  • Android API Version 31

Server

  • own setup
  • Server type [unmodified]
  • Server version [e.g. 0.20.0]

Additional context
N/A

@young310 young310 added the bug label Sep 1, 2022
@or-else
Copy link
Contributor

or-else commented Sep 1, 2022

Fixed in e8a1294

@young310
Copy link
Author

young310 commented Sep 2, 2022

@or-else
We have the camera button now, but the image preview is broken.
Screenshot_20220902-123431

@or-else
Copy link
Contributor

or-else commented Sep 2, 2022

Please list steps to reproduce.

@young310
Copy link
Author

young310 commented Sep 2, 2022

Please list steps to reproduce.

I record the operation for reference.

  1. click on the chatting group ( 1-on-1 )
  2. click on the picture icon
  3. click on the camera button
  4. take picture as usual and click on the ok button
  5. broken preview

The above operation are tested using the next branch.

Untitled.mp4

@or-else
Copy link
Contributor

or-else commented Sep 2, 2022

Fixed in b9954ce
Thanks!

@young310
Copy link
Author

young310 commented Sep 4, 2022

@or-else Confirm b9954ce works for pixel with Android 12
But data become null again on Android 10 (which means no preview, no picture sends)

XRecorder_04092022_234840.mp4

@or-else
Copy link
Contributor

or-else commented Sep 4, 2022

I cannot reproduce it with stock camera. It seems like you are using a custom camera app. Please show the logcat.

@young310
Copy link
Author

young310 commented Sep 4, 2022

@or-else
I do not see any error messages, so I tried to print the variable data but returns null value.
logcat.txt

@or-else
Copy link
Contributor

or-else commented Sep 4, 2022

What variable returns null value?
I tested on API 29 emulator and it worked as expected.

@or-else
Copy link
Contributor

or-else commented Sep 4, 2022

Re: logcat. Please include the log from the camera app too.

@young310
Copy link
Author

young310 commented Sep 4, 2022

@or-else Since you moved "final Intent data = result.getData();" to line:226, I print it out right after it and get null value.
Which means there is no change to run activity.showFragment at line 246.
I do not use my own camera app; the camera app shipped with Samsung Galaxy A50.

@or-else
Copy link
Contributor

or-else commented Sep 4, 2022

If result.getData() returns null, then your camera app returns no data. Essentially the camera took the picture but did not return anything to the calling app. That's something specific to your phone.

Please change

final Intent data = result.getData();
if (data == null) {
return;
}
Uri localUri = data.getData();

to

                final Intent data = result.getData();
                Uri localUri = data != null ? data.getData() : null;

and see if it fixes the problem.

@young310
Copy link
Author

young310 commented Sep 4, 2022

@or-else It works now, both on Android 10 and Android 12. Thanks!

or-else added a commit that referenced this issue Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants