Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
  • Fiouz's avatar
    c416f02d
    Improve BACK button handling for MessageView · c416f02d
    Fiouz authored
    Remove memory leak from referencing MessageView context from the
    Intent that is created to go back to MessageList. MessageView is no
    longer hardcoded to go back to MessageList, it instead uses an Intent
    given at creation to get back to the originating Activity.
    
    Try our best to restore the MessageList in its previous state when
    "Manage BACK button" option is enabled:
    Since MessageList lives in its own task, we look for the previous
    active task and check whether its top activity matches it. If it does,
    we just finish MessageView and Android will automatically restore the
    previous task. If it doesn't, we launch the originating Intent (and
    MessageList state will be lost).
    
    If option is off, we get the regular Android behavior: got back to the
    previous screen, whenever it's the MessageList or another application
    if the user long-pressed HOME.
    
    The consequence of this is the need for a new permission in order to
    check the previous active task: android.permission.GET_TASKS
    c416f02d
    Improve BACK button handling for MessageView
    Fiouz authored
    Remove memory leak from referencing MessageView context from the
    Intent that is created to go back to MessageList. MessageView is no
    longer hardcoded to go back to MessageList, it instead uses an Intent
    given at creation to get back to the originating Activity.
    
    Try our best to restore the MessageList in its previous state when
    "Manage BACK button" option is enabled:
    Since MessageList lives in its own task, we look for the previous
    active task and check whether its top activity matches it. If it does,
    we just finish MessageView and Android will automatically restore the
    previous task. If it doesn't, we launch the originating Intent (and
    MessageList state will be lost).
    
    If option is off, we get the regular Android behavior: got back to the
    previous screen, whenever it's the MessageList or another application
    if the user long-pressed HOME.
    
    The consequence of this is the need for a new permission in order to
    check the previous active task: android.permission.GET_TASKS
Loading