Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Improve energy efficiency by applying Dynamic Retry Delay Energy Pattern + Cache Energy Pattern #34

Closed

Conversation

anasofiagribeiro
Copy link

This improves the energy efficiency of SecondScreen by applying the Dynamic Retry Delay Energy Pattern and the Cache Energy Pattern for mobile applications.

The energy pattern was applied in RouterActivity.java and AndroidManifest.xml (for the Dynamic Retry Delay Energy Pattern) and TLSSocketFactoryCompat.java (for the Cache Energy Pattern). The general idea for the first one is to avoid accessing an internet connection if the connection is down . In particular, a class NetworkStateReceiver will be created in the java file that checks for an internet connection. The general idea for the second one is to avoid performing unnecessary operations by using cache mechanisms. In particular, setting the cache size to have no limit.

@wb9688
Copy link
Contributor

wb9688 commented Jul 23, 2020

Please make a PR to TeamNewPipe/NewPipe. PRs to this repo should only contain fixes specifically for older devices.

Copy link
Member

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!
As wb9688 already said, this repository is mostly for applying fixes for devices with Android versions < 4.4. So please open the PR in the repo for the regular app. Changes will be merged into this repo.

In general: Please add more comments to the code so one can easily read and understand the code without looking at the PR description.

@@ -25,18 +22,28 @@
private static TLSSocketFactoryCompat instance = null;

private SSLSocketFactory internalSSLSocketFactory;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the added white spaces.

@@ -745,6 +751,60 @@ public void onDestroy() {
.setContentText(
getString(R.string.preferred_player_fetcher_notification_message));
}

boolean checkNetwork() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a more descriptive method name and add the access modifier to the method.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants