Skip to content

Commit

Permalink
bugfix: crash on content provider permission denial
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Dec 19, 2021
1 parent 86c7c39 commit d4cec67
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
.setPositiveButton(android.R.string.ok, (dialog1, which) -> popSelf())
.show());
}
} catch (IOException e) {
} catch (IOException | SecurityException e) {
ThreadManager.runOnUiThread(() -> new AlertDialog.Builder(context)
.setTitle(R.string.ui_dialog_error_title)
.setMessage(context.getString(R.string.ui_dialog_unable_to_open_file_v0s, uri.toString())
+ "\n" + e)
+ "\n" + e.getMessage())
.setCancelable(false)
.setPositiveButton(android.R.string.ok, (dialog1, which) -> popSelf())
.show());
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/dialog_bsd_hal_operation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
android:paddingTop="12dp"
android:paddingRight="16dp"
android:paddingBottom="12dp"
android:text="@string/action_submit"
android:text="@string/action_confirm"
android:textColor="?colorAccent"
android:textSize="16sp" />

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ NCI Host 的开发人员不对使用此应用程序造成的任何损失负责
<string name="ui_dialog_error_message_invalid_input_syntax_v0s">输入的数据格式有误: %s</string>
<string name="action_decoder_config">解码选项</string>
<string name="ui_hal_dump_decoder_config_title">解码选项</string>
<string name="action_confirm">确认</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ By using this application, you accept all responsibility using it and agree that
<string name="ui_dialog_error_message_invalid_input_syntax_v0s">Invalid input: %s</string>
<string name="action_decoder_config">Decoder properties</string>
<string name="ui_hal_dump_decoder_config_title">Decoder Properties</string>
<string name="action_confirm">Confirm</string>
</resources>

0 comments on commit d4cec67

Please sign in to comment.