Loading lineage/res/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- SPDX-FileCopyrightText: 2014 The CyanogenMod Project SPDX-FileCopyrightText: 2017 The LineageOS Project SPDX-FileCopyrightText: 2017-2026 The LineageOS Project SPDX-License-Identifier: Apache-2.0 --> <resources> Loading lineage/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- SPDX-FileCopyrightText: 2015 The CyanogenMod Project SPDX-FileCopyrightText: 2017-2025 The LineageOS Project SPDX-FileCopyrightText: 2017-2026 The LineageOS Project SPDX-License-Identifier: Apache-2.0 --> <resources> Loading sdk/src/java/lineageos/providers/LineageSettings.java +11 −1 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2015-2016 The CyanogenMod Project * SPDX-FileCopyrightText: 2017-2025 The LineageOS Project * SPDX-FileCopyrightText: 2017-2026 The LineageOS Project * SPDX-License-Identifier: Apache-2.0 */ Loading Loading @@ -2918,6 +2918,15 @@ public final class LineageSettings { /** @hide */ public static final Validator NETWORK_TRAFFIC_AUTOHIDE_VALIDATOR = sBooleanValidator; /** * Whether or not to hide network traffic direction arrows * @hide */ public static final String NETWORK_TRAFFIC_HIDE_ARROWS = "network_traffic_hide_arrows"; /** @hide */ public static final Validator NETWORK_TRAFFIC_HIDE_ARROWS_VALIDATOR = sBooleanValidator; /** * Measurement unit preference for network traffic * 0 = kBit/s Loading Loading @@ -3004,6 +3013,7 @@ public final class LineageSettings { VALIDATORS.put(NETWORK_TRAFFIC_MODE, NETWORK_TRAFFIC_MODE_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_POSITION, NETWORK_TRAFFIC_POSITION_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_AUTOHIDE, NETWORK_TRAFFIC_AUTOHIDE_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_HIDE_ARROWS, NETWORK_TRAFFIC_HIDE_ARROWS_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_UNITS, NETWORK_TRAFFIC_UNITS_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_SHOW_UNITS, NETWORK_TRAFFIC_SHOW_UNITS_VALIDATOR); VALIDATORS.put(TRUST_WARNINGS, TRUST_WARNINGS_VALIDATOR); Loading sdk/src/java/org/lineageos/internal/statusbar/LineageStatusBarItem.java +8 −6 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2018 The LineageOS project * SPDX-FileCopyrightText: 2018-2026 The LineageOS project * SPDX-License-Identifier: Apache-2.0 */ Loading @@ -14,17 +14,19 @@ import java.util.ArrayList; public class LineageStatusBarItem { public interface Manager { public void addDarkReceiver(DarkReceiver darkReceiver); public void addVisibilityReceiver(VisibilityReceiver visibilityReceiver); void addDarkReceiver(DarkReceiver darkReceiver); void removeDarkReceiver(DarkReceiver darkReceiver); void addVisibilityReceiver(VisibilityReceiver visibilityReceiver); void removeVisibilityReceiver(VisibilityReceiver visibilityReceiver); } public interface DarkReceiver { public void onDarkChanged(ArrayList<Rect> areas, float darkIntensity, int tint); public void setFillColors(int darkColor, int lightColor); void onDarkChanged(ArrayList<Rect> areas, float darkIntensity, int tint); void setFillColors(int darkColor, int lightColor); } public interface VisibilityReceiver { public void onVisibilityChanged(boolean isVisible); void onVisibilityChanged(boolean isVisible); } // Locate parent LineageStatusBarItem.Manager Loading sdk/src/java/org/lineageos/internal/statusbar/NetworkTraffic.java +26 −6 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2017-2025 The LineageOS project * SPDX-FileCopyrightText: 2017-2026 The LineageOS project * SPDX-License-Identifier: Apache-2.0 */ Loading Loading @@ -93,6 +93,7 @@ public class NetworkTraffic extends TextView { private long mLastRxBytes; private long mLastUpdateTime; private boolean mAutoHide; private boolean mHideArrows; private long mAutoHideThreshold; private int mUnits; private int mShowUnits; Loading @@ -109,6 +110,8 @@ public class NetworkTraffic extends TextView { // to current stats have changed. private boolean mNetworksChanged = true; private LineageStatusBarItem.Manager mManager; public NetworkTraffic(Context context) { this(context, null); } Loading Loading @@ -394,10 +397,11 @@ public class NetworkTraffic extends TextView { protected void onAttachedToWindow() { super.onAttachedToWindow(); LineageStatusBarItem.Manager manager = LineageStatusBarItem.findManager((View) this); manager.addDarkReceiver(mDarkReceiver); manager.addVisibilityReceiver(mVisibilityReceiver); mManager = LineageStatusBarItem.findManager(this); if (mManager != null) { mManager.addDarkReceiver(mDarkReceiver); mManager.addVisibilityReceiver(mVisibilityReceiver); } mObserver.observe(); updateSettings(); Loading @@ -406,7 +410,15 @@ public class NetworkTraffic extends TextView { @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mManager != null) { mManager.removeDarkReceiver(mDarkReceiver); mManager.removeVisibilityReceiver(mVisibilityReceiver); mManager = null; } mObserver.unobserve(); mTrafficHandler.removeCallbacksAndMessages(null); unregisterNetworkCallbacks(); } Loading @@ -426,6 +438,9 @@ public class NetworkTraffic extends TextView { resolver.registerContentObserver(LineageSettings.Secure.getUriFor( LineageSettings.Secure.NETWORK_TRAFFIC_AUTOHIDE), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(LineageSettings.Secure.getUriFor( LineageSettings.Secure.NETWORK_TRAFFIC_HIDE_ARROWS), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(LineageSettings.Secure.getUriFor( LineageSettings.Secure.NETWORK_TRAFFIC_UNITS), false, this, UserHandle.USER_ALL); Loading Loading @@ -457,6 +472,8 @@ public class NetworkTraffic extends TextView { LineageSettings.Secure.NETWORK_TRAFFIC_POSITION, POSITION_CENTER); mAutoHide = LineageSettings.Secure.getInt(resolver, LineageSettings.Secure.NETWORK_TRAFFIC_AUTOHIDE, 0) == 1; mHideArrows = LineageSettings.Secure.getInt(resolver, LineageSettings.Secure.NETWORK_TRAFFIC_HIDE_ARROWS, 0) == 1; mUnits = LineageSettings.Secure.getInt(resolver, LineageSettings.Secure.NETWORK_TRAFFIC_UNITS, UNITS_KILOBYTES); mShowUnits = LineageSettings.Secure.getInt(resolver, Loading Loading @@ -495,7 +512,9 @@ public class NetworkTraffic extends TextView { private void updateTrafficDrawable() { final int drawableResId; if (mMode == MODE_UPSTREAM_AND_DOWNSTREAM) { if (mHideArrows) { drawableResId = 0; } else if (mMode == MODE_UPSTREAM_AND_DOWNSTREAM) { drawableResId = R.drawable.stat_sys_network_traffic_updown; } else if (mMode == MODE_UPSTREAM_ONLY) { drawableResId = R.drawable.stat_sys_network_traffic_up; Loading @@ -505,6 +524,7 @@ public class NetworkTraffic extends TextView { drawableResId = 0; } mDrawable = drawableResId != 0 ? getResources().getDrawable(drawableResId) : null; setCompoundDrawablePadding(0); setCompoundDrawablesWithIntrinsicBounds(null, null, mDrawable, null); updateTrafficDrawableColor(); } Loading Loading
lineage/res/res/values/dimens.xml +1 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- SPDX-FileCopyrightText: 2014 The CyanogenMod Project SPDX-FileCopyrightText: 2017 The LineageOS Project SPDX-FileCopyrightText: 2017-2026 The LineageOS Project SPDX-License-Identifier: Apache-2.0 --> <resources> Loading
lineage/res/res/values/symbols.xml +1 −1 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- SPDX-FileCopyrightText: 2015 The CyanogenMod Project SPDX-FileCopyrightText: 2017-2025 The LineageOS Project SPDX-FileCopyrightText: 2017-2026 The LineageOS Project SPDX-License-Identifier: Apache-2.0 --> <resources> Loading
sdk/src/java/lineageos/providers/LineageSettings.java +11 −1 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2015-2016 The CyanogenMod Project * SPDX-FileCopyrightText: 2017-2025 The LineageOS Project * SPDX-FileCopyrightText: 2017-2026 The LineageOS Project * SPDX-License-Identifier: Apache-2.0 */ Loading Loading @@ -2918,6 +2918,15 @@ public final class LineageSettings { /** @hide */ public static final Validator NETWORK_TRAFFIC_AUTOHIDE_VALIDATOR = sBooleanValidator; /** * Whether or not to hide network traffic direction arrows * @hide */ public static final String NETWORK_TRAFFIC_HIDE_ARROWS = "network_traffic_hide_arrows"; /** @hide */ public static final Validator NETWORK_TRAFFIC_HIDE_ARROWS_VALIDATOR = sBooleanValidator; /** * Measurement unit preference for network traffic * 0 = kBit/s Loading Loading @@ -3004,6 +3013,7 @@ public final class LineageSettings { VALIDATORS.put(NETWORK_TRAFFIC_MODE, NETWORK_TRAFFIC_MODE_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_POSITION, NETWORK_TRAFFIC_POSITION_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_AUTOHIDE, NETWORK_TRAFFIC_AUTOHIDE_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_HIDE_ARROWS, NETWORK_TRAFFIC_HIDE_ARROWS_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_UNITS, NETWORK_TRAFFIC_UNITS_VALIDATOR); VALIDATORS.put(NETWORK_TRAFFIC_SHOW_UNITS, NETWORK_TRAFFIC_SHOW_UNITS_VALIDATOR); VALIDATORS.put(TRUST_WARNINGS, TRUST_WARNINGS_VALIDATOR); Loading
sdk/src/java/org/lineageos/internal/statusbar/LineageStatusBarItem.java +8 −6 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2018 The LineageOS project * SPDX-FileCopyrightText: 2018-2026 The LineageOS project * SPDX-License-Identifier: Apache-2.0 */ Loading @@ -14,17 +14,19 @@ import java.util.ArrayList; public class LineageStatusBarItem { public interface Manager { public void addDarkReceiver(DarkReceiver darkReceiver); public void addVisibilityReceiver(VisibilityReceiver visibilityReceiver); void addDarkReceiver(DarkReceiver darkReceiver); void removeDarkReceiver(DarkReceiver darkReceiver); void addVisibilityReceiver(VisibilityReceiver visibilityReceiver); void removeVisibilityReceiver(VisibilityReceiver visibilityReceiver); } public interface DarkReceiver { public void onDarkChanged(ArrayList<Rect> areas, float darkIntensity, int tint); public void setFillColors(int darkColor, int lightColor); void onDarkChanged(ArrayList<Rect> areas, float darkIntensity, int tint); void setFillColors(int darkColor, int lightColor); } public interface VisibilityReceiver { public void onVisibilityChanged(boolean isVisible); void onVisibilityChanged(boolean isVisible); } // Locate parent LineageStatusBarItem.Manager Loading
sdk/src/java/org/lineageos/internal/statusbar/NetworkTraffic.java +26 −6 Original line number Diff line number Diff line /* * SPDX-FileCopyrightText: 2017-2025 The LineageOS project * SPDX-FileCopyrightText: 2017-2026 The LineageOS project * SPDX-License-Identifier: Apache-2.0 */ Loading Loading @@ -93,6 +93,7 @@ public class NetworkTraffic extends TextView { private long mLastRxBytes; private long mLastUpdateTime; private boolean mAutoHide; private boolean mHideArrows; private long mAutoHideThreshold; private int mUnits; private int mShowUnits; Loading @@ -109,6 +110,8 @@ public class NetworkTraffic extends TextView { // to current stats have changed. private boolean mNetworksChanged = true; private LineageStatusBarItem.Manager mManager; public NetworkTraffic(Context context) { this(context, null); } Loading Loading @@ -394,10 +397,11 @@ public class NetworkTraffic extends TextView { protected void onAttachedToWindow() { super.onAttachedToWindow(); LineageStatusBarItem.Manager manager = LineageStatusBarItem.findManager((View) this); manager.addDarkReceiver(mDarkReceiver); manager.addVisibilityReceiver(mVisibilityReceiver); mManager = LineageStatusBarItem.findManager(this); if (mManager != null) { mManager.addDarkReceiver(mDarkReceiver); mManager.addVisibilityReceiver(mVisibilityReceiver); } mObserver.observe(); updateSettings(); Loading @@ -406,7 +410,15 @@ public class NetworkTraffic extends TextView { @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mManager != null) { mManager.removeDarkReceiver(mDarkReceiver); mManager.removeVisibilityReceiver(mVisibilityReceiver); mManager = null; } mObserver.unobserve(); mTrafficHandler.removeCallbacksAndMessages(null); unregisterNetworkCallbacks(); } Loading @@ -426,6 +438,9 @@ public class NetworkTraffic extends TextView { resolver.registerContentObserver(LineageSettings.Secure.getUriFor( LineageSettings.Secure.NETWORK_TRAFFIC_AUTOHIDE), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(LineageSettings.Secure.getUriFor( LineageSettings.Secure.NETWORK_TRAFFIC_HIDE_ARROWS), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(LineageSettings.Secure.getUriFor( LineageSettings.Secure.NETWORK_TRAFFIC_UNITS), false, this, UserHandle.USER_ALL); Loading Loading @@ -457,6 +472,8 @@ public class NetworkTraffic extends TextView { LineageSettings.Secure.NETWORK_TRAFFIC_POSITION, POSITION_CENTER); mAutoHide = LineageSettings.Secure.getInt(resolver, LineageSettings.Secure.NETWORK_TRAFFIC_AUTOHIDE, 0) == 1; mHideArrows = LineageSettings.Secure.getInt(resolver, LineageSettings.Secure.NETWORK_TRAFFIC_HIDE_ARROWS, 0) == 1; mUnits = LineageSettings.Secure.getInt(resolver, LineageSettings.Secure.NETWORK_TRAFFIC_UNITS, UNITS_KILOBYTES); mShowUnits = LineageSettings.Secure.getInt(resolver, Loading Loading @@ -495,7 +512,9 @@ public class NetworkTraffic extends TextView { private void updateTrafficDrawable() { final int drawableResId; if (mMode == MODE_UPSTREAM_AND_DOWNSTREAM) { if (mHideArrows) { drawableResId = 0; } else if (mMode == MODE_UPSTREAM_AND_DOWNSTREAM) { drawableResId = R.drawable.stat_sys_network_traffic_updown; } else if (mMode == MODE_UPSTREAM_ONLY) { drawableResId = R.drawable.stat_sys_network_traffic_up; Loading @@ -505,6 +524,7 @@ public class NetworkTraffic extends TextView { drawableResId = 0; } mDrawable = drawableResId != 0 ? getResources().getDrawable(drawableResId) : null; setCompoundDrawablePadding(0); setCompoundDrawablesWithIntrinsicBounds(null, null, mDrawable, null); updateTrafficDrawableColor(); } Loading