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

Commit 21164830 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Merge commit 'goog/master' into merge_master

parents f73bbd04 ba0b11be
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -809,7 +809,16 @@ public class BluetoothDeviceService extends IBluetoothDevice.Stub {
    }

    /* package */ synchronized void addRemoteDeviceProperties(String address, String[] properties) {
        Map<String, String> propertyValues = new HashMap<String, String>();
        /*
         * We get a DeviceFound signal every time RSSI changes or name changes.
         * Don't create a new Map object every time */
        Map<String, String> propertyValues = mRemoteDeviceProperties.get(address);
        if (propertyValues != null) {
            propertyValues.clear();
        } else {
            propertyValues = new HashMap<String, String>();
        }

        for (int i = 0; i < properties.length; i+=2) {
            String value = null;
            if (propertyValues.containsKey(properties[i])) {
+3 −1
Original line number Diff line number Diff line
@@ -130,12 +130,14 @@ class BluetoothEventLoop {
        mBluetoothService.addRemoteDeviceProperties(address, properties);
        String rssi = mBluetoothService.getRemoteDeviceProperty(address, "RSSI");
        String classValue = mBluetoothService.getRemoteDeviceProperty(address, "Class");
        String name = mBluetoothService.getRemoteDeviceProperty(address, "Name");

        if (rssi != null && classValue != null) {
            Intent intent = new Intent(BluetoothIntent.REMOTE_DEVICE_FOUND_ACTION);
            intent.putExtra(BluetoothIntent.ADDRESS, address);
            intent.putExtra(BluetoothIntent.CLASS, classValue);
            intent.putExtra(BluetoothIntent.CLASS, Integer.valueOf(classValue));
            intent.putExtra(BluetoothIntent.RSSI, (short)Integer.valueOf(rssi).intValue());
            intent.putExtra(BluetoothIntent.NAME, name);

            mContext.sendBroadcast(intent, BLUETOOTH_PERM);
        } else {
+63 −33
Original line number Diff line number Diff line
@@ -416,6 +416,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        boolean singleLine = false;
        int maxlength = -1;
        CharSequence text = "";
        CharSequence hint = null;
        int shadowcolor = 0;
        float dx = 0, dy = 0, r = 0;
        boolean password = false;
@@ -543,7 +544,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                break;

            case com.android.internal.R.styleable.TextView_hint:
                setHint(a.getText(attr));
                hint = a.getText(attr);
                break;

            case com.android.internal.R.styleable.TextView_text:
@@ -873,6 +874,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }

        setText(text, bufferType);
        if (hint != null) setHint(hint);

        /*
         * Views are not normally focusable unless specified to be.
@@ -2817,9 +2819,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            checkForRelayout();
        }

        if (mText.length() == 0)
        if (mText.length() == 0) {
            invalidate();
        }
    }

    /**
     * Sets the text to be displayed when the text of the TextView is empty,
@@ -4802,10 +4805,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                alignment = Layout.Alignment.ALIGN_NORMAL;
        }

        boolean shouldEllipsize = mEllipsize != null && mInput == null;

        if (mText instanceof Spannable) {
            mLayout = new DynamicLayout(mText, mTransformed, mTextPaint, w,
                    alignment, mSpacingMult,
                    mSpacingAdd, mIncludePad, mEllipsize,
                    mSpacingAdd, mIncludePad, mInput == null ? mEllipsize : null,
                    ellipsisWidth);
        } else {
            if (boring == UNKNOWN_BORING) {
@@ -4832,7 +4837,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    // Log.e("aaa", "Boring: " + mTransformed);

                    mSavedLayout = (BoringLayout) mLayout;
                } else if (mEllipsize != null && boring.width <= w) {
                } else if (shouldEllipsize && boring.width <= w) {
                    if (mSavedLayout != null) {
                        mLayout = mSavedLayout.
                                replaceOrMake(mTransformed, mTextPaint,
@@ -4845,7 +4850,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                                boring, mIncludePad, mEllipsize,
                                ellipsisWidth);
                    }
                } else if (mEllipsize != null) {
                } else if (shouldEllipsize) {
                    mLayout = new StaticLayout(mTransformed,
                                0, mTransformed.length(),
                                mTextPaint, w, alignment, mSpacingMult,
@@ -4857,7 +4862,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                            mIncludePad);
                    // Log.e("aaa", "Boring but wide: " + mTransformed);
                }
            } else if (mEllipsize != null) {
            } else if (shouldEllipsize) {
                mLayout = new StaticLayout(mTransformed,
                            0, mTransformed.length(),
                            mTextPaint, w, alignment, mSpacingMult,
@@ -4870,9 +4875,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            }
        }

        shouldEllipsize = mEllipsize != null;
        mHintLayout = null;

        if (mHint != null) {
            if (shouldEllipsize) hintWidth = w;

            if (hintBoring == UNKNOWN_BORING) {
                hintBoring = BoringLayout.isBoring(mHint, mTextPaint,
                                                   mHintBoring);
@@ -4882,24 +4890,50 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            }

            if (hintBoring != null) {
                if (hintBoring.width <= hintWidth) {
                if (hintBoring.width <= hintWidth &&
                    (!shouldEllipsize || hintBoring.width <= ellipsisWidth)) {
                    if (mSavedHintLayout != null) {
                        mHintLayout = mSavedHintLayout.
                                replaceOrMake(mHint, mTextPaint,
                                hintWidth, alignment, mSpacingMult,
                                mSpacingAdd, hintBoring, mIncludePad);
                                hintWidth, alignment, mSpacingMult, mSpacingAdd,
                                hintBoring, mIncludePad);
                    } else {
                        mHintLayout = BoringLayout.make(mHint, mTextPaint,
                                hintWidth, alignment, mSpacingMult,
                                mSpacingAdd, hintBoring, mIncludePad);
                                hintWidth, alignment, mSpacingMult, mSpacingAdd,
                                hintBoring, mIncludePad);
                    }

                    mSavedHintLayout = (BoringLayout) mHintLayout;
                } else if (shouldEllipsize && hintBoring.width <= hintWidth) {
                    if (mSavedHintLayout != null) {
                        mHintLayout = mSavedHintLayout.
                                replaceOrMake(mHint, mTextPaint,
                                hintWidth, alignment, mSpacingMult, mSpacingAdd,
                                hintBoring, mIncludePad, mEllipsize,
                                ellipsisWidth);
                    } else {
                        mHintLayout = BoringLayout.make(mHint, mTextPaint,
                                hintWidth, alignment, mSpacingMult, mSpacingAdd,
                                hintBoring, mIncludePad, mEllipsize,
                                ellipsisWidth);
                    }
                } else if (shouldEllipsize) {
                    mHintLayout = new StaticLayout(mHint,
                                0, mHint.length(),
                                mTextPaint, hintWidth, alignment, mSpacingMult,
                                mSpacingAdd, mIncludePad, mEllipsize,
                                ellipsisWidth);
                } else {
                    mHintLayout = new StaticLayout(mHint, mTextPaint,
                            hintWidth, alignment, mSpacingMult, mSpacingAdd,
                            mIncludePad);
                }
            } else if (shouldEllipsize) {
                mHintLayout = new StaticLayout(mHint,
                            0, mHint.length(),
                            mTextPaint, hintWidth, alignment, mSpacingMult,
                            mSpacingAdd, mIncludePad, mEllipsize,
                            ellipsisWidth);
            } else {
                mHintLayout = new StaticLayout(mHint, mTextPaint,
                        hintWidth, alignment, mSpacingMult, mSpacingAdd,
@@ -4983,8 +5017,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }
    }

    private static final BoringLayout.Metrics UNKNOWN_BORING =
                                                new BoringLayout.Metrics();
    private static final BoringLayout.Metrics UNKNOWN_BORING = new BoringLayout.Metrics();

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
@@ -5011,8 +5044,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            }

            if (des < 0) {
                boring = BoringLayout.isBoring(mTransformed, mTextPaint,
                                               mBoring);
                boring = BoringLayout.isBoring(mTransformed, mTextPaint, mBoring);
                if (boring != null) {
                    mBoring = boring;
                }
@@ -5022,8 +5054,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

            if (boring == null || boring == UNKNOWN_BORING) {
                if (des < 0) {
                    des = (int) FloatMath.ceil(Layout.
                                    getDesiredWidth(mTransformed, mTextPaint));
                    des = (int) FloatMath.ceil(Layout.getDesiredWidth(mTransformed, mTextPaint));
                }

                width = des;
@@ -5041,13 +5072,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                int hintDes = -1;
                int hintWidth;

                if (mHintLayout != null) {
                if (mHintLayout != null && mEllipsize == null) {
                    hintDes = desired(mHintLayout);
                }

                if (hintDes < 0) {
                    hintBoring = BoringLayout.isBoring(mHint, mTextPaint,
                                                       mHintBoring);
                    hintBoring = BoringLayout.isBoring(mHint, mTextPaint, mHintBoring);
                    if (hintBoring != null) {
                        mHintBoring = hintBoring;
                    }
@@ -5055,8 +5085,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

                if (hintBoring == null || hintBoring == UNKNOWN_BORING) {
                    if (hintDes < 0) {
                        hintDes = (int) FloatMath.ceil(Layout.
                                        getDesiredWidth(mHint, mTextPaint));
                        hintDes = (int) FloatMath.ceil(
                                Layout.getDesiredWidth(mHint, mTextPaint));
                    }

                    hintWidth = hintDes;
@@ -5102,8 +5132,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        if (mLayout == null) {
            makeNewLayout(want, hintWant, boring, hintBoring,
                          width - getCompoundPaddingLeft() - getCompoundPaddingRight(),
                          false);
                          width - getCompoundPaddingLeft() - getCompoundPaddingRight(), false);
        } else if ((mLayout.getWidth() != want) || (hintWidth != hintWant) ||
                   (mLayout.getEllipsizedWidth() !=
                        width - getCompoundPaddingLeft() - getCompoundPaddingRight())) {
@@ -5114,8 +5143,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                mLayout.increaseWidthTo(want);
            } else {
                makeNewLayout(want, hintWant, boring, hintBoring,
                              width - getCompoundPaddingLeft() - getCompoundPaddingRight(),
                              false);
                              width - getCompoundPaddingLeft() - getCompoundPaddingRight(), false);
            }
        } else {
            // Width has not changed.
@@ -5136,11 +5164,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            }
        }

        int unpaddedHeight = height - getCompoundPaddingTop() -
                                getCompoundPaddingBottom();
        int unpaddedHeight = height - getCompoundPaddingTop() - getCompoundPaddingBottom();
        if (mMaxMode == LINES && mLayout.getLineCount() > mMaximum) {
            unpaddedHeight = Math.min(unpaddedHeight,
                                      mLayout.getLineTop(mMaximum));
            unpaddedHeight = Math.min(unpaddedHeight, mLayout.getLineTop(mMaximum));
        }

        /*
@@ -5159,8 +5185,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }

    private int getDesiredHeight() {
        return Math.max(getDesiredHeight(mLayout, true),
                        getDesiredHeight(mHintLayout, false));
        return Math.max(
                getDesiredHeight(mLayout, true),
                getDesiredHeight(mHintLayout, mEllipsize != null));
    }

    private int getDesiredHeight(Layout layout, boolean cap) {
@@ -5803,6 +5830,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }

    private void startMarquee() {
        // Do not ellipsize EditText
        if (mInput != null) return;

        if (compressText(getWidth() - getCompoundPaddingLeft() - getCompoundPaddingRight())) {
            return;
        }
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
    package="com.android.film">
    <application android:label="Film">
        <activity android:name="Film"
                  android:screenOrientation="portrait"
                  android:theme="@android:style/Theme.Black.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
+36 −47
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@

#pragma version(1)
#pragma stateVertex(PV)
#pragma stateFragment(default)
#pragma stateFragmentStore(default)
#pragma stateFragment(PFBackground)
#pragma stateFragmentStore(PFSBackground)

/*
typedef struct FilmScriptUserEnvRec {
@@ -19,66 +19,54 @@ typedef struct FilmScriptUserEnvRec {
// bank1: (r) The position information
// bank2: (rw) The temporary texture state

int main(void* con, int ft, int index) 
int main(int index) 
{
    int f1;
    int f2;
    int f3;
    int f4;
    int f5;
    int f6;
    int f7;
    int f8;
    int f9;
    int f10;
    int f11;
    int f12;
    int f13;
    int f14;
    int f15;
    int f16;

    int f1,f2,f3,f4, f5,f6,f7,f8, f9,f10,f11,f12, f13,f14,f15,f16;
    int g1,g2,g3,g4, g5,g6,g7,g8, g9,g10,g11,g12, g13,g14,g15,g16;
    int float_1;
    int float_0;
    int float_2;
    int float_90;
    int float_0_5;
    int trans;  // float
    int rot;   // float
    int x;

    float_2 = intToFloat(2);
    float_1 = intToFloat(1);
    float_0 = intToFloat(0);
    float_90= intToFloat(90);
    float_0_5 = fixedtoFloat(0x8000);

    //trans = loadEnvF(con, 1, 0);
    //rot = loadEnvF(con, 1, 1);

    //matrixLoadTranslate(con, &f1, 0, 0, trans);
    //matrixRotate(con, &f1, rot, 1, 0, 0);
    //matrixScale(con, &f1, 3.0f, 3.0f, 3.0f);
    //storeEnvMatrix(con, 3, RS_PROGRAM_VERTEX_MODELVIEW_OFFSET, &f1);
    trans = loadF(1, 0);
    rot = loadF(1, 1);

    //rsc_Matrix m;
    //int imgId = 0;

    // This should be replaced in the compiler with a 
    // smart load of a structure.
    //const FilmScriptUserEnv *env = loadEnvVp(con, 0,0);
    matrixLoadScale(&f16, float_2, float_2, float_2);
    matrixTranslate(&f16, 0, 0, trans);
    matrixRotate(&f16, float_90, 0, 0, float_1);
    matrixRotate(&f16, rot, float_1, 0, 0);
    storeEnvMatrix(3, 0, &f16);

    //materialDiffuse(con, 0.0f, 0.0f, 0.0f, 1.0f);
    //materialSpecular(con, 0.5f, 0.5f, 0.5f, 0.5f);
    //materialShininess(con, 20.0f);

    //materialShininess(intToFloat(20));
    //lightPosition(con, 0.2f, -0.2f, -2.0f, 0.0f);
    //enable(con, GL_LIGHTING);
    renderTriangleMesh(NAMED_mesh);


    //lightPosition(con, 0.2f, -0.2f, -2.0f, 0.0f);

    //contextBindProgramFragmentStore(con, NAMED_PFSBackground);
    //contextBindProgramFragment(con, NAMED_PFBackground);
    //enable(con, GL_LIGHTING);
    renderTriangleMesh(con, NAMED_mesh);
    //int imgId = 0;

/*
    contextBindProgramFragmentStore(con, env->fsImages);
    contextBindProgramFragment(con, env->fpImages);
    disable(con, GL_LIGHTING);
    contextBindProgramFragmentStore(env->fsImages);
    contextBindProgramFragment(env->fpImages);
    disable(GL_LIGHTING);

    float focusPos = loadEnvF(con, 1, 2);
    int32_t focusID = 0;
    int32_t lastFocusID = loadEnvI32(con, 2, 0);
    int32_t imgCount = 13;
    float focusPos = loadEnvF(1, 2);
    int focusID = 0;
    int lastFocusID = loadEnvI32(2, 0);
    int imgCount = 13;

    if (trans > (-.3)) {
        focusID = -1.0 - focusPos;
@@ -127,5 +115,6 @@ int main(void* con, int ft, int index)
        renderTriangleMeshRange(con, env->mesh, env->triangleOffsets[start], env->triangleOffsets[end] - env->triangleOffsets[start]);
    } 
*/
    return 0;
}
Loading