Skip to content

App gets stuck if permission is revoked #43

Open
@aper-project

Description

@aper-project

Hi, there, I found NotePad v1.5.4 (downloaded from F-Droid) getting stuck if the permission is denied.

I seems that it is related to the dangerous permission android.permission.WRITE_EXTERNAL_STORAGE and is triggered during the following call chain:

org.openintents.notepad.activity.SaveFileActivity.onCreate(android.os.Bundle)void
  org.openintents.notepad.activity.SaveFileActivity.getFilenameFromNoteTitle(android.net.Uri)android.net.Uri
    org.openintents.notepad.activity.SaveFileActivity.getSdCardPath()java.io.File
      android.os.Environment.getExternalStorageDirectory()java.io.File

This call chain does not involves either permission checking (via checkSelfPermission) nor permission request (via requestPermissions) to the corresponding permission, which may produce unexpected consequence.

Reproduce bug

In fact, I found this lack of permission management causes the app getting stuck on my Samsung device, following the steps:

  1. enter the app and click "create note" at top-right
  2. type some texts
  3. click "save to sd card" on the top-right option menu
  4. select deny on the pop-up window (which requests a storage permission) and the app gets stuck

@friedger
Could you help me review this issue? If you need more information, I may make a video for this. Very thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions