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

Commit 7e2dc21a authored by Kevin F. Haggerty's avatar Kevin F. Haggerty
Browse files

Merge tag 'android-8.1.0_r43' into staging/lineage-15.1_merge-android-8.1.0_r43

Android 8.1.0 release 43

* tag 'android-8.1.0_r43': (24 commits)
  Fix DynamicRefTable::load security bug
  ResStringPool: Prevenet boot loop from se fix
  Make safe label more safe
  WM: Prevent secondary display focus while keyguard is up
  DO NOT MERGE: Add unit tests to ensure VPN meteredness
  DO NOT MERGE: Fix ConnectivityController meteredness checks
  clearCallingIdentity before calling into getPackageUidAsUser
  Nullcheck to fix Autofill CTS
  Osu: fixed Mismatch between createFromParcel and writeToParcel
  DO NOT MERGE Truncate newline and tab characters in BluetoothDevice name
  Fix broken check for TelephonyManager#getForbiddenPlmns
  DO NOT MERGE (O) Revoke permision when group changed
  ResStringPool: Fix security vulnerability
  RESTRICT AUTOMERGE: Prevent reporting fake package name - framework (backport to oc-mr1-dev)
  Use concrete CREATOR instance for parceling lists
  Rework thumbnail cleanup
  DO NOT MERGE - fix AFM.getComponentNameFromContext()
  Proper autofill fix to let phone process autofill Settings activity.
  Make sure apps cannot forge package name on AssistStructure used for Autofill.
  Fixed Security Vulnerability of DcParamObject
  ...

Change-Id: I37be2836181595f928721968cb7ffa2df312eff1
parents b78e9ae6 9522ef33
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@ import java.util.Comparator;
 */
public class PackageItemInfo {
    private static final float MAX_LABEL_SIZE_PX = 500f;
    /** The maximum length of a safe label, in characters */
    private static final int MAX_SAFE_LABEL_LENGTH = 50000;

    /**
     * Public name of this item. From the "android:name" attribute.
     */
@@ -169,7 +172,8 @@ public class PackageItemInfo {
        // If the label contains new line characters it may push the UI
        // down to hide a part of it. Labels shouldn't have new line
        // characters, so just truncate at the first time one is seen.
        final int labelLength = labelStr.length();
        final int labelLength = Math.min(labelStr.length(), MAX_SAFE_LABEL_LENGTH);
        final StringBuffer sb = new StringBuffer(labelLength);
        int offset = 0;
        while (offset < labelLength) {
            final int codePoint = labelStr.codePointAt(offset);
@@ -181,14 +185,19 @@ public class PackageItemInfo {
                break;
            }
            // replace all non-break space to " " in order to be trimmed
            final int charCount = Character.charCount(codePoint);
            if (type == Character.SPACE_SEPARATOR) {
                labelStr = labelStr.substring(0, offset) + " " + labelStr.substring(offset +
                        Character.charCount(codePoint));
                sb.append(' ');
            } else {
                sb.append(labelStr.charAt(offset));
                if (charCount == 2) {
                    sb.append(labelStr.charAt(offset + 1));
                }
            }
            offset += Character.charCount(codePoint);
            offset += charCount;
        }

        labelStr = labelStr.trim();
        labelStr = sb.toString().trim();
        if (labelStr.isEmpty()) {
            return packageName;
        }
+22 −0
Original line number Diff line number Diff line
@@ -2504,6 +2504,28 @@ public class ConnectivityManager {
        }
    }

    /**
     * Returns if the active data network for the given UID is metered. A network
     * is classified as metered when the user is sensitive to heavy data usage on
     * that connection due to monetary costs, data limitations or
     * battery/performance issues. You should check this before doing large
     * data transfers, and warn the user or delay the operation until another
     * network is available.
     *
     * @return {@code true} if large transfers should be avoided, otherwise
     *        {@code false}.
     *
     * @hide
     */
    @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL)
    public boolean isActiveNetworkMeteredForUid(int uid) {
        try {
            return mService.isActiveNetworkMeteredForUid(uid);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * If the LockdownVpn mechanism is enabled, updates the vpn
     * with a reload of its profile.
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ interface IConnectivityManager

    NetworkQuotaInfo getActiveNetworkQuotaInfo();
    boolean isActiveNetworkMetered();
    boolean isActiveNetworkMeteredForUid(int uid);

    boolean requestRouteToHostAddress(int networkType, in byte[] hostAddress);

+5 −0
Original line number Diff line number Diff line
@@ -616,6 +616,11 @@ public interface WindowManagerPolicy {
         */
        void notifyKeyguardTrustedChanged();

        /**
         * The keyguard showing state has changed
         */
        void onKeyguardShowingAndNotOccludedChanged();

        /**
         * Notifies the window manager that screen is being turned off.
         *
+11 −3
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData)

    // The chunk must be at least the size of the string pool header.
    if (size < sizeof(ResStringPool_header)) {
        LOG_ALWAYS_FATAL("Bad string block: data size %zu is too small to be a string block", size);
        ALOGW("Bad string block: data size %zu is too small to be a string block", size);
        return (mError=BAD_TYPE);
    }

@@ -470,7 +470,7 @@ status_t ResStringPool::setTo(const void* data, size_t size, bool copyData)
    if (validate_chunk(reinterpret_cast<const ResChunk_header*>(data), sizeof(ResStringPool_header),
                       reinterpret_cast<const uint8_t*>(data) + size,
                       "ResStringPool_header") != NO_ERROR) {
        LOG_ALWAYS_FATAL("Bad string block: malformed block dimensions");
        ALOGW("Bad string block: malformed block dimensions");
        return (mError=BAD_TYPE);
    }

@@ -6581,8 +6581,16 @@ status_t ResTable::parsePackage(const ResTable_package* const pkg,
            }

        } else if (ctype == RES_TABLE_LIBRARY_TYPE) {

            if (group->dynamicRefTable.entries().size() == 0) {
                status_t err = group->dynamicRefTable.load((const ResTable_lib_header*) chunk);
                const ResTable_lib_header* lib = (const ResTable_lib_header*) chunk;
                status_t err = validate_chunk(&lib->header, sizeof(*lib),
                                              endPos, "ResTable_lib_header");
                if (err != NO_ERROR) {
                    return (mError=err);
                }

                err = group->dynamicRefTable.load(lib);
                if (err != NO_ERROR) {
                    return (mError=err);
                }
Loading