diff options
6 files changed, 60 insertions, 15 deletions
diff --git a/core/java/android/text/Hyphenator.java b/core/java/android/text/Hyphenator.java index 416dd01..f2b6041 100644 --- a/core/java/android/text/Hyphenator.java +++ b/core/java/android/text/Hyphenator.java @@ -61,11 +61,15 @@ public class Hyphenator { mBuffer = b; } - public static long get(@Nullable Locale locale) { + public long getNativePtr() { + return mNativePtr; + } + + public static Hyphenator get(@Nullable Locale locale) { synchronized (sLock) { Hyphenator result = sMap.get(locale); if (result != null) { - return result.mNativePtr; + return result; } // TODO: Convert this a proper locale-fallback system @@ -75,7 +79,7 @@ public class Hyphenator { result = sMap.get(languageOnlyLocale); if (result != null) { sMap.put(locale, result); - return result.mNativePtr; + return result; } // Fall back to script-only, if available @@ -88,13 +92,13 @@ public class Hyphenator { result = sMap.get(scriptOnlyLocale); if (result != null) { sMap.put(locale, result); - return result.mNativePtr; + return result; } } sMap.put(locale, sEmptyHyphenator); // To remember we found nothing. } - return sEmptyHyphenator.mNativePtr; + return sEmptyHyphenator; } private static Hyphenator loadHyphenator(String languageTag) { diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 6303322..b0b08db 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -342,7 +342,8 @@ public class StaticLayout extends Layout { private void setLocale(Locale locale) { if (!locale.equals(mLocale)) { - nSetLocale(mNativePtr, locale.toLanguageTag(), Hyphenator.get(locale)); + nSetLocale(mNativePtr, locale.toLanguageTag(), + Hyphenator.get(locale).getNativePtr()); mLocale = locale; } } diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java index 6bbebb7..9708cce 100644 --- a/core/java/com/android/internal/app/ChooserActivity.java +++ b/core/java/com/android/internal/app/ChooserActivity.java @@ -1017,7 +1017,15 @@ public class ChooserActivity extends ResolverActivity { final RowScale rs = new RowScale(ChooserRowAdapter.this, 0.f, 1.f) .setInterpolator(mInterpolator); mServiceTargetScale[i] = rs; - rs.startAnimation(); + } + + // Start the animations in a separate loop. + // The process of starting animations will result in + // binding views to set up initial values, and we must + // have ALL of the new RowScale objects created above before + // we get started. + for (int i = oldRCount; i < rcount; i++) { + mServiceTargetScale[i].startAnimation(); } } @@ -1097,17 +1105,19 @@ public class ChooserActivity extends ResolverActivity { for (int i = 0; i < mColumnCount; i++) { final View v = mChooserListAdapter.createView(row); + final int column = i; v.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - startSelected(holder.itemIndex, false, true); + startSelected(holder.itemIndices[column], false, true); } }); v.setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { showAppDetails( - mChooserListAdapter.resolveInfoForPosition(holder.itemIndex, true)); + mChooserListAdapter.resolveInfoForPosition( + holder.itemIndices[column], true)); return true; } }); @@ -1165,8 +1175,8 @@ public class ChooserActivity extends ResolverActivity { final View v = holder.cells[i]; if (start + i <= end) { v.setVisibility(View.VISIBLE); - holder.itemIndex = start + i; - mChooserListAdapter.bindView(holder.itemIndex, v); + holder.itemIndices[i] = start + i; + mChooserListAdapter.bindView(holder.itemIndices[i], v); } else { v.setVisibility(View.GONE); } @@ -1197,11 +1207,12 @@ public class ChooserActivity extends ResolverActivity { final View[] cells; final ViewGroup row; int measuredRowHeight; - int itemIndex; + int[] itemIndices; public RowViewHolder(ViewGroup row, int cellCount) { this.row = row; this.cells = new View[cellCount]; + this.itemIndices = new int[cellCount]; } public void measure() { @@ -1389,7 +1400,7 @@ public class ChooserActivity extends ResolverActivity { final View v = mChooserRowAdapter.getView(pos, mCachedView, mListView); int height = ((RowViewHolder) (v.getTag())).measuredRowHeight; - offset += (int) (height * mChooserRowAdapter.getRowScale(pos) * chooserTargetRows); + offset += (int) (height * mChooserRowAdapter.getRowScale(pos)); if (vt >= 0) { mCachedViewType = vt; diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java index 2e0b80a..be618e2 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackViewTouchHandler.java @@ -162,6 +162,14 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { mVelocityTracker.addMovement(createMotionEventForStackScroll(ev)); break; } + case MotionEvent.ACTION_POINTER_DOWN: { + final int index = ev.getActionIndex(); + mActivePointerId = ev.getPointerId(index); + mLastMotionX = (int) ev.getX(index); + mLastMotionY = (int) ev.getY(index); + mLastP = mSv.mLayoutAlgorithm.screenYToCurveProgress(mLastMotionY); + break; + } case MotionEvent.ACTION_MOVE: { if (mActivePointerId == INACTIVE_POINTER_ID) break; @@ -187,6 +195,20 @@ class TaskStackViewTouchHandler implements SwipeHelper.Callback { mLastP = mSv.mLayoutAlgorithm.screenYToCurveProgress(mLastMotionY); break; } + case MotionEvent.ACTION_POINTER_UP: { + int pointerIndex = ev.getActionIndex(); + int pointerId = ev.getPointerId(pointerIndex); + if (pointerId == mActivePointerId) { + // Select a new active pointer id and reset the motion state + final int newPointerIndex = (pointerIndex == 0) ? 1 : 0; + mActivePointerId = ev.getPointerId(newPointerIndex); + mLastMotionX = (int) ev.getX(newPointerIndex); + mLastMotionY = (int) ev.getY(newPointerIndex); + mLastP = mSv.mLayoutAlgorithm.screenYToCurveProgress(mLastMotionY); + mVelocityTracker.clear(); + } + break; + } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: { // Animate the scroll back if we've cancelled diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index aa4da4b..744028a 100644 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -191,7 +191,7 @@ public class CarrierConfigManager { public static final String KEY_DISABLE_CDMA_ACTIVATION_CODE_BOOL = "disable_cdma_activation_code_bool"; - /** + /** * Override the platform's notion of a network operator being considered roaming. * Value is string array of MCCMNCs to be considered roaming for 3GPP RATs. */ @@ -428,6 +428,12 @@ public class CarrierConfigManager { */ public static final String KEY_CSP_ENABLED_BOOL = "csp_enabled_bool"; + /** + * Allow user to add APNs + * @hide + */ + public static final String KEY_ALLOW_ADDING_APNS_BOOL = "allow_adding_apns_bool"; + // These variables are used by the MMS service and exposed through another API, {@link // SmsManager}. The variable names and string values are copied from there. public static final String KEY_MMS_ALIAS_ENABLED_BOOL = "aliasEnabled"; @@ -524,6 +530,7 @@ public class CarrierConfigManager { sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_STRING, ""); sDefaults.putString(KEY_CI_ACTION_ON_SYS_UPDATE_EXTRA_VAL_STRING, ""); sDefaults.putBoolean(KEY_CSP_ENABLED_BOOL, false); + sDefaults.putBoolean(KEY_ALLOW_ADDING_APNS_BOOL, true); sDefaults.putBoolean(KEY_ALWAYS_SHOW_EMERGENCY_ALERT_ONOFF_BOOL, false); sDefaults.putStringArray(KEY_GSM_ROAMING_NETWORKS_STRING_ARRAY, null); diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index f535e5d..fced667 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -911,7 +911,7 @@ public class SignalStrength implements Parcelable { else if (tdScdmaDbm >= -49) level = SIGNAL_STRENGTH_GREAT; else if (tdScdmaDbm >= -73) level = SIGNAL_STRENGTH_GOOD; else if (tdScdmaDbm >= -97) level = SIGNAL_STRENGTH_MODERATE; - else if (tdScdmaDbm >= -120) level = SIGNAL_STRENGTH_POOR; + else if (tdScdmaDbm >= -110) level = SIGNAL_STRENGTH_POOR; else level = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; if (DBG) log("getTdScdmaLevel = " + level); |