Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97a93004 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4716599 from 65ce3b2c to pi-release

Change-Id: I011e28c1cb04576b88776fef1e00e2711abde3ee
parents 34b31dfd 65ce3b2c
Loading
Loading
Loading
Loading
+23 −12
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ struct usb_handle
{
    UInt8 bulkIn;
    UInt8 bulkOut;
    IOUSBInterfaceInterface190** interface;
    IOUSBInterfaceInterface550** interface;
    unsigned int zero_mask;
    size_t max_packet_size;

@@ -106,8 +106,8 @@ static void AddDevice(std::unique_ptr<usb_handle> handle) {
}

static void AndroidInterfaceAdded(io_iterator_t iterator);
static std::unique_ptr<usb_handle> CheckInterface(IOUSBInterfaceInterface190 **iface,
                                                  UInt16 vendor, UInt16 product);
static std::unique_ptr<usb_handle> CheckInterface(IOUSBInterfaceInterface550** iface, UInt16 vendor,
                                                  UInt16 product);

static bool FindUSBDevices() {
    // Create the matching dictionary to find the Android device's adb interface.
@@ -295,8 +295,8 @@ AndroidInterfaceAdded(io_iterator_t iterator)
            continue;
        }

        std::unique_ptr<usb_handle> handle = CheckInterface((IOUSBInterfaceInterface190**)iface,
                                                            vendor, product);
        std::unique_ptr<usb_handle> handle =
            CheckInterface((IOUSBInterfaceInterface550**)iface, vendor, product);
        if (handle == nullptr) {
            LOG(ERROR) << "Could not find device interface";
            (*iface)->Release(iface);
@@ -315,7 +315,7 @@ AndroidInterfaceAdded(io_iterator_t iterator)
// Used to clear both the endpoints before starting.
// When adb quits, we might clear the host endpoint but not the device.
// So we make sure both sides are clear before starting up.
static bool ClearPipeStallBothEnds(IOUSBInterfaceInterface190** interface, UInt8 bulkEp) {
static bool ClearPipeStallBothEnds(IOUSBInterfaceInterface550** interface, UInt8 bulkEp) {
    IOReturn rc = (*interface)->ClearPipeStallBothEnds(interface, bulkEp);
    if (rc != kIOReturnSuccess) {
        LOG(ERROR) << "Could not clear pipe stall both ends: " << std::hex << rc;
@@ -326,9 +326,8 @@ static bool ClearPipeStallBothEnds(IOUSBInterfaceInterface190** interface, UInt8

//* TODO: simplify this further since we only register to get ADB interface
//* subclass+protocol events
static std::unique_ptr<usb_handle>
CheckInterface(IOUSBInterfaceInterface190 **interface, UInt16 vendor, UInt16 product)
{
static std::unique_ptr<usb_handle> CheckInterface(IOUSBInterfaceInterface550** interface,
                                                  UInt16 vendor, UInt16 product) {
    std::unique_ptr<usb_handle> handle;
    IOReturn kr;
    UInt8 interfaceNumEndpoints, interfaceClass, interfaceSubClass, interfaceProtocol;
@@ -376,9 +375,14 @@ CheckInterface(IOUSBInterfaceInterface190 **interface, UInt16 vendor, UInt16 pro
        UInt8   interval;
        UInt8   number;
        UInt8   direction;

        kr = (*interface)->GetPipeProperties(interface, endpoint, &direction,
                &number, &transferType, &maxPacketSize, &interval);
        UInt8 maxBurst;
        UInt8 mult;
        UInt16 bytesPerInterval;

        kr = (*interface)
                 ->GetPipePropertiesV2(interface, endpoint, &direction, &number, &transferType,
                                       &maxPacketSize, &interval, &maxBurst, &mult,
                                       &bytesPerInterval);
        if (kr != kIOReturnSuccess) {
            LOG(ERROR) << "FindDeviceInterface - could not get pipe properties: "
                       << std::hex << kr;
@@ -397,6 +401,13 @@ CheckInterface(IOUSBInterfaceInterface190 **interface, UInt16 vendor, UInt16 pro
            if (!ClearPipeStallBothEnds(interface, handle->bulkOut)) goto err_get_pipe_props;
        }

        if (maxBurst != 0)
            // bMaxBurst is the number of additional packets in the burst.
            maxPacketSize /= (maxBurst + 1);

        // mult is only relevant for isochronous endpoints.
        CHECK_EQ(0, mult);

        handle->zero_mask = maxPacketSize - 1;
        handle->max_packet_size = maxPacketSize;
    }
+12 −10
Original line number Diff line number Diff line
@@ -1275,7 +1275,9 @@ class DeviceOfflineTest(DeviceTest):
        """
        # The values that trigger things are 507 (512 - 5 bytes from shell protocol) + 1024*n
        # Probe some surrounding values as well, for the hell of it.
        for length in [506, 507, 508, 1018, 1019, 1020, 1530, 1531, 1532]:
        for base in [512] + range(1024, 1024 * 16, 1024):
            for offset in [-6, -5, -4]:
                length = base + offset
                cmd = ['dd', 'if=/dev/zero', 'bs={}'.format(length), 'count=1', '2>/dev/null;'
                       'echo', 'foo']
                rc, stdout, _ = self.device.shell_nocheck(cmd)
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ static constexpr const char* kPartnerPrefixes[] = {
};

static const std::set<std::string> kExportedActionableProperties = {
    "dev.bootcomplete",
    "init.svc.console",
    "init.svc.mediadrm",
    "init.svc.surfaceflinger",
@@ -40,6 +41,8 @@ static const std::set<std::string> kExportedActionableProperties = {
    "ro.board.platform",
    "ro.bootmode",
    "ro.build.type",
    "ro.crypto.state",
    "ro.crypto.type",
    "ro.debuggable",
    "sys.boot_completed",
    "sys.boot_from_charger_mode",
@@ -51,6 +54,8 @@ static const std::set<std::string> kExportedActionableProperties = {
    "sys.usb.ffs.ready",
    "sys.user.0.ce_available",
    "sys.vdso",
    "vold.decrypt",
    "vold.post_fs_data_done",
    "vts.native_server.on",
    "wlan.driver.status",
};
+2 −1
Original line number Diff line number Diff line
@@ -67,8 +67,9 @@
# ZygoteInit class preloading ends:
3030 boot_progress_preload_end (time|2|3)

# Dalvik VM
# Dalvik VM / ART
20003 dvm_lock_sample (process|3),(main|1|5),(thread|3),(time|1|3),(file|3),(line|1|5),(ownerfile|3),(ownerline|1|5),(sample_percent|1|6)
20004 art_hidden_api_access (access_method|1),(flags|1),(class|3),(member|3),(type_signature|3)

75000 sqlite_mem_alarm_current (current|1|2)
75001 sqlite_mem_alarm_max (max|1|2)