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

Commit 862401f3 authored by ctso's avatar ctso
Browse files

Merge branch 'eclair' of git://github.com/cyanogen/android_frameworks_base into HEAD

parents b6b0d0e3 f1dcbf6c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -403,10 +403,10 @@ framework_docs_SDK_CURRENT_DIR:=$(framework_docs_SDK_VERSION)_r$(framework_docs_
framework_docs_SDK_PREVIEW:=0

## Latest ADT version identifiers, for reference from published docs
framework_docs_ADT_VERSION:=0.9.5
framework_docs_ADT_DOWNLOAD:=ADT-0.9.5.zip
framework_docs_ADT_BYTES:=3372982
framework_docs_ADT_CHECKSUM:=227ec538359fbe417ccde7f0ad614a96
framework_docs_ADT_VERSION:=0.9.6
framework_docs_ADT_DOWNLOAD:=ADT-0.9.6.zip
framework_docs_ADT_BYTES:=7456339
framework_docs_ADT_CHECKSUM:=ea45d271be52b87b5dd1c9fb17536223

framework_docs_LOCAL_DROIDDOC_OPTIONS += \
		-hdf sdk.version $(framework_docs_SDK_VERSION) \
+56 −33
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ public class DateUtils
                }
            }
        } else if (duration < WEEK_IN_MILLIS && minResolution < WEEK_IN_MILLIS) {
            count = duration / DAY_IN_MILLIS;
            count = getNumberOfDaysPassed(time, now);
            if (past) {
                if (abbrevRelative) {
                    resId = com.android.internal.R.plurals.abbrev_num_days_ago;
@@ -521,6 +521,24 @@ public class DateUtils
        return String.format(format, count);
    }
    
    /**
     * Returns the number of days passed between two dates.
     *
     * @param date1 first date
     * @param date2 second date
     * @return number of days passed between to dates.
     */
    private synchronized static long getNumberOfDaysPassed(long date1, long date2) {
        if (sThenTime == null) {
            sThenTime = new Time();
        }
        sThenTime.set(date1);
        int day1 = Time.getJulianDay(date1, sThenTime.gmtoff);
        sThenTime.set(date2);
        int day2 = Time.getJulianDay(date2, sThenTime.gmtoff);
        return Math.abs(day2 - day1);
    }
    
    /**
     * Return string describing the elapsed time since startTime formatted like
     * "[relative time/date], [time]".
@@ -1655,18 +1673,22 @@ public class DateUtils
    public static CharSequence getRelativeTimeSpanString(Context c, long millis,
            boolean withPreposition) {

        String result;
        long now = System.currentTimeMillis();
        long span = now - millis;
        
        synchronized (DateUtils.class) {
            if (sNowTime == null) {
                sNowTime = new Time();
            }
            
            if (sThenTime == null) {
                sThenTime = new Time();
            }
            
            sNowTime.set(now);
            sThenTime.set(millis);
    
        String result;
            int prepositionId;
            if (span < DAY_IN_MILLIS && sNowTime.weekDay == sThenTime.weekDay) {
                // Same day
@@ -1690,6 +1712,7 @@ public class DateUtils
                Resources res = c.getResources();
                result = res.getString(prepositionId, result);
            }
        }
        return result;
    }
    
+11 −8
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@ implements TransformationMethod, TextWatcher
                sp.removeSpan(vr[i]);
            }

            removeVisibleSpans(sp);

            sp.setSpan(new ViewReference(view), 0, 0,
                       Spannable.SPAN_POINT_POINT);
        }
@@ -100,10 +102,7 @@ implements TransformationMethod, TextWatcher
            int pref = TextKeyListener.getInstance().getPrefs(v.getContext());
            if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) {
                if (count > 0) {
                    Visible[] old = sp.getSpans(0, sp.length(), Visible.class);
                    for (int i = 0; i < old.length; i++) {
                        sp.removeSpan(old[i]);
                    }
                    removeVisibleSpans(sp);

                    if (count == 1) {
                        sp.setSpan(new Visible(sp, this), start, start + count,
@@ -125,13 +124,17 @@ implements TransformationMethod, TextWatcher
            if (sourceText instanceof Spannable) {
                Spannable sp = (Spannable) sourceText;

                removeVisibleSpans(sp);
            }
        }
    }

    private static void removeVisibleSpans(Spannable sp) {
        Visible[] old = sp.getSpans(0, sp.length(), Visible.class);
        for (int i = 0; i < old.length; i++) {
            sp.removeSpan(old[i]);
        }
    }
        }
    }

    private static class PasswordCharSequence
    implements CharSequence, GetChars
+3 −0
Original line number Diff line number Diff line
@@ -8210,6 +8210,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
     * Cancels any animations for this view.
     */
    public void clearAnimation() {
        if (mCurrentAnimation != null) {
            mCurrentAnimation.detach();
        }
        mCurrentAnimation = null;
    }

+33 −1
Original line number Diff line number Diff line
@@ -255,6 +255,38 @@ public abstract class Animation implements Cloneable {
        mOneMoreTime = true;
    }

    /**
     * Cancel the animation. Cancelling an animation invokes the animation
     * listener, if set, to notify the end of the animation.
     * 
     * If you cancel an animation manually, you must call {@link #reset()}
     * before starting the animation again.
     * 
     * @see #reset() 
     * @see #start() 
     * @see #startNow() 
     * @hide
     */
    public void cancel() {
        if (mStarted && !mEnded) {
            if (mListener != null) mListener.onAnimationEnd(this);
            mEnded = true;
        }
        // Make sure we move the animation to the end
        mStartTime = Long.MIN_VALUE;
        mMore = mOneMoreTime = false;
    }

    /**
     * @hide
     */
    public void detach() {
        if (mStarted && !mEnded) {
            mEnded = true;
            if (mListener != null) mListener.onAnimationEnd(this);
        }
    }

    /**
     * Whether or not the animation has been initialized.
     *
@@ -745,10 +777,10 @@ public abstract class Animation implements Cloneable {
        if (expired) {
            if (mRepeatCount == mRepeated) {
                if (!mEnded) {
                    mEnded = true;
                    if (mListener != null) {
                        mListener.onAnimationEnd(this);
                    }
                    mEnded = true;
                }
            } else {
                if (mRepeatCount > 0) {
Loading