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

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

Snap for 6091187 from 21cc2e5f to qt-qpr2-release

Change-Id: I0ec3f305ac5fd99958710a4d5ee65edcd96223df
parents 95b4254a 21cc2e5f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1394,7 +1394,10 @@ Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& tra

Status StatsService::sendWatchdogRollbackOccurredAtom(const int32_t rollbackTypeIn,
                                                      const android::String16& packageNameIn,
                                                      const int64_t packageVersionCodeIn) {
                                                      const int64_t packageVersionCodeIn,
                                                      const int32_t rollbackReasonIn,
                                                      const android::String16&
                                                       failingPackageNameIn) {
    // Note: We skip the usage stats op check here since we do not have a package name.
    // This is ok since we are overloading the usage_stats permission.
    // This method only sends data, it does not receive it.
@@ -1416,7 +1419,8 @@ Status StatsService::sendWatchdogRollbackOccurredAtom(const int32_t rollbackType
    }

    android::util::stats_write(android::util::WATCHDOG_ROLLBACK_OCCURRED,
            rollbackTypeIn, String8(packageNameIn).string(), packageVersionCodeIn);
            rollbackTypeIn, String8(packageNameIn).string(), packageVersionCodeIn,
            rollbackReasonIn, String8(failingPackageNameIn).string());

    // Fast return to save disk read.
    if (rollbackTypeIn != android::util::WATCHDOG_ROLLBACK_OCCURRED__ROLLBACK_TYPE__ROLLBACK_SUCCESS
+3 −1
Original line number Diff line number Diff line
@@ -200,7 +200,9 @@ public:
    virtual Status sendWatchdogRollbackOccurredAtom(
            const int32_t rollbackTypeIn,
            const android::String16& packageNameIn,
            const int64_t packageVersionCodeIn) override;
            const int64_t packageVersionCodeIn,
            const int32_t rollbackReasonIn,
            const android::String16& failingPackageNameIn) override;

    /**
     * Binder call to get registered experiment IDs.
+13 −0
Original line number Diff line number Diff line
@@ -1687,6 +1687,19 @@ message WatchdogRollbackOccurred {
    optional string package_name = 2;

    optional int32 package_version_code = 3;

    enum RollbackReasonType {
        REASON_UNKNOWN = 0;
        REASON_NATIVE_CRASH = 1;
        REASON_EXPLICIT_HEALTH_CHECK = 2;
        REASON_APP_CRASH = 3;
        REASON_APP_NOT_RESPONDING = 4;
    }
    optional RollbackReasonType rollback_reason = 4;

    // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
    // is initiated. Empty if the package is unknown.
    optional string failing_package_name = 5;
}

/**
+37 −16
Original line number Diff line number Diff line
@@ -73,6 +73,8 @@ public final class LinkProperties implements Parcelable {
    private static final int MIN_MTU_V6 = 1280;
    private static final int MAX_MTU    = 10000;

    private static final int INET6_ADDR_LENGTH = 16;

    // Stores the properties of links that are "stacked" above this link.
    // Indexed by interface name to allow modification and to prevent duplicates being added.
    private Hashtable<String, LinkProperties> mStackedLinks = new Hashtable<>();
@@ -1590,20 +1592,11 @@ public final class LinkProperties implements Parcelable {
            dest.writeParcelable(linkAddress, flags);
        }

        dest.writeInt(mDnses.size());
        for (InetAddress d : mDnses) {
            dest.writeByteArray(d.getAddress());
        }
        dest.writeInt(mValidatedPrivateDnses.size());
        for (InetAddress d : mValidatedPrivateDnses) {
            dest.writeByteArray(d.getAddress());
        }
        writeAddresses(dest, mDnses);
        writeAddresses(dest, mValidatedPrivateDnses);
        dest.writeBoolean(mUsePrivateDns);
        dest.writeString(mPrivateDnsServerName);
        dest.writeInt(mPcscfs.size());
        for (InetAddress d : mPcscfs) {
            dest.writeByteArray(d.getAddress());
        }
        writeAddresses(dest, mPcscfs);
        dest.writeString(mDomains);
        dest.writeInt(mMtu);
        dest.writeString(mTcpBufferSizes);
@@ -1624,6 +1617,35 @@ public final class LinkProperties implements Parcelable {
        dest.writeList(stackedLinks);
    }

    private static void writeAddresses(@NonNull Parcel dest, @NonNull List<InetAddress> list) {
        dest.writeInt(list.size());
        for (InetAddress d : list) {
            writeAddress(dest, d);
        }
    }

    private static void writeAddress(@NonNull Parcel dest, @NonNull InetAddress addr) {
        dest.writeByteArray(addr.getAddress());
        if (addr instanceof Inet6Address) {
            final Inet6Address v6Addr = (Inet6Address) addr;
            final boolean hasScopeId = v6Addr.getScopeId() != 0;
            dest.writeBoolean(hasScopeId);
            if (hasScopeId) dest.writeInt(v6Addr.getScopeId());
        }
    }

    @NonNull
    private static InetAddress readAddress(@NonNull Parcel p) throws UnknownHostException {
        final byte[] addr = p.createByteArray();
        if (addr.length == INET6_ADDR_LENGTH) {
            final boolean hasScopeId = p.readBoolean();
            final int scopeId = hasScopeId ? p.readInt() : 0;
            return Inet6Address.getByAddress(null /* host */, addr, scopeId);
        }

        return InetAddress.getByAddress(addr);
    }

    /**
     * Implement the Parcelable interface.
     */
@@ -1643,14 +1665,13 @@ public final class LinkProperties implements Parcelable {
                addressCount = in.readInt();
                for (int i = 0; i < addressCount; i++) {
                    try {
                        netProp.addDnsServer(InetAddress.getByAddress(in.createByteArray()));
                        netProp.addDnsServer(readAddress(in));
                    } catch (UnknownHostException e) { }
                }
                addressCount = in.readInt();
                for (int i = 0; i < addressCount; i++) {
                    try {
                        netProp.addValidatedPrivateDnsServer(
                                InetAddress.getByAddress(in.createByteArray()));
                        netProp.addValidatedPrivateDnsServer(readAddress(in));
                    } catch (UnknownHostException e) { }
                }
                netProp.setUsePrivateDns(in.readBoolean());
@@ -1658,7 +1679,7 @@ public final class LinkProperties implements Parcelable {
                addressCount = in.readInt();
                for (int i = 0; i < addressCount; i++) {
                    try {
                        netProp.addPcscfServer(InetAddress.getByAddress(in.createByteArray()));
                        netProp.addPcscfServer(readAddress(in));
                    } catch (UnknownHostException e) { }
                }
                netProp.setDomains(in.readString());
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ interface IStatsManager {
     * Logs an event for watchdog rollbacks.
     */
     oneway void sendWatchdogRollbackOccurredAtom(in int rollbackType, in String packageName,
         in long packageVersionCode);
         in long packageVersionCode,  in int rollbackReason, in String failingPackageName);

    /**
     * Returns the most recently registered experiment IDs.
Loading