Feature Request: Data usage widget should support Ethernet and Cellular, not just WiFi
Current Behavior
The data usage widget only tracks WiFi usage. Users on Ethernet or Cellular connections see no data usage info.
Root Cause
The usage tracking in MainActivity.java hardcodes NetworkCapabilities.TRANSPORT_WIFI:
// MainActivity.java — getWifiUsage methods
// These only query TRANSPORT_WIFI, ignoring Ethernet/Cellular
NetworkStats networkStats = networkStatsManager.querySummary(
NetworkCapabilities.TRANSPORT_WIFI, null, startTime, endTime);
Similarly, the Dart side only exposes WiFi-specific methods:
// lib/providers/network_service.dart
int _dailyWifiUsage; // Only WiFi
Future<int> getWifiUsageForPeriod(String period) async {
switch (period) {
case 'daily':
return await _channel.getDailyWifiUsage();
case 'weekly':
return await _channel.getWeeklyWifiUsage();
case 'monthly':
return await _channel.getMonthlyWifiUsage();
}
}
What Already Works
The network detection code in NetworkUtils.java already handles all transport types correctly:
// NetworkUtils.java — already detects Ethernet
public static final short NETWORK_TYPE_WIRED = 3;
if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET)) {
networkType = NETWORK_TYPE_WIRED;
}
And the Dart enum already includes Wired:
enum NetworkType { Cellular, Wifi, Vpn, Wired, Unknown }
Suggested Improvement
- Generalize the usage methods in
MainActivity.java to accept a network type parameter instead of hardcoding TRANSPORT_WIFI
- Add a setting in the Settings menu to select which network type to track (WiFi / Ethernet / Cellular / All)
- Store the preference via
SharedPreferences
- Update
FLauncherChannel and NetworkService to pass the selected type when fetching usage
This would be a natural extension since the detection infrastructure already supports all network types — only the usage tracking is limited.
Environment
- Device: Google Streamer 4K (supports both WiFi and Ethernet)
- LTvLauncher: v3.2.2
Feature Request: Data usage widget should support Ethernet and Cellular, not just WiFi
Current Behavior
The data usage widget only tracks WiFi usage. Users on Ethernet or Cellular connections see no data usage info.
Root Cause
The usage tracking in
MainActivity.javahardcodesNetworkCapabilities.TRANSPORT_WIFI:Similarly, the Dart side only exposes WiFi-specific methods:
What Already Works
The network detection code in
NetworkUtils.javaalready handles all transport types correctly:And the Dart enum already includes Wired:
Suggested Improvement
MainActivity.javato accept a network type parameter instead of hardcodingTRANSPORT_WIFISharedPreferencesFLauncherChannelandNetworkServiceto pass the selected type when fetching usageThis would be a natural extension since the detection infrastructure already supports all network types — only the usage tracking is limited.
Environment