Implement quick settings toggle button #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to Oblivion – Quick Settings Connection Toggle Button.
Quick Settings or Tile Buttons, provide users with convenient access to easily connect or disconnect through notification panel without opening the app itself.
MainActivity and ObvilionVpnService classes were heavily refactored. The notification tile button needed to be in sync with MainActivity button. They're now using observer pattern done through message passing.
The connection state now resides inside ObvilionVpnService and other components interested in connection status can observe it by registering an observer. This is done to have a single "source-of-truth" for the connection state.
The new pattern is tested on several Samsung devices running Android 11-14 and works perfectly. However this is Android's world. A feature working great on a phone might work terrible on another OEM. I think it's better to have it tested on other OEMs too.