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

Commit 1badf0cf authored by Romain Hunault's avatar Romain Hunault
Browse files

Merge branch 'cm-14.1' into eelo-0.1

parents 46a6df2e 17d17094
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -46,6 +46,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.
     */
@@ -173,7 +176,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);
@@ -185,14 +189,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;
        }
+3 −4
Original line number Diff line number Diff line
@@ -362,8 +362,8 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
            if (msg.what == UPDATE_SLIDER) {
                if (mSeekBar != null) {
                    mLastProgress = msg.arg1;
                    mLastAudibleStreamVolume = Math.abs(msg.arg2);
                    final boolean muted = msg.arg2 < 0;
                    mLastAudibleStreamVolume = msg.arg2;
                    final boolean muted = (Boolean)msg.obj;
                    if (muted != mMuted) {
                        mMuted = muted;
                        if (mCallback != null) {
@@ -376,8 +376,7 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
        }

        public void postUpdateSlider(int volume, int lastAudibleVolume, boolean mute) {
            final int arg2 = lastAudibleVolume * (mute ? -1 : 1);
            obtainMessage(UPDATE_SLIDER, volume, arg2).sendToTarget();
            obtainMessage(UPDATE_SLIDER, volume, lastAudibleVolume, mute).sendToTarget();
        }
    }

+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);
    }

@@ -6422,8 +6422,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);
                }
+3 −0
Original line number Diff line number Diff line
@@ -108,6 +108,9 @@
    <string name="menu_ime_always_show">Menu / Keyboard Switcher (always show)</string>
    <string name="search">Search</string>

    <!-- Name of the clock status bar icon -->
    <string name="status_bar_clock">Clock</string>

    <!-- Path data for portrait battery -->
    <string name="battery_portrait_path_full" translatable="false">M 5 2 H 19 V 21 H 5 V 2 Z</string>
    <string name="battery_portrait_path_empty" translatable="false">M 5 21 H 19 V 21 H 5 V 21 Z</string>
+3 −4
Original line number Diff line number Diff line
@@ -84,9 +84,8 @@

    <!-- secure -->

    <com.android.systemui.tuner.ClockPreference
        android:title="@string/tuner_time"
        android:summary="%s"
        android:entries="@array/clock_options" />
    <com.android.systemui.tuner.StatusBarSwitch
        android:key="clock"
        android:title="@string/status_bar_clock" />

</PreferenceScreen>
Loading