Fixed
Status Update
Comments
je...@google.com <je...@google.com>
au...@google.com <au...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Or when changing to textView.textMetricsParamsCompat still crash.
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
jb...@google.com <jb...@google.com> #3
add this line :
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
Description
Version used: 1.0.1
Devices/Android versions reproduced on: n/a
Right now, AFAICT, ActivityCompat.requestPermissions() performs no validation on the parameters. Ideally, it would at least check the String[] of permissions to confirm that the elements are sane (i.e., not null, not empty).
Otherwise, failures happen deep in the system. For example, if you pass null in one of the array elements, the eventual NullPointerException actually occurs in com.android.packageinstaller.permission.ui.GrantPermissionsActivity. See
Thanks for considering this!