Ethernet Config — AIDL Interface
This document describes the AIDL API exposed by Ethernet Config (com.example.ethernetconfig). The service registers a system binder named blissethernet.
For end-to-end device validation (including persist.bass.ethernet.* auto-config), see Testing Guide. Overview: Ethernet Config.
Client JAR: Download bliss-ethernet-framework.jar — see system_libs/README.md (also mirrored at /static/downloads/bliss-ethernet-framework.jar).
Prerequisites
- Ethernet Config installed as a privileged/system app (Bass ROM builds include it).
- The
blissethernetservice registered inServiceManager(started at boot via init /start-bliss-ethernet). - For third-party apps: caller must be authorized (see
Authorization ). - Ethernet tethering requires
TETHER_PRIVILEGEDon the server (granted via priv-app whitelist).
IP assignment modes
Canonical values for getIpAssignment / setIpAssignment:
Static IP address format: <IPv4>/<prefix> (e.g. 192.168.1.100/24).
Legacy JAR migration (breaking)
The old Bliss Ethernet Manager client JAR used different integers:
getIpAssignmentalways returns canonical0/1/2.setIpAssignmentaccepts canonical0/1/2and exclusive legacy-1(→ UNASSIGNED).- For legacy
0(DHCP) /1(STATIC), callBlissEthernetAssignment.fromLegacy(value)before set, or update constants. - The old JAR does not include ethernet tethering APIs — use the new JAR / AIDL sources.
Ethernet tethering
Tethering shares the device’s upstream network over an ethernet downstream. The server uses AOSP TetheringManager with an optional static IPv4 pair (gateway + single DHCP client address in the same prefix).
Defaults when arguments are empty:
- Local (gateway):
192.168.10.1/24 - Client (DHCP offer):
192.168.10.2/24
Non-empty values must be ip/prefix strings in the same prefix.
BlissEthernetManager mgr = BlissEthernetManager.getInstance(context);
// Product default 192.168.10.0/24
mgr.startEthernetTethering("", "");
// Custom pair
mgr.startEthernetTethering("192.168.10.1/24", "192.168.10.50/24");
mgr.stopEthernetTethering();
Client usage
Gradle
Download bliss-ethernet-framework.jar (or the static mirror), place it in your app’s system_libs/, then:
implementation fileTree(dir: 'system_libs/', include: ['*.jar'])
Or copy AIDL sources into your module and enable buildFeatures { aidl = true }.
Java
import org.blissos.ethernet.BlissEthernetManager;
import org.blissos.ethernet.BlissEthernetAssignment;
BlissEthernetManager blissEthernetManager = BlissEthernetManager.getInstance(context);
String[] interfaces = blissEthernetManager.getAvailableInterfaces();
boolean up = blissEthernetManager.isAvailable("eth0");
blissEthernetManager.setIpAssignment("eth0", BlissEthernetAssignment.STATIC);
blissEthernetManager.setIpAddress("eth0", "192.168.1.100/24");
blissEthernetManager.setGateway("eth0", "192.168.1.1");
blissEthernetManager.setDnses("eth0", new String[] { "8.8.8.8", "8.8.4.4" });
blissEthernetManager.startEthernetTethering("", "");
Manifest (client app)
<uses-permission android:name="org.blissos.ethernet.permission.ACCESS_ETHERNET_MANAGER" />
AIDLs
IBlissEthernet.aidl:
package org.blissos.ethernet;
import org.blissos.ethernet.IBlissEthernetServiceListener;
interface IBlissEthernet {
String[] getAvailableInterfaces();
boolean isAvailable(String iface);
void setListener(in IBlissEthernetServiceListener listener);
void setInterfaceUp(String iface);
void setInterfaceDown(String iface);
String getEthernetMacAddress(String ifname);
int getIpAssignment(String iface);
void setIpAssignment(String iface, int assignment);
String getIpAddress(String iface);
void setIpAddress(String iface, String ipAddress);
String getGateway(String iface);
void setGateway(String iface, String gateway);
String[] getDnses(String iface);
void setDnses(String iface, in String[] dnses);
void startEthernetTethering(String localIpv4, String clientIpv4);
void stopEthernetTethering();
boolean isEthernetTetheringActive();
String getEthernetTetherLocalIpv4();
String getEthernetTetherClientIpv4();
}
IBlissEthernetServiceListener.aidl:
package org.blissos.ethernet;
oneway interface IBlissEthernetServiceListener {
void onAvailabilityChanged(String iface, boolean isAvailable);
}
Method reference
Partial updates (setIpAddress, setGateway, setDnses) merge with the current interface configuration before applying.
Authorization
A call succeeds only if the caller is one of:
- System UID or shell UID (e.g.
adb shell service call …) - Same app as the server (
com.example.ethernetconfig) - Holder of
org.blissos.ethernet.permission.ACCESS_ETHERNET_MANAGER - Package listed in
bliss_ethernet_authorized_packages, or allow-all mode enabled in the server app resources
Unauthorized callers receive SecurityException.
ADB interface
adb shell service call blissethernet <code> [parameters...]
<code> is the 1-based transaction ID matching AIDL method order.
Examples
# List interfaces
adb shell service call blissethernet 1
# isAvailable(eth0)
adb shell service call blissethernet 2 s16 eth0
# getIpAssignment — 0=UNASSIGNED, 1=DHCP, 2=STATIC
adb shell service call blissethernet 7 s16 eth0
# Set static IP
adb shell service call blissethernet 8 s16 eth0 i32 2
adb shell service call blissethernet 10 s16 eth0 s16 192.168.1.100/24
adb shell service call blissethernet 12 s16 eth0 s16 192.168.1.1
# Start ethernet tethering with product defaults (192.168.10.1/24 + 192.168.10.2/24)
adb shell service call blissethernet 15 s16 "" s16 ""
# Start with explicit addresses
adb shell service call blissethernet 15 s16 192.168.10.1/24 s16 192.168.10.50/24
# Status / stop
adb shell service call blissethernet 17
adb shell service call blissethernet 16
Verify service registration
adb shell service list | grep blissethernet
If missing after boot, see Ethernet Config — Boot start.
Compatibility notes
- Package namespace:
org.blissos.ethernet(unchanged from Bliss Ethernet Manager) - Service name:
blissethernet(unchanged) - Client IP methods (codes 1–14): Same shapes as legacy; assignment integers changed (see table above)
- Tethering (codes 15–19): New in Ethernet Config — not present in the legacy JAR
- Listener:
onAvailabilityChangedfires whileBlissEthernetServiceis running
Legacy app UI docs: BlissEthernetManager.