Loading recovery_main.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -527,6 +527,8 @@ int main(int argc, char** argv) { android::base::SetProperty("service.adb.root", "1"); } device->InitDevice(); while (true) { // We start adbd in recovery for the device with userdebug build or a unlocked bootloader. std::string usb_config = Loading recovery_ui/ethernet_device.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -41,20 +41,26 @@ EthernetDevice::EthernetDevice(EthernetRecoveryUI* ui, std::string interface) } } void EthernetDevice::InitDevice() { BringupInterface(); sleep(1); } void EthernetDevice::PreRecovery() { SetInterfaceFlags(0, IFF_UP); SetTitleIPAddress(false); SetTitleIPAddress(BringupInterface()); } void EthernetDevice::PreFastboot() { android::base::SetProperty("fastbootd.protocol", "tcp"); SetTitleIPAddress(BringupInterface()); } bool EthernetDevice::BringupInterface() { if (SetInterfaceFlags(IFF_UP, 0) < 0) { LOG(ERROR) << "Failed to bring up interface"; return; return false; } SetTitleIPAddress(true); return true; } int EthernetDevice::SetInterfaceFlags(const unsigned set, const unsigned clr) { Loading recovery_ui/include/recovery_ui/device.h +3 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,9 @@ class Device { ui_.reset(ui); } // Called before any mode started up, to bring up network. virtual void InitDevice() {} // Called before recovery mode started up, to perform whatever device-specific recovery mode // preparation as needed. virtual void PreRecovery() {} Loading recovery_ui/include/recovery_ui/ethernet_device.h +2 −0 Original line number Diff line number Diff line Loading @@ -29,10 +29,12 @@ class EthernetDevice : public Device { explicit EthernetDevice(EthernetRecoveryUI* ui); explicit EthernetDevice(EthernetRecoveryUI* ui, std::string interface); void InitDevice() override; void PreRecovery() override; void PreFastboot() override; private: bool BringupInterface(); int SetInterfaceFlags(const unsigned set, const unsigned clr); void SetTitleIPAddress(const bool interface_up); Loading Loading
recovery_main.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -527,6 +527,8 @@ int main(int argc, char** argv) { android::base::SetProperty("service.adb.root", "1"); } device->InitDevice(); while (true) { // We start adbd in recovery for the device with userdebug build or a unlocked bootloader. std::string usb_config = Loading
recovery_ui/ethernet_device.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -41,20 +41,26 @@ EthernetDevice::EthernetDevice(EthernetRecoveryUI* ui, std::string interface) } } void EthernetDevice::InitDevice() { BringupInterface(); sleep(1); } void EthernetDevice::PreRecovery() { SetInterfaceFlags(0, IFF_UP); SetTitleIPAddress(false); SetTitleIPAddress(BringupInterface()); } void EthernetDevice::PreFastboot() { android::base::SetProperty("fastbootd.protocol", "tcp"); SetTitleIPAddress(BringupInterface()); } bool EthernetDevice::BringupInterface() { if (SetInterfaceFlags(IFF_UP, 0) < 0) { LOG(ERROR) << "Failed to bring up interface"; return; return false; } SetTitleIPAddress(true); return true; } int EthernetDevice::SetInterfaceFlags(const unsigned set, const unsigned clr) { Loading
recovery_ui/include/recovery_ui/device.h +3 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,9 @@ class Device { ui_.reset(ui); } // Called before any mode started up, to bring up network. virtual void InitDevice() {} // Called before recovery mode started up, to perform whatever device-specific recovery mode // preparation as needed. virtual void PreRecovery() {} Loading
recovery_ui/include/recovery_ui/ethernet_device.h +2 −0 Original line number Diff line number Diff line Loading @@ -29,10 +29,12 @@ class EthernetDevice : public Device { explicit EthernetDevice(EthernetRecoveryUI* ui); explicit EthernetDevice(EthernetRecoveryUI* ui, std::string interface); void InitDevice() override; void PreRecovery() override; void PreFastboot() override; private: bool BringupInterface(); int SetInterfaceFlags(const unsigned set, const unsigned clr); void SetTitleIPAddress(const bool interface_up); Loading