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

Commit ce57a7f3 authored by Xavier Ducrohet's avatar Xavier Ducrohet Committed by Android Git Automerger
Browse files

am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."

* commit '6504490c':
  GpsLocationProvider: Clean up HAL initialization/cleanup sequence
  Fixed GSM encoded network initiated position request
  Ensuring thread-safe usage of DateFormat.
  Fixing infinite loop for zero duration.
  Fix for an infinite loop while scrolling lists.
  WAPPushManager, WAP Push over SMS message handler
  Add --non-constant-id to aapt.
parents e630e5f4 6504490c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ LOCAL_SRC_FILES += \
	telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl \
	telephony/java/com/android/internal/telephony/IIccPhoneBook.aidl \
	telephony/java/com/android/internal/telephony/ISms.aidl \
	telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
	wifi/java/android/net/wifi/IWifiManager.aidl \
	telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl \
	vpn/java/android/net/vpn/IVpnService.aidl \
+16 −10
Original line number Diff line number Diff line
@@ -642,6 +642,11 @@ public class DateUtils

    private static void initFormatStrings() {
        synchronized (sLock) {
            initFormatStringsLocked();
        }
    }

    private static void initFormatStringsLocked() {
        Resources r = Resources.getSystem();
        Configuration cfg = r.getConfiguration();
        if (sLastConfig == null || !sLastConfig.equals(cfg)) {
@@ -651,7 +656,6 @@ public class DateUtils
            sElapsedFormatHMMSS = r.getString(com.android.internal.R.string.elapsed_time_short_format_h_mm_ss);
        }
    }
    }

    /**
     * Format a time so it appears like it would in the status bar clock.
@@ -659,9 +663,11 @@ public class DateUtils
     * @hide
     */
    public static final CharSequence timeString(long millis) {
        initFormatStrings();
        synchronized (sLock) {
            initFormatStringsLocked();
            return sStatusTimeFormat.format(millis);
        }
    }

    /**
     * Formats an elapsed time in the form "MM:SS" or "H:MM:SS"
+1 −1
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ public class TimeUtils {
            int pos = 0;
            fieldLen -= 1;
            while (pos < fieldLen) {
                formatStr[pos] = ' ';
                formatStr[pos++] = ' ';
            }
            formatStr[pos] = '0';
            return pos+1;
+1 −0
Original line number Diff line number Diff line
@@ -317,6 +317,7 @@ public class EdgeGlow {
                    mEdgeScaleY = mEdgeScaleYStart +
                        (mEdgeScaleYFinish - mEdgeScaleYStart) *
                            interp * factor;
                    mState = STATE_RECEDE;
                    break;
                case STATE_RECEDE:
                    mState = STATE_IDLE;
+21 −46
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.os.RemoteException;
import android.util.Log;

import com.android.internal.R;
import com.android.internal.telephony.GsmAlphabet;

/**
 * A GPS Network-initiated Handler class used by LocationManager.
@@ -288,58 +289,32 @@ public class GpsNetInitiatedHandler {
     */
    static String decodeGSMPackedString(byte[] input)
    {
        final char CHAR_CR = 0x0D;
        int nStridx = 0;
        int nPckidx = 0;
        int num_bytes = input.length;
        int cPrev = 0;
        int cCurr = 0;
        byte nShift;
        byte nextChar;
        byte[] stringBuf = new byte[input.length * 2];
        String result = "";

        while(nPckidx < num_bytes)
        {
            nShift = (byte) (nStridx & 0x07);
            cCurr = input[nPckidx++];
            if (cCurr < 0) cCurr += 256;

            /* A 7-bit character can be split at the most between two bytes of packed
             ** data.
        final char PADDING_CHAR = 0x00;
        int lengthBytes = input.length;
        int lengthSeptets = (lengthBytes * 8) / 7;
        String decoded;

        /* Special case where the last 7 bits in the last byte could hold a valid
         * 7-bit character or a padding character. Drop the last 7-bit character
         * if it is a padding character.
         */
            nextChar = (byte) (( (cCurr << nShift) | (cPrev >> (8-nShift)) ) & 0x7F);
            stringBuf[nStridx++] = nextChar;

            /* Special case where the whole of the next 7-bit character fits inside
             ** the current byte of packed data.
             */
            if(nShift == 6)
            {
                /* If the next 7-bit character is a CR (0x0D) and it is the last
                 ** character, then it indicates a padding character. Drop it.
                 */
                if (nPckidx == num_bytes || (cCurr >> 1) == CHAR_CR)
                {
                    break;
        if (lengthBytes % 7 == 0) {
            if (lengthBytes > 0) {
                if ((input[lengthBytes - 1] >> 1) == PADDING_CHAR) {
                    lengthSeptets = lengthSeptets - 1;
                }

                nextChar = (byte) (cCurr >> 1);
                stringBuf[nStridx++] = nextChar;
            }

            cPrev = cCurr;
        }

        try {
            result = new String(stringBuf, 0, nStridx, "US-ASCII");
        }
        catch (UnsupportedEncodingException e)
        {
            Log.e(TAG, e.getMessage());
        decoded = GsmAlphabet.gsm7BitPackedToString(input, 0, lengthSeptets);

        // Return "" if decoding of GSM packed string fails
        if (null == decoded) {
            Log.e(TAG, "Decoding of GSM packed string failed");
            decoded = "";
        }

        return result;
        return decoded;
    }

    static String decodeUTF8String(byte[] input)
Loading