enviroCar / enviroCar-app

enviroCar Android Application
https://envirocar.org
GNU General Public License v3.0
87 stars 153 forks source link

Dagger DI implementation for BaseAimybox, fixes Aimybox multi-instantiation bug #995

Closed devAyushDubey closed 8 months ago

devAyushDubey commented 9 months ago

Under GSoC '23

Introduces Dagger Dependency Injection in the VoiceCommand module, for BaseAimybox class.

Also fixes #986

This PR does the following:

Reasons:

  1. Due to use of BaseAimyboxViewModel viz. essentially for Aimybox UI components, we differed from the default application scoped implementation of Aimybox, which also resulted in #986

  2. As fundamentally, there should only be one running instance of Aimybox in an application, using Dagger Singleton Scope we ensure this.

  3. BaseAimybox provides functionalities that are used by many other UI elements (Activities/ Fragments), this results in high coupling between classes, with Dagger we address this.

devAyushDubey commented 9 months ago

Hey @cdhiraj40 @SebaDro , requesting a review. Thanks 🙂