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

Skip to content

tech:148: Refac app list repository to handle apps with location permission.

Guillaume Jacquart requested to merge 148-tech_refac_displayableapp into main

Description

Technical MR, to refactor the preparation of the list of installed apps on the device, which is a complicated part of the AdvancedPrivacy app.

It also prepare the implementation of the whitelist app for Fakelocation feature.

Screenshots

No changes.

Technical details

Previous implementation relied on separated list for each categories of apps :

  • one for the "compatibilities apps", which are all hidden behind the compatibility app on the UI
  • one for the hidden system components, which are all hidden behind the system app in the UI
  • one for the other apps, and it separated by profiles types.

This lead to complicated algorythm when the user apply setting on the system or compatibility dummy app.

This MR implement a different approch : we manipulate a new model of app in the ui : the DisplayableApp . And each of them hold a list of real. This new type hold also a variety of flags which allow to easily filter the list of app we want to display in each specific places.

Tests

Issues

related to &148 (closed)

10 commandments of code reviews

👪 https://gitlab.e.foundation/internal/wiki/-/wikis/mobile-team/guidelines/Code-review

Summary by CodeRabbit

  • New Features

    • Major improvements to application management and data representation using a new DisplayableApp model.
    • Enhanced background processing with a new coroutine scope setup.
    • Streamlined application retrieval logic for better efficiency.
    • New functionality for managing app states through a ToggleableApp class.
    • Enhanced app privacy management features with targeted handling of applications using Tor.
  • Bug Fixes

    • Resolved issues with application identifiers and improved data handling in the UI.
  • Refactor

    • Replaced all instances of ApplicationDescription with DisplayableApp across multiple components.
    • Simplified the structure and logic in various use cases and adapters to support the new data model.
    • Improved the repository interface for application data management.
  • Chores

    • Updated copyright notices across several files to reflect 2024.
Edited by CodeRabbitAI

Merge request reports

Loading