Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System 1418/update network plugin #19

Merged
merged 41 commits into from
Jan 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d79284c
Add network profile list and signal strength list files
cmajed Dec 2, 2022
719982a
Parse android version from settings redis channel.
gvercoutere-geny Dec 2, 2022
7112f7f
Add new input lists and wifi checkbox
cmajed Dec 2, 2022
11775b2
Extract network_profile and baseband callback in functions.
gvercoutere-geny Dec 2, 2022
33c8707
Update mobile profiles.
gvercoutere-geny Dec 2, 2022
64f2831
Send a redis message when a mobile profile is selected on the list.
gvercoutere-geny Dec 2, 2022
7970579
Add checkbox for wifi and mobile
cmajed Dec 2, 2022
48beeae
Implement enable/disable wifi/mobile when checkbox state changes
cmajed Dec 2, 2022
2fb8576
Update mobile profile list UI when a new value is received with redis.
gvercoutere-geny Dec 2, 2022
8a4bdd3
On click on the "Update" button, don't send mobile profile info when
gvercoutere-geny Dec 2, 2022
d9ba301
Signal Strength : Send a redis message when a mobile profile is selec…
gvercoutere-geny Dec 2, 2022
de0129d
Update mobile/wifi checkbox UI when a new status is received with redis.
gvercoutere-geny Dec 2, 2022
1f3ca17
Mobile profile : don't show 5g item if android version < 10
gvercoutere-geny Dec 2, 2022
5f3bebb
Update interface status on refresh
cmajed Dec 5, 2022
8ff875f
Update mobile network detail when profile or signal strength changes
cmajed Dec 5, 2022
f662e32
Remove sim and operator details from network widget
cmajed Dec 5, 2022
6d891ce
Better manage enabling/disabling mobile
cmajed Dec 5, 2022
d39a699
New widget to handle removed baseband from network widget
cmajed Dec 5, 2022
6d6bec8
Show wifi and mobile checkbow only for android > 8.0
cmajed Dec 6, 2022
a2f73b0
Fix ui and android < 8 update troubles
cmajed Dec 9, 2022
d7f98c1
Rename Sim plugin
cmajed Dec 12, 2022
6aded15
Add Baseband section to the Features & options paragraph
cmajed Dec 13, 2022
b0aefad
Rework 'network' feature text following baseband split
gvercoutere-geny Dec 13, 2022
f562363
Update network widget UI according to review remarks
cmajed Dec 16, 2022
e54699c
Several corrections after review
cmajed Dec 16, 2022
ab4fcdc
Update Readme file
cmajed Dec 16, 2022
a3a703f
Update network test to resolve errors
cmajed Dec 19, 2022
22aa78d
Move baseband related test frop network to new test file
cmajed Dec 19, 2022
4bcf57d
Init androidVersion to ''
cmajed Dec 19, 2022
dd71ec3
Resolve yarn lin errors
cmajed Dec 19, 2022
c9b82e9
Rework after review
cmajed Dec 20, 2022
48a3bbd
Add new option for mobile throttling support
cmajed Dec 20, 2022
6bf2999
Uses capabilities for mobilethrottling and 5G support
cmajed Jan 3, 2023
a4c7b26
Create widget elements when needed instead of hiding unhiding them
cmajed Jan 4, 2023
a93dfae
Do nothing when calling disable5G
cmajed Jan 4, 2023
bc1d2c1
Handle random error
cmajed Jan 4, 2023
5f92995
Put bac section and fields in baseband scss file
cmajed Jan 4, 2023
f9dbddd
Remove no needed check
cmajed Jan 6, 2023
ece997a
Remove duplicated baseabnd section from readme file
cmajed Jan 11, 2023
4b0a253
Rename NETWORK to BASEBAND
cmajed Jan 11, 2023
3d753f5
Add name attribute to some fields needed for autotests
cmajed Jan 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions src/plugins/Network.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,16 @@ module.exports = class Network extends OverlayPlugin {
const dnsDelay = values[8].split(':');

if (this.androidVersion < 8) {
pgivel marked this conversation as resolved.
Show resolved Hide resolved
const isThrottlingEnabled = upSpeed[1] === 'enabled'
&& downSpeed[1] === 'enabled'
&& upDelay[1] === 'enabled'
&& downDelay[1] === 'enabled'
&& upPacketLoss[1] === 'enabled'
&& downPacketLoss[1] === 'enabled'
&& dnsDelay[1] === 'enabled';

const profile = PROFILES.find((elem) => {
const isThrottlingEnabled =
upSpeed[1] === 'enabled'
&& downSpeed[1] === 'enabled'
&& upDelay[1] === 'enabled'
&& downDelay[1] === 'enabled'
&& upPacketLoss[1] === 'enabled'
&& downPacketLoss[1] === 'enabled'
&& dnsDelay[1] === 'enabled';

const profile = PROFILES.find((elem) => {
return elem.downSpeed.value === parseFloat(downSpeed[2]) &&
elem.downDelay.value === parseFloat(downDelay[2]) &&
elem.downPacketLoss.value === parseFloat(downPacketLoss[2]) &&
Expand All @@ -139,6 +140,13 @@ module.exports = class Network extends OverlayPlugin {

this.setActiveMobileProfile(mobileProfile[1]);
this.setActiveSignalStrength(signalStrength[1]);
this.updateDetail('downSpeed', downSpeed[2], downSpeed[1] === "disabled");
this.updateDetail('upSpeed', upSpeed[2], upSpeed[1] === "disabled");
this.updateDetail('downDelay', downDelay[2], downDelay[1] === "disabled");
this.updateDetail('upDelay', upDelay[2], upDelay[1] === "disabled");
this.updateDetail('downPacketLoss', downPacketLoss[2], downPacketLoss[1] === "disabled");
this.updateDetail('upPacketLoss', upPacketLoss[2], upPacketLoss[1] === "disabled");
this.updateDetail('dnsDelay', dnsDelay[2], dnsDelay[1] === "disabled");
}
}

Expand Down Expand Up @@ -697,4 +705,22 @@ module.exports = class Network extends OverlayPlugin {
}
}
}

/**
* Update mobile signal Detail information.
*
* @param {string} detail Signal detail to update.
* @param {string} value New signal detail value.
* @param {string} reset If true ignore value and set "".
*/
updateDetail(detail, value, reset) {
if(! detail) {
pgivel marked this conversation as resolved.
Show resolved Hide resolved
return;
}
if (reset) {
this.fields[detail].innerHTML = "";
} else {
this.fields[detail].innerHTML = value;
}
}
};