diff options
16 files changed, 214 insertions, 41 deletions
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index 2374899..862f4c4 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -577,7 +577,7 @@ public class Build { public static final int KITKAT = 19; /** - * Android 4.4W: KitKat for watches, snacks on the run. + * June 2014: Android 4.4W. KitKat for watches, snacks on the run. * * <p>Applications targeting this or a later release will get these * new changes in behavior:</p> @@ -595,7 +595,7 @@ public class Build { public static final int L = 21; /** - * Lollipop. A flat one with beautiful shadows. But still tasty. + * November 2014: Lollipop. A flat one with beautiful shadows. But still tasty. * * <p>Applications targeting this or a later release will get these * new changes in behavior:</p> @@ -626,12 +626,38 @@ public class Build { public static final int LOLLIPOP = 21; /** - * Lollipop with an extra sugar coating on the outside! + * March 2015: Lollipop with an extra sugar coating on the outside! */ public static final int LOLLIPOP_MR1 = 22; /** - * M comes after L. + * M is for Marshmallow! + * + * <p>Applications targeting this or a later release will get these + * new changes in behavior:</p> + * <ul> + * <li> Runtime permissions. Dangerous permissions are no longer granted at + * install time, but must be requested by the application at runtime through + * {@link android.app.Activity#requestPermissions}.</li> + * <li> Bluetooth and Wi-Fi scanning now requires holding the location permission.</li> + * <li> {@link android.app.AlarmManager#setTimeZone AlarmManager.setTimeZone} will fail if + * the given timezone is non-Olson.</li> + * <li> Activity transitions will only return shared + * elements mapped in the returned view hierarchy back to the calling activity.</li> + * <li> {@link android.view.View} allows a number of behaviors that may break + * existing apps: Canvas throws an exception if restore() is called too many times, + * widgets may return a hint size when returning UNSPECIFIED measure specs, and it + * will respect the attributes {@link android.R.attr#foreground}, + * {@link android.R.attr#foregroundGravity}, {@link android.R.attr#foregroundTint}, and + * {@link android.R.attr#foregroundTintMode}.</li> + * <li> {@link android.view.MotionEvent#getButtonState MotionEvent.getButtonState} + * will no longer report {@link android.view.MotionEvent#BUTTON_PRIMARY} + * and {@link android.view.MotionEvent#BUTTON_SECONDARY} as synonyms for + * {@link android.view.MotionEvent#BUTTON_STYLUS_PRIMARY} and + * {@link android.view.MotionEvent#BUTTON_STYLUS_SECONDARY}.</li> + * <li> {@link android.widget.ScrollView} now respects the layout param margins + * when measuring.</li> + * </ul> */ public static final int M = 23; } diff --git a/core/java/android/text/Hyphenator.java b/core/java/android/text/Hyphenator.java index 10a994a..f2b6041 100644 --- a/core/java/android/text/Hyphenator.java +++ b/core/java/android/text/Hyphenator.java @@ -16,15 +16,17 @@ package android.text; -import com.android.internal.annotations.GuardedBy; - import android.annotation.Nullable; import android.util.Log; -import libcore.io.IoUtils; +import com.android.internal.annotations.GuardedBy; import java.io.File; import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.ByteBuffer; +import java.nio.MappedByteBuffer; +import java.nio.channels.FileChannel; import java.util.HashMap; import java.util.Locale; @@ -45,19 +47,29 @@ public class Hyphenator { @GuardedBy("sLock") final static HashMap<Locale, Hyphenator> sMap = new HashMap<Locale, Hyphenator>(); - final static Hyphenator sEmptyHyphenator = new Hyphenator(StaticLayout.nLoadHyphenator("")); + final static Hyphenator sEmptyHyphenator = + new Hyphenator(StaticLayout.nLoadHyphenator(null, 0), null); final private long mNativePtr; - private Hyphenator(long nativePtr) { + // We retain a reference to the buffer to keep the memory mapping valid + @SuppressWarnings("unused") + final private ByteBuffer mBuffer; + + private Hyphenator(long nativePtr, ByteBuffer b) { mNativePtr = nativePtr; + 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 @@ -67,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 @@ -80,22 +92,28 @@ 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) { - String patternFilename = "hyph-"+languageTag.toLowerCase(Locale.US)+".pat.txt"; + String patternFilename = "hyph-" + languageTag.toLowerCase(Locale.US) + ".hyb"; File patternFile = new File(getSystemHyphenatorLocation(), patternFilename); try { - String patternData = IoUtils.readFileAsString(patternFile.getAbsolutePath()); - long nativePtr = StaticLayout.nLoadHyphenator(patternData); - return new Hyphenator(nativePtr); + RandomAccessFile f = new RandomAccessFile(patternFile, "r"); + try { + FileChannel fc = f.getChannel(); + MappedByteBuffer buf = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); + long nativePtr = StaticLayout.nLoadHyphenator(buf, 0); + return new Hyphenator(nativePtr, buf); + } finally { + f.close(); + } } catch (IOException e) { Log.e(TAG, "error loading hyphenation " + patternFile, e); return null; @@ -148,7 +166,7 @@ public class Hyphenator { sMap.put(null, null); // TODO: replace this with a discovery-based method that looks into /system/usr/hyphen-data - String[] availableLanguages = {"en-US", "eu", "hu", "hy", "nb", "nn", "sa", "und-Ethi"}; + String[] availableLanguages = {"en-US", "eu", "hu", "hy", "nb", "nn", "und-Ethi"}; for (int i = 0; i < availableLanguages.length; i++) { String languageTag = availableLanguages[i]; Hyphenator h = loadHyphenator(languageTag); diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 3b0def2..b0b08db 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -29,6 +29,7 @@ import android.util.Pools.SynchronizedPool; import com.android.internal.util.ArrayUtils; import com.android.internal.util.GrowingArrayUtils; +import java.nio.ByteBuffer; import java.util.Arrays; import java.util.Locale; @@ -341,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; } } @@ -1243,7 +1245,7 @@ public class StaticLayout extends Layout { private static native void nFreeBuilder(long nativePtr); private static native void nFinishBuilder(long nativePtr); - /* package */ static native long nLoadHyphenator(String patternData); + /* package */ static native long nLoadHyphenator(ByteBuffer buf, int offset); private static native void nSetLocale(long nativePtr, String locale, long nativeHyphenator); 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/core/jni/android_text_StaticLayout.cpp b/core/jni/android_text_StaticLayout.cpp index 90e4bb6..a94ea8b 100644 --- a/core/jni/android_text_StaticLayout.cpp +++ b/core/jni/android_text_StaticLayout.cpp @@ -117,9 +117,17 @@ static void nFinishBuilder(JNIEnv*, jclass, jlong nativePtr) { b->finish(); } -static jlong nLoadHyphenator(JNIEnv* env, jclass, jstring patternData) { - ScopedStringChars str(env, patternData); - Hyphenator* hyphenator = Hyphenator::load(str.get(), str.size()); +static jlong nLoadHyphenator(JNIEnv* env, jclass, jobject buffer, jint offset) { + const uint8_t* bytebuf = nullptr; + if (buffer != nullptr) { + void* rawbuf = env->GetDirectBufferAddress(buffer); + if (rawbuf != nullptr) { + bytebuf = reinterpret_cast<const uint8_t*>(rawbuf) + offset; + } else { + ALOGE("failed to get direct buffer address"); + } + } + Hyphenator* hyphenator = Hyphenator::loadBinary(bytebuf); return reinterpret_cast<jlong>(hyphenator); } @@ -177,7 +185,7 @@ static JNINativeMethod gMethods[] = { {"nNewBuilder", "()J", (void*) nNewBuilder}, {"nFreeBuilder", "(J)V", (void*) nFreeBuilder}, {"nFinishBuilder", "(J)V", (void*) nFinishBuilder}, - {"nLoadHyphenator", "(Ljava/lang/String;)J", (void*) nLoadHyphenator}, + {"nLoadHyphenator", "(Ljava/nio/ByteBuffer;I)J", (void*) nLoadHyphenator}, {"nSetLocale", "(JLjava/lang/String;J)V", (void*) nSetLocale}, {"nSetupParagraph", "(J[CIFIF[IIII)V", (void*) nSetupParagraph}, {"nSetIndents", "(J[I)V", (void*) nSetIndents}, diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java index b330582..e4a37fb 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java @@ -16,6 +16,7 @@ package com.android.systemui.qs; +import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.graphics.drawable.Animatable; @@ -320,6 +321,7 @@ public abstract class QSTile<TState extends State> implements Listenable { public interface Host { void startActivityDismissingKeyguard(Intent intent); + void startActivityDismissingKeyguard(PendingIntent intent); void warn(String message, Throwable t); void collapsePanels(); Looper getLooper(); diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java index 3d0dc7b..c7f2284 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java @@ -99,7 +99,7 @@ public class IntentTile extends QSTile<QSTile.State> { try { if (pi != null) { if (pi.isActivity()) { - getHost().startActivityDismissingKeyguard(pi.getIntent()); + getHost().startActivityDismissingKeyguard(pi); } else { pi.send(); } 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/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index eecac63..9ff86eb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1490,6 +1490,59 @@ public abstract class BaseStatusBar extends SystemUI implements return true; } + public void startPendingIntentDismissingKeyguard(final PendingIntent intent) { + if (!isDeviceProvisioned()) return; + + final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing(); + final boolean afterKeyguardGone = intent.isActivity() + && PreviewInflater.wouldLaunchResolverActivity(mContext, intent.getIntent(), + mCurrentUserId); + dismissKeyguardThenExecute(new OnDismissAction() { + public boolean onDismiss() { + new Thread() { + @Override + public void run() { + try { + if (keyguardShowing && !afterKeyguardGone) { + ActivityManagerNative.getDefault() + .keyguardWaitingForActivityDrawn(); + } + + // The intent we are sending is for the application, which + // won't have permission to immediately start an activity after + // the user switches to home. We know it is safe to do at this + // point, so make sure new activity switches are now allowed. + ActivityManagerNative.getDefault().resumeAppSwitches(); + } catch (RemoteException e) { + } + + try { + intent.send(); + } catch (PendingIntent.CanceledException e) { + // the stack trace isn't very helpful here. + // Just log the exception message. + Log.w(TAG, "Sending intent failed: " + e); + + // TODO: Dismiss Keyguard. + } + if (intent.isActivity()) { + mAssistManager.hideAssist(); + overrideActivityPendingAppTransition(keyguardShowing + && !afterKeyguardGone); + } + } + }.start(); + + // close the shade if it was open + animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, + true /* force */, true /* delayed */); + visibilityChanged(false); + + return true; + } + }, afterKeyguardGone); + } + private final class NotificationClicker implements View.OnClickListener { public void onClick(final View v) { if (!(v instanceof ExpandableNotificationRow)) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java index 9ef320b..8f689c6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; +import android.app.PendingIntent; import android.content.Intent; /** @@ -24,6 +25,7 @@ import android.content.Intent; * Keyguard. */ public interface ActivityStarter { + void startPendingIntentDismissingKeyguard(PendingIntent intent); void startActivity(Intent intent, boolean dismissShade); void startActivity(Intent intent, boolean dismissShade, Callback callback); void preventNextAnimation(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 8465101..73361bd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -3210,6 +3210,15 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, return !isDeviceProvisioned() || (mDisabled1 & StatusBarManager.DISABLE_SEARCH) != 0; } + public void postStartActivityDismissingKeyguard(final PendingIntent intent) { + mHandler.post(new Runnable() { + @Override + public void run() { + startPendingIntentDismissingKeyguard(intent); + } + }); + } + public void postStartActivityDismissingKeyguard(final Intent intent, int delay) { mHandler.postDelayed(new Runnable() { @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java index 12434ac..e66c63b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; +import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.res.Resources; @@ -134,6 +135,11 @@ public class QSTileHost implements QSTile.Host, Tunable { } @Override + public void startActivityDismissingKeyguard(PendingIntent intent) { + mStatusBar.postStartActivityDismissingKeyguard(intent); + } + + @Override public void warn(String message, Throwable t) { // already logged } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java index e9c4e49..971978d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java @@ -527,8 +527,8 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL startBatteryActivity(); } else if (v == mAlarmStatus && mNextAlarm != null) { PendingIntent showIntent = mNextAlarm.getShowIntent(); - if (showIntent != null && showIntent.isActivity()) { - mActivityStarter.startActivity(showIntent.getIntent(), true /* dismissShade */); + if (showIntent != null) { + mActivityStarter.startPendingIntentDismissingKeyguard(showIntent); } } } diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java index 3ca0c84..31d859f 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/SoundTriggerHelper.java @@ -87,6 +87,7 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { // This is an indirect indication of the microphone being open in some other application. private boolean mServiceDisabled = false; private boolean mStarted = false; + private boolean mRecognitionAborted = false; private PowerSaveModeListener mPowerSaveModeListener; SoundTriggerHelper(Context context) { @@ -386,8 +387,9 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { private void onRecognitionAbortLocked() { Slog.w(TAG, "Recognition aborted"); - // No-op - // This is handled via service state changes instead. + // If abort has been called, the hardware has already stopped recognition, so we shouldn't + // call it again when we process the state change. + mRecognitionAborted = true; } private void onRecognitionFailureLocked() { @@ -490,8 +492,13 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } return status; } else { - // Stop recognition. - int status = mModule.stopRecognition(mCurrentSoundModelHandle); + // Stop recognition (only if we haven't been aborted). + int status = STATUS_OK; + if (!mRecognitionAborted) { + status = mModule.stopRecognition(mCurrentSoundModelHandle); + } else { + mRecognitionAborted = false; + } if (status != SoundTrigger.STATUS_OK) { Slog.w(TAG, "stopRecognition call failed with " + status); if (notify) { 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); |
