diff options
18 files changed, 189 insertions, 138 deletions
diff --git a/core/java/android/provider/SearchIndexablesContract.java b/core/java/android/provider/SearchIndexablesContract.java index b8635b8..05f3a1c 100644 --- a/core/java/android/provider/SearchIndexablesContract.java +++ b/core/java/android/provider/SearchIndexablesContract.java @@ -73,7 +73,8 @@ public class SearchIndexablesContract { public static final String[] INDEXABLES_RAW_COLUMNS = new String[] { RawData.COLUMN_RANK, RawData.COLUMN_TITLE, - RawData.COLUMN_SUMMARY, + RawData.COLUMN_SUMMARY_ON, + RawData.COLUMN_SUMMARY_OFF, RawData.COLUMN_KEYWORDS, RawData.COLUMN_SCREEN_TITLE, RawData.COLUMN_CLASS_NAME, @@ -123,9 +124,14 @@ public class SearchIndexablesContract { public static final String COLUMN_TITLE = "title"; /** - * Summary's raw data. + * Summary's raw data when the data is "ON". */ - public static final String COLUMN_SUMMARY = "summary"; + public static final String COLUMN_SUMMARY_ON = "summaryOn"; + + /** + * Summary's raw data when the data is "OFF". + */ + public static final String COLUMN_SUMMARY_OFF = "summaryOff"; /** * Keywords' raw data. diff --git a/core/jni/android_media_AudioTrack.cpp b/core/jni/android_media_AudioTrack.cpp index 1af41f2..162d0c4 100644 --- a/core/jni/android_media_AudioTrack.cpp +++ b/core/jni/android_media_AudioTrack.cpp @@ -887,17 +887,22 @@ static jint android_media_AudioTrack_get_min_buff_size(JNIEnv *env, jobject thi } // ---------------------------------------------------------------------------- -static void +static jint android_media_AudioTrack_setAuxEffectSendLevel(JNIEnv *env, jobject thiz, jfloat level ) { sp<AudioTrack> lpTrack = getAudioTrack(env, thiz); if (lpTrack == NULL ) { jniThrowException(env, "java/lang/IllegalStateException", "Unable to retrieve AudioTrack pointer for setAuxEffectSendLevel()"); - return; + return -1; } - lpTrack->setAuxEffectSendLevel(level); + status_t status = lpTrack->setAuxEffectSendLevel(level); + if (status != NO_ERROR) { + ALOGE("AudioTrack::setAuxEffectSendLevel() for level %g failed with status %d", + level, status); + } + return (jint) status; } // ---------------------------------------------------------------------------- @@ -953,7 +958,7 @@ static JNINativeMethod gMethods[] = { {"native_get_min_buff_size", "(III)I", (void *)android_media_AudioTrack_get_min_buff_size}, {"native_setAuxEffectSendLevel", - "(F)V", (void *)android_media_AudioTrack_setAuxEffectSendLevel}, + "(F)I", (void *)android_media_AudioTrack_setAuxEffectSendLevel}, {"native_attachAuxEffect", "(I)I", (void *)android_media_AudioTrack_attachAuxEffect}, }; diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 369dda1..4d43831 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1677,6 +1677,7 @@ that is, when in portrait. Can be either an absolute dimension or a fraction of the screen size in that dimension. --> <attr name="windowFixedHeightMajor" format="dimension|fraction" /> + <attr name="windowOutsetBottom" format="dimension" /> </declare-styleable> <!-- The set of attributes that describe a AlertDialog's theme. --> diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd index 6d29c69..92ecd24 100644 --- a/docs/html/about/dashboards/index.jd +++ b/docs/html/about/dashboards/index.jd @@ -61,7 +61,7 @@ Platform Versions</a>.</p> </div> -<p style="clear:both"><em>Data collected during a 7-day period ending on March 3, 2014. +<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014. <br/>Any versions with less than 0.1% distribution are not shown.</em> </p> @@ -92,7 +92,7 @@ Screens</a>.</p> </div> -<p style="clear:both"><em>Data collected during a 7-day period ending on March 3, 2014. +<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014. <br/>Any screen configurations with less than 0.1% distribution are not shown.</em></p> @@ -133,17 +133,17 @@ uses.</p> </tr> <tr> <td>2.0</th> -<td>91.1%</td> +<td>89.4%</td> </tr> <tr> <td>3.0</th> -<td>8.8%</td> +<td>10.5%</td> </tr> </table> -<p style="clear:both"><em>Data collected during a 7-day period ending on March 3, 2014</em></p> +<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014</em></p> @@ -161,17 +161,17 @@ uses.</p> var VERSION_DATA = [ { - "chart": "//chart.googleapis.com/chart?chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat&chd=t%3A1.2%2C19.0%2C0.1%2C15.2%2C62.0%2C2.5&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=500x250&cht=p", + "chart": "//chart.googleapis.com/chart?cht=p&chs=500x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A1.1%2C17.8%2C0.1%2C14.3%2C61.4%2C5.3&chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat", "data": [ { "api": 8, "name": "Froyo", - "perc": "1.2" + "perc": "1.1" }, { "api": 10, "name": "Gingerbread", - "perc": "19.0" + "perc": "17.8" }, { "api": 13, @@ -181,27 +181,27 @@ var VERSION_DATA = { "api": 15, "name": "Ice Cream Sandwich", - "perc": "15.2" + "perc": "14.3" }, { "api": 16, "name": "Jelly Bean", - "perc": "35.3" + "perc": "34.4" }, { "api": 17, "name": "Jelly Bean", - "perc": "17.1" + "perc": "18.1" }, { "api": 18, "name": "Jelly Bean", - "perc": "9.6" + "perc": "8.9" }, { "api": 19, "name": "KitKat", - "perc": "2.5" + "perc": "5.3" } ] } @@ -218,16 +218,15 @@ var SCREEN_DATA = "Large": { "hdpi": "0.6", "ldpi": "0.7", - "mdpi": "4.3", + "mdpi": "4.4", "tvdpi": "1.5", "xhdpi": "0.6" }, "Normal": { "hdpi": "33.7", - "ldpi": "0.2", - "mdpi": "13.6", - "xhdpi": "19.9", - "xxhdpi": "11.9" + "mdpi": "13.2", + "xhdpi": "19.8", + "xxhdpi": "12.5" }, "Small": { "ldpi": "8.1" @@ -235,12 +234,12 @@ var SCREEN_DATA = "Xlarge": { "hdpi": "0.3", "ldpi": "0.1", - "mdpi": "4.3", - "xhdpi": "0.2" + "mdpi": "4.2", + "xhdpi": "0.3" } }, - "densitychart": "//chart.googleapis.com/chart?chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chd=t%3A9.1%2C22.2%2C1.5%2C34.6%2C20.7%2C11.9&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=400x250&cht=p", - "layoutchart": "//chart.googleapis.com/chart?chl=Xlarge%7CLarge%7CNormal%7CSmall&chd=t%3A4.9%2C7.7%2C79.3%2C8.1&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&chs=400x250&cht=p" + "densitychart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A8.9%2C21.8%2C1.5%2C34.6%2C20.7%2C12.6&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi", + "layoutchart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A4.9%2C7.8%2C79.3%2C8.1&chl=Xlarge%7CLarge%7CNormal%7CSmall" } ]; diff --git a/docs/html/google/index.jd b/docs/html/google/index.jd index b743b66..2e97d62 100644 --- a/docs/html/google/index.jd +++ b/docs/html/google/index.jd @@ -125,7 +125,7 @@ cloud messaging.</p> <img src="{@docRoot}images/google/analytics.png" width="40" /> </div> <h4><a class="external-link" -href="https://developers.google.com/analytics/devguides/collection/android/v2/" +href="https://developers.google.com/analytics/devguides/collection/android/v4/" >Google Analytics</a></h4> <p>Measure your success and gain insights into how users engage with your app content diff --git a/docs/html/sdk/installing/studio-build.jd b/docs/html/sdk/installing/studio-build.jd index 41ad5de..8674134 100644 --- a/docs/html/sdk/installing/studio-build.jd +++ b/docs/html/sdk/installing/studio-build.jd @@ -1,4 +1,4 @@ -page.title=Building your Project +page.title=Building Your Project with Gradle @jd:body diff --git a/docs/html/tools/tools_toc.cs b/docs/html/tools/tools_toc.cs index 0e543e4..c281644 100644 --- a/docs/html/tools/tools_toc.cs +++ b/docs/html/tools/tools_toc.cs @@ -37,7 +37,7 @@ <li><a href="<?cs var:toroot ?>sdk/installing/studio-layout.html"> Using the Layout Editor</a></li> <li><a href="<?cs var:toroot ?>sdk/installing/studio-build.html"> - Building your Project</a></li> + Building Your Project with Gradle</a></li> </ul> </li> <li><a href="<?cs var:toroot ?>sdk/exploring.html"> diff --git a/docs/html/wear/images/laptop-bridge.png b/docs/html/wear/images/laptop-bridge.png Binary files differindex b481224..083b82b 100644 --- a/docs/html/wear/images/laptop-bridge.png +++ b/docs/html/wear/images/laptop-bridge.png diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java index 40c6797..57bc171 100644 --- a/media/java/android/media/AudioTrack.java +++ b/media/java/android/media/AudioTrack.java @@ -1321,7 +1321,7 @@ public class AudioTrack * * @param level send level scalar * @return error code or success, see {@link #SUCCESS}, - * {@link #ERROR_INVALID_OPERATION} + * {@link #ERROR_INVALID_OPERATION}, {@link #ERROR} */ public int setAuxEffectSendLevel(float level) { if (isRestricted()) { @@ -1337,8 +1337,8 @@ public class AudioTrack if (level > getMaxVolume()) { level = getMaxVolume(); } - native_setAuxEffectSendLevel(level); - return SUCCESS; + int err = native_setAuxEffectSendLevel(level); + return err == 0 ? SUCCESS : ERROR; } //--------------------------------------------------------- @@ -1508,7 +1508,7 @@ public class AudioTrack int sampleRateInHz, int channelConfig, int audioFormat); private native final int native_attachAuxEffect(int effectId); - private native final void native_setAuxEffectSendLevel(float level); + private native final int native_setAuxEffectSendLevel(float level); //--------------------------------------------------------- // Utility methods diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp index b2fb2df..d04b1f8 100644 --- a/media/jni/android_media_MediaCodec.cpp +++ b/media/jni/android_media_MediaCodec.cpp @@ -27,6 +27,8 @@ #include "jni.h" #include "JNIHelp.h" +#include <cutils/compiler.h> + #include <gui/Surface.h> #include <media/ICrypto.h> @@ -738,6 +740,10 @@ static void android_media_MediaCodec_queueSecureInputBuffer( } else if (numBytesOfClearDataObj != NULL && env->GetArrayLength(numBytesOfClearDataObj) < numSubSamples) { err = -ERANGE; + // subSamples array may silently overflow if number of samples are too large. Use + // INT32_MAX as maximum allocation size may be less than SIZE_MAX on some platforms + } else if ( CC_UNLIKELY(numSubSamples >= INT32_MAX / sizeof(*subSamples)) ) { + err = -EINVAL; } else { jboolean isCopy; diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index a9b6985..38e1083 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -248,6 +248,6 @@ <!-- Z distance between notifications if they are in the stack --> <dimen name="z_distance_between_notifications">2dp</dimen> - <!-- Width of the zen mode interstitial dialog. Defaults to MATCH_PARENT. --> - <dimen name="zen_mode_dialog_width">-1px</dimen> + <!-- Width of the zen mode interstitial dialog. --> + <dimen name="zen_mode_dialog_width">320dp</dimen> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java index aed9a71..d67f7cd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java @@ -911,6 +911,7 @@ class QuickSettings { d.getWindow().setAttributes(lp); } }; + v.setAutoActivate(true); v.setAdapter(new ZenModeViewAdapter(mContext) { @Override public void configure() { @@ -928,7 +929,6 @@ class QuickSettings { d.create(); d.getWindow().setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY); WindowManager.LayoutParams lp = d.getWindow().getAttributes(); - lp.horizontalMargin = 0; lp.width = mContext.getResources().getDimensionPixelSize(R.dimen.zen_mode_dialog_width); d.getWindow().setAttributes(lp); d.show(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java index d1a9d57..49cf78b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeView.java @@ -16,11 +16,8 @@ package com.android.systemui.statusbar.phone; -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.Context; -import android.graphics.Paint; import android.graphics.PorterDuff.Mode; import android.graphics.Typeface; import android.graphics.drawable.ShapeDrawable; @@ -39,14 +36,12 @@ import android.view.View; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.FrameLayout; -import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.Switch; import android.widget.TextView; import android.widget.Toast; -import com.android.systemui.R; import com.android.systemui.statusbar.phone.ZenModeView.Adapter.ExitCondition; public class ZenModeView extends RelativeLayout { @@ -63,20 +58,21 @@ public class ZenModeView extends RelativeLayout { private static final long DURATION = new ValueAnimator().getDuration(); private static final long PAGER_DURATION = DURATION / 2; - private static final float BOUNCE_SCALE = 0.8f; private static final long CLOSE_DELAY = 600; + private static final long AUTO_ACTIVATE_DELAY = 100; private final Context mContext; - private final Paint mPathPaint; - private final ImageView mSettingsButton; private final TextView mModeText; private final Switch mModeSwitch; private final View mDivider; private final UntilPager mUntilPager; private final ProgressDots mProgressDots; + private final View mDivider2; + private final TextView mSettingsButton; private Adapter mAdapter; private boolean mInit; + private boolean mAutoActivate; public ZenModeView(Context context) { this(context, null); @@ -90,29 +86,9 @@ public class ZenModeView extends RelativeLayout { final int iconSize = mContext.getResources() .getDimensionPixelSize(com.android.internal.R.dimen.notification_large_icon_width); final int topRowSize = iconSize * 2 / 3; - final int p = topRowSize / 7; + final int p = topRowSize / 3; - mPathPaint = new Paint(Paint.ANTI_ALIAS_FLAG); - mPathPaint.setStyle(Paint.Style.STROKE); - mPathPaint.setColor(GRAY); - mPathPaint.setStrokeWidth(p / 2); - - mSettingsButton = new ImageView(mContext); - mSettingsButton.setPadding(p, p, p, p); - mSettingsButton.setImageResource(R.drawable.ic_notify_settings_normal); - LayoutParams lp = new LayoutParams(topRowSize, topRowSize); - lp.topMargin = p; - lp.leftMargin = p; - addView(mSettingsButton, lp); - mSettingsButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mAdapter != null) { - mAdapter.configure(); - } - bounce(mSettingsButton, null); - } - }); + LayoutParams lp = null; mModeText = new TextView(mContext); mModeText.setText(MODE_LABEL); @@ -120,11 +96,10 @@ public class ZenModeView extends RelativeLayout { mModeText.setTextColor(GRAY); mModeText.setTypeface(CONDENSED); mModeText.setAllCaps(true); - mModeText.setGravity(Gravity.CENTER); - mModeText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mModeText.getTextSize() * 1.1f); + mModeText.setGravity(Gravity.LEFT | Gravity.CENTER_VERTICAL); + mModeText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mModeText.getTextSize() * 1.5f); lp = new LayoutParams(LayoutParams.WRAP_CONTENT, topRowSize); - lp.topMargin = p; - lp.addRule(CENTER_HORIZONTAL); + lp.leftMargin = p; addView(mModeText, lp); mModeSwitch = new Switch(mContext); @@ -132,6 +107,7 @@ public class ZenModeView extends RelativeLayout { mModeSwitch.setSwitchTypeface(CONDENSED); lp = new LayoutParams(LayoutParams.WRAP_CONTENT, topRowSize); lp.topMargin = p; + lp.rightMargin = p; lp.addRule(ALIGN_PARENT_RIGHT); lp.addRule(ALIGN_BASELINE, mModeText.getId()); addView(mModeSwitch, lp); @@ -154,11 +130,10 @@ public class ZenModeView extends RelativeLayout { mDivider.setBackgroundColor(GRAY); lp = new LayoutParams(LayoutParams.MATCH_PARENT, 2); lp.addRule(BELOW, mModeText.getId()); - lp.topMargin = p; - lp.bottomMargin = p * 2; + lp.bottomMargin = p; addView(mDivider, lp); - mUntilPager = new UntilPager(mContext, mPathPaint, iconSize * 3 / 4); + mUntilPager = new UntilPager(mContext, iconSize * 3 / 4); mUntilPager.setId(android.R.id.tabhost); lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lp.leftMargin = lp.rightMargin = iconSize / 2; @@ -167,10 +142,41 @@ public class ZenModeView extends RelativeLayout { addView(mUntilPager, lp); mProgressDots = new ProgressDots(mContext, iconSize / 5); + mProgressDots.setId(android.R.id.progress); lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); lp.addRule(CENTER_HORIZONTAL); lp.addRule(BELOW, mUntilPager.getId()); addView(mProgressDots, lp); + + mDivider2 = new View(mContext); + mDivider2.setId(android.R.id.widget_frame); + mDivider2.setBackgroundColor(GRAY); + lp = new LayoutParams(LayoutParams.MATCH_PARENT, 2); + lp.addRule(BELOW, mProgressDots.getId()); + addView(mDivider2, lp); + + mSettingsButton = new TextView(mContext); + mSettingsButton.setTypeface(CONDENSED); + mSettingsButton.setTextSize(TypedValue.COMPLEX_UNIT_PX, mSettingsButton.getTextSize() * 1.3f); + mSettingsButton.setPadding(p, p, p, p); + mSettingsButton.setText("More settings..."); + lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); + lp.addRule(BELOW, mDivider2.getId()); + addView(mSettingsButton, lp); + mSettingsButton.setOnTouchListener(new OnTouchListener() { + @Override + public boolean onTouch(View v, MotionEvent event) { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + mSettingsButton.setBackgroundColor(DARK_GRAY); + } else if (event.getAction() == MotionEvent.ACTION_UP) { + mSettingsButton.setBackground(null); + if (mAdapter != null) { + mAdapter.configure(); + } + } + return true; + } + }); } public void setAdapter(Adapter adapter) { @@ -189,6 +195,27 @@ public class ZenModeView extends RelativeLayout { updateState(false); } + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + if (mAutoActivate) { + mAutoActivate = false; + postDelayed(new Runnable() { + @Override + public void run() { + if (!mModeSwitch.isChecked()) { + mInit = false; + mModeSwitch.setChecked(true); + } + } + }, AUTO_ACTIVATE_DELAY); + } + } + + public void setAutoActivate(boolean value) { + mAutoActivate = value; + } + private void updateState(boolean animate) { mUntilPager.updateState(); mModeSwitch.setChecked(mAdapter.getMode()); @@ -199,23 +226,6 @@ public class ZenModeView extends RelativeLayout { Log.d(TAG, args == null || args.length == 0 ? msg : String.format(msg, args)); } - private static void bounce(final View v, final Runnable midBounce) { - v.animate().scaleX(BOUNCE_SCALE).scaleY(BOUNCE_SCALE).setDuration(DURATION / 3) - .setListener(new AnimatorListenerAdapter() { - private boolean mFired; - @Override - public void onAnimationEnd(Animator animation) { - if (!mFired) { - mFired = true; - if (midBounce != null) { - midBounce.run(); - } - v.animate().scaleX(1).scaleY(1).setListener(null).start(); - } - } - }).start(); - } - private final class UntilView extends FrameLayout { private static final boolean SUPPORT_LINKS = false; @@ -223,7 +233,7 @@ public class ZenModeView extends RelativeLayout { public UntilView(Context context) { super(context); mText = new TextView(mContext); - mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mText.getTextSize() * 1.2f); + mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mText.getTextSize() * 1.3f); mText.setTypeface(CONDENSED); mText.setTextColor(GRAY); mText.setGravity(Gravity.CENTER); @@ -284,7 +294,7 @@ public class ZenModeView extends RelativeLayout { private int mCurrent; private float mDownX; - public UntilPager(Context context, Paint pathPaint, int iconSize) { + public UntilPager(Context context, int iconSize) { super(context); mViews = new UntilView[3]; for (int i = 0; i < mViews.length; i++) { diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java index a65f677..fd0c896 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java @@ -145,6 +145,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { TypedValue mFixedWidthMinor; TypedValue mFixedHeightMajor; TypedValue mFixedHeightMinor; + TypedValue mOutsetBottom; // This is the top-level view of the window, containing the window decor. private DecorView mDecor; @@ -2370,7 +2371,6 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } else { h = 0; } - if (h > 0) { final int heightSize = MeasureSpec.getSize(heightMeasureSpec); heightMeasureSpec = MeasureSpec.makeMeasureSpec( @@ -2379,6 +2379,15 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } + if (mOutsetBottom != null) { + int mode = MeasureSpec.getMode(heightMeasureSpec); + if (mode != MeasureSpec.UNSPECIFIED) { + int outset = (int) mOutsetBottom.getDimension(metrics); + int height = MeasureSpec.getSize(heightMeasureSpec); + heightMeasureSpec = MeasureSpec.makeMeasureSpec(height + outset, mode); + } + } + super.onMeasure(widthMeasureSpec, heightMeasureSpec); int width = getMeasuredWidth(); @@ -2992,6 +3001,9 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } if (a.getBoolean(com.android.internal.R.styleable.Window_windowContentTransitions, false)) { requestFeature(FEATURE_CONTENT_TRANSITIONS); + if (a.hasValue(com.android.internal.R.styleable.Window_windowOutsetBottom)) { + if (mOutsetBottom == null) mOutsetBottom = new TypedValue(); + a.getValue(com.android.internal.R.styleable.Window_windowOutsetBottom, mOutsetBottom); } final Context context = getContext(); diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 09a414e..288e8e0 100755 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -700,7 +700,7 @@ public class PackageManagerService extends IPackageManager.Stub { // Just post MCS_BOUND message to trigger processing // of next pending install. if (DEBUG_SD_INSTALL) Log.i(TAG, - "Posting MCS_BOUND for next woek"); + "Posting MCS_BOUND for next work"); mHandler.sendEmptyMessage(MCS_BOUND); } } @@ -7533,32 +7533,34 @@ public class PackageManagerService extends IPackageManager.Stub { mSuccess = getPackageSizeInfoLI(mStats.packageName, mStats.userHandle, mStats); } - final boolean mounted; - if (Environment.isExternalStorageEmulated()) { - mounted = true; - } else { - final String status = Environment.getExternalStorageState(); - mounted = (Environment.MEDIA_MOUNTED.equals(status) - || Environment.MEDIA_MOUNTED_READ_ONLY.equals(status)); - } + if (mSuccess) { + final boolean mounted; + if (Environment.isExternalStorageEmulated()) { + mounted = true; + } else { + final String status = Environment.getExternalStorageState(); + mounted = (Environment.MEDIA_MOUNTED.equals(status) + || Environment.MEDIA_MOUNTED_READ_ONLY.equals(status)); + } - if (mounted) { - final UserEnvironment userEnv = new UserEnvironment(mStats.userHandle); + if (mounted) { + final UserEnvironment userEnv = new UserEnvironment(mStats.userHandle); - mStats.externalCacheSize = calculateDirectorySize(mContainerService, - userEnv.buildExternalStorageAppCacheDirs(mStats.packageName)); + mStats.externalCacheSize = calculateDirectorySize(mContainerService, + userEnv.buildExternalStorageAppCacheDirs(mStats.packageName)); - mStats.externalDataSize = calculateDirectorySize(mContainerService, - userEnv.buildExternalStorageAppDataDirs(mStats.packageName)); + mStats.externalDataSize = calculateDirectorySize(mContainerService, + userEnv.buildExternalStorageAppDataDirs(mStats.packageName)); - // Always subtract cache size, since it's a subdirectory - mStats.externalDataSize -= mStats.externalCacheSize; + // Always subtract cache size, since it's a subdirectory + mStats.externalDataSize -= mStats.externalCacheSize; - mStats.externalMediaSize = calculateDirectorySize(mContainerService, - userEnv.buildExternalStorageAppMediaDirs(mStats.packageName)); + mStats.externalMediaSize = calculateDirectorySize(mContainerService, + userEnv.buildExternalStorageAppMediaDirs(mStats.packageName)); - mStats.externalObbSize = calculateDirectorySize(mContainerService, - userEnv.buildExternalStorageAppObbDirs(mStats.packageName)); + mStats.externalObbSize = calculateDirectorySize(mContainerService, + userEnv.buildExternalStorageAppObbDirs(mStats.packageName)); + } } } @@ -10271,6 +10273,9 @@ public class PackageManagerService extends IPackageManager.Stub { final IPackageStatsObserver observer) { mContext.enforceCallingOrSelfPermission( android.Manifest.permission.GET_PACKAGE_SIZE, null); + if (packageName == null) { + throw new IllegalArgumentException("Attempt to get size of null packageName"); + } PackageStats stats = new PackageStats(packageName, userHandle); diff --git a/telecomm/java/android/telecomm/InCallAdapter.java b/telecomm/java/android/telecomm/InCallAdapter.java index 4f32458..2933f17 100644 --- a/telecomm/java/android/telecomm/InCallAdapter.java +++ b/telecomm/java/android/telecomm/InCallAdapter.java @@ -165,15 +165,15 @@ public final class InCallAdapter { * A post-dial DTMF string is a string of digits entered after a phone number, when dialed, * that are immediately sent as DTMF tones to the recipient as soon as the connection is made. * While these tones are playing, Telecomm will notify the {@link InCallService} that the call - * is in the {@link InCallService#setPostDial(String)} state. + * is in the {@link InCallService#setPostDial(String,String)} state. * - * If the DTMF string contains a {@link #DTMF_CHARACTER_PAUSE} symbol, Telecomm will temporarily - * pause playing the tones for a pre-defined period of time. + * If the DTMF string contains a {@link TelecommConstants#DTMF_CHARACTER_PAUSE} symbol, Telecomm + * will temporarily pause playing the tones for a pre-defined period of time. * - * If the DTMF string contains a {@link #DTMF_CHARACTER_WAIT} symbol, Telecomm will pause - * playing the tones and notify the {@link InCallService} that the call is in the - * {@link InCallService#setPostDialWait(String)} state. When the user decides to continue the - * postdial sequence, the {@link InCallService} should invoke the + * If the DTMF string contains a {@link TelecommConstants#DTMF_CHARACTER_WAIT} symbol, Telecomm + * will pause playing the tones and notify the {@link InCallService} that the call is in the + * {@link InCallService#setPostDialWait(String,String)} state. When the user decides to continue + * the postdial sequence, the {@link InCallService} should invoke the * {@link #postDialContinue(String)} method. * * @param callId The unique ID of the call for which postdial string playing should continue. diff --git a/telecomm/java/android/telecomm/InCallService.java b/telecomm/java/android/telecomm/InCallService.java index 8131815..3942d70 100644 --- a/telecomm/java/android/telecomm/InCallService.java +++ b/telecomm/java/android/telecomm/InCallService.java @@ -201,7 +201,7 @@ public abstract class InCallService extends Service { /** * Indicates to the in-call app that the specified call is currently connected to another party * and a communication channel is open between them. Normal transitions are to - * {@link #setDisconnected(String)} when the call is complete. + * {@link #setDisconnected(String,int)} when the call is complete. * * @param callId The identifier of the call changing state. */ @@ -211,7 +211,7 @@ public abstract class InCallService extends Service { * Indicates to the in-call app that the specified call is outgoing and in the dialing state. * Normal transition are to {@link #setActive(String)} if the call was answered, * {@link #setPostDial(String,String)} if the dialed number includes a post-dial DTMF string, or - * {@link #setDisconnected(String)} if the call was disconnected immediately. + * {@link #setDisconnected(String,int)} if the call was disconnected immediately. * * @param callId The identifier of the call changing state. */ @@ -221,8 +221,8 @@ public abstract class InCallService extends Service { * Indicates to the in-call app that the specified call is incoming and the user still has the * option of answering, rejecting, or doing nothing with the call. This state is usually * associated with some type of audible ringtone. Normal transitions are to - * {@link #setActive(String)} if the call is answered, or {@link #setDisconnected(String)} if - * the call is not answered or is otherwise disconnected for some reason. + * {@link #setActive(String)} if the call is answered, or {@link #setDisconnected(String,int)} + * if the call is not answered or is otherwise disconnected for some reason. * * @param callId The identifier of the call changing state. */ @@ -258,7 +258,7 @@ public abstract class InCallService extends Service { * where Telecomm is now sending some dual-tone multi-frequency signaling (DTMF) tones appended * to the dialed number. Normal transitions are to {@link #setPostDialWait(String,String)} when * the post-dial string requires user confirmation to proceed, {@link #setActive(String)} when - * the post-dial tones are completed, or {@link #setDisconnected(String)} if the call is + * the post-dial tones are completed, or {@link #setDisconnected(String,int)} if the call is * disconnected. * * @param callId The identifier of the call changing state. @@ -271,7 +271,7 @@ public abstract class InCallService extends Service { * {@link #setPostDial(String,String)} state but is now waiting for user confirmation before the * remaining digits can be sent. Normal transitions are to {@link #setPostDial(String,String)} * when the user asks Telecomm to proceed with the post-dial sequence and the in-call app - * informs Telecomm of this by invoking {@link IInCallAdapter#postDialContinue(String)}. + * informs Telecomm of this by invoking {@link InCallAdapter#postDialContinue(String)}. * * @param callId The identifier of the call changing state. * @param remaining The remaining postdial string to be dialed. diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java index cfe7525..cc621c4 100644 --- a/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/android/content/res/BridgeTypedArray.java @@ -52,9 +52,9 @@ public final class BridgeTypedArray extends TypedArray { private final BridgeContext mContext; private final boolean mPlatformFile; - private ResourceValue[] mResourceData; - private String[] mNames; - private boolean[] mIsFramework; + private final ResourceValue[] mResourceData; + private final String[] mNames; + private final boolean[] mIsFramework; public BridgeTypedArray(BridgeResources resources, BridgeContext context, int len, boolean platformFile) { @@ -81,8 +81,8 @@ public final class BridgeTypedArray extends TypedArray { } /** - * Seals the array after all calls to {@link #bridgeSetValue(int, String, ResourceValue)} have - * been done. + * Seals the array after all calls to + * {@link #bridgeSetValue(int, String, boolean, ResourceValue)} have been done. * <p/>This allows to compute the list of non default values, permitting * {@link #getIndexCount()} to return the proper value. */ @@ -252,7 +252,7 @@ public final class BridgeTypedArray extends TypedArray { for (String keyword : keywords) { Integer i = map.get(keyword.trim()); if (i != null) { - result |= i.intValue(); + result |= i; } else { Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_FORMAT, String.format( @@ -731,7 +731,7 @@ public final class BridgeTypedArray extends TypedArray { } // not a direct id valid reference? resolve it - Integer idValue = null; + Integer idValue; if (resValue.isFramework()) { idValue = Bridge.getResourceId(resValue.getResourceType(), @@ -742,7 +742,7 @@ public final class BridgeTypedArray extends TypedArray { } if (idValue != null) { - return idValue.intValue(); + return idValue; } Bridge.getLog().warning(LayoutLog.TAG_RESOURCES_RESOLVE, @@ -753,6 +753,12 @@ public final class BridgeTypedArray extends TypedArray { return defValue; } + @Override + public int getThemeAttributeId(int index, int defValue) { + // TODO: Get the right Theme Attribute ID to enable caching of the drawables. + return defValue; + } + /** * Retrieve the Drawable for the attribute at <var>index</var>. This * gets the resource ID of the selected attribute, and uses @@ -854,6 +860,7 @@ public final class BridgeTypedArray extends TypedArray { */ @Override public boolean hasValue(int index) { + //noinspection SimplifiableIfStatement if (index < 0 || index >= mResourceData.length) { return false; } |
