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

fix(dashpay): update image permissions for Android 13 and fix camera #1235

Merged
merged 7 commits into from
Dec 20, 2023

Conversation

HashEngineering
Copy link
Collaborator

@HashEngineering HashEngineering commented Dec 6, 2023

Issue being fixed or feature implemented

  • Support Android 13 (images)
  • Refactor to use ActivityResultLauncher

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

@HashEngineering HashEngineering self-assigned this Dec 6, 2023
@HashEngineering HashEngineering changed the base branch from dashpay to dashpay-feature-coinjoin-synced December 6, 2023 18:36
@@ -73,6 +73,7 @@ class CropImageActivity : LockScreenActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityCropImageBinding.inflate(layoutInflater)
setContentView(binding.root)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was left out from the previous refactoring.

@HashEngineering HashEngineering changed the title Dashpay bugfix android 13 camera fix(dashpay): update image permissions for Android 13 and fix camera Dec 6, 2023
Comment on lines -20 to +21
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change for Android 13.

Comment on lines +221 to +226
takePictureLauncher = registerForActivityResult(ActivityResultContracts.TakePicture()) { isSuccess: Boolean ->
if (isSuccess) {
editProfileViewModel.onTmpPictureReadyForEditEvent.postValue(editProfileViewModel.tmpPictureFile)
}
turnOnAutoLogout()
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This refactoring also solved the problem of failure of the camera on Android 12 and 14 emulators, though the old code did work on a real Android 13 device.

@HashEngineering HashEngineering marked this pull request as ready for review December 12, 2023 04:44
@@ -199,6 +199,6 @@ class HistoryHeaderAdapter(

private fun shouldShowJoinDashPay(canJoin: Boolean): Boolean {
val hideJoinDashPay = preferences.getBoolean(PREFS_KEY_HIDE_JOIN_DASHPAY_CARD, false)
return blockchainIdentityData == null && canJoin && !hideJoinDashPay
return blockchainIdentityData?.creationState == BlockchainIdentityData.CreationState.NONE && canJoin && !hideJoinDashPay
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what will show the Join DashPay on the home screen. Changes regarding blockchainIdentityData (perhaps migration from a DB table to DataStore) broke this and always returned false.

Copy link
Member

@Syn-McJ Syn-McJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@HashEngineering HashEngineering changed the base branch from dashpay-feature-coinjoin-synced to dashpay December 20, 2023 20:47
@HashEngineering HashEngineering merged commit 479ccd8 into dashpay Dec 20, 2023
1 check failed
@HashEngineering HashEngineering deleted the dashpay-bugfix-android-13-camera branch January 5, 2024 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants