-
Notifications
You must be signed in to change notification settings - Fork 171
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
Conversation
@@ -73,6 +73,7 @@ class CropImageActivity : LockScreenActivity() { | |||
override fun onCreate(savedInstanceState: Bundle?) { | |||
super.onCreate(savedInstanceState) | |||
binding = ActivityCropImageBinding.inflate(layoutInflater) | |||
setContentView(binding.root) |
There was a problem hiding this comment.
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.
<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"/> |
There was a problem hiding this comment.
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.
takePictureLauncher = registerForActivityResult(ActivityResultContracts.TakePicture()) { isSuccess: Boolean -> | ||
if (isSuccess) { | ||
editProfileViewModel.onTmpPictureReadyForEditEvent.postValue(editProfileViewModel.tmpPictureFile) | ||
} | ||
turnOnAutoLogout() | ||
} |
There was a problem hiding this comment.
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.
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Issue being fixed or feature implemented
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: