summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/Activity.java10
-rw-r--r--core/java/android/app/ActivityThread.java1
-rw-r--r--core/java/android/app/ContextImpl.java1
-rw-r--r--core/java/android/app/FragmentManager.java11
-rw-r--r--core/java/android/content/Intent.java6
-rw-r--r--core/java/android/content/pm/PackageUserState.java8
-rw-r--r--core/java/android/hardware/usb/IUsbManager.aidl8
-rw-r--r--core/java/android/inputmethodservice/InputMethodService.java4
-rw-r--r--core/java/android/net/CaptivePortalTracker.java33
-rw-r--r--core/java/android/os/BatteryManager.java4
-rw-r--r--core/java/android/provider/Settings.java299
-rw-r--r--core/java/android/service/dreams/DreamService.java26
-rw-r--r--core/java/android/view/Display.java43
-rw-r--r--core/java/android/view/DisplayInfo.java7
-rw-r--r--core/java/android/view/ScaleGestureDetector.java157
-rw-r--r--core/java/android/view/View.java9
-rw-r--r--core/java/android/widget/AbsListView.java16
-rw-r--r--core/java/android/widget/Editor.java11
-rw-r--r--core/java/android/widget/Spinner.java27
-rw-r--r--core/java/com/android/internal/widget/LockPatternUtils.java10
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp27
-rw-r--r--core/jni/android/graphics/TextLayoutCache.h17
-rw-r--r--core/res/res/drawable-hdpi/stat_notify_rssi_in_range.pngbin0 -> 1160 bytes
-rw-r--r--core/res/res/drawable-mdpi/stat_notify_rssi_in_range.pngbin0 -> 855 bytes
-rw-r--r--core/res/res/drawable-nodpi/kg_widget_overscroll_layer_left.9.pngbin2212 -> 0 bytes
-rw-r--r--core/res/res/drawable-nodpi/kg_widget_overscroll_layer_right.9.pngbin1451 -> 0 bytes
-rw-r--r--core/res/res/drawable-xhdpi/stat_notify_rssi_in_range.pngbin0 -> 1500 bytes
-rw-r--r--core/res/res/layout-land/keyguard_host_view.xml11
-rw-r--r--core/res/res/layout/keyguard_multi_user_avatar.xml28
-rw-r--r--core/res/res/layout/keyguard_multi_user_selector.xml3
-rw-r--r--core/res/res/layout/keyguard_multi_user_selector_widget.xml1
-rw-r--r--core/res/res/layout/keyguard_selector_view.xml5
-rw-r--r--core/res/res/layout/keyguard_status_view.xml5
-rw-r--r--core/res/res/layout/keyguard_transport_control_view.xml3
-rw-r--r--core/res/res/layout/keyguard_widget_region.xml36
-rw-r--r--core/res/res/values-mcc310/config.xml25
-rw-r--r--core/res/res/values-mcc311/config.xml25
-rw-r--r--core/res/res/values-mcc312/config.xml25
-rw-r--r--core/res/res/values-mcc313/config.xml25
-rw-r--r--core/res/res/values-mcc314/config.xml25
-rw-r--r--core/res/res/values-mcc315/config.xml25
-rw-r--r--core/res/res/values-mcc316/config.xml25
-rw-r--r--core/res/res/values-sw600dp/dimens.xml8
-rw-r--r--core/res/res/values/colors.xml5
-rwxr-xr-xcore/res/res/values/config.xml17
-rw-r--r--core/res/res/values/dimens.xml23
-rwxr-xr-xcore/res/res/values/strings.xml9
-rw-r--r--core/res/res/values/symbols.xml23
-rw-r--r--core/res/res/xml/sms_short_codes.xml189
49 files changed, 922 insertions, 354 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 7606d5e..5dc9da2 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -685,6 +685,7 @@ public class Activity extends ContextThemeWrapper
private boolean mStopped;
boolean mFinished;
boolean mStartedActivity;
+ private boolean mDestroyed;
/** true if the activity is going through a transient pause */
/*package*/ boolean mTemporaryPause = false;
/** true if the activity is being destroyed in order to recreate it with a new configuration */
@@ -4089,6 +4090,14 @@ public class Activity extends ContextThemeWrapper
}
/**
+ * Returns true if the final {@link #onDestroy()} call has been made
+ * on the Activity, so this instance is now dead.
+ */
+ public boolean isDestroyed() {
+ return mDestroyed;
+ }
+
+ /**
* Check to see whether this activity is in the process of being destroyed in order to be
* recreated with a new configuration. This is often used in
* {@link #onStop} to determine whether the state needs to be cleaned up or will be passed
@@ -5258,6 +5267,7 @@ public class Activity extends ContextThemeWrapper
}
final void performDestroy() {
+ mDestroyed = true;
mWindow.destroy();
mFragments.dispatchDestroy();
onDestroy();
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 6ef3651..ef9f6d4 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -2700,6 +2700,7 @@ public final class ActivityThread {
r.activity.mStartedActivity = false;
}
try {
+ r.activity.mFragments.noteStateNotSaved();
if (r.pendingIntents != null) {
deliverNewIntents(r, r.pendingIntents);
r.pendingIntents = null;
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index c41405b..59fa1e0 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -1703,6 +1703,7 @@ class ContextImpl extends Context {
if (packageName.equals("system") || packageName.equals("android")) {
final ContextImpl context = new ContextImpl(mMainThread.getSystemContext());
context.mBasePackageName = mBasePackageName;
+ context.mUser = user;
return context;
}
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index e983299..10ea109 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -318,6 +318,12 @@ public abstract class FragmentManager {
public abstract Fragment.SavedState saveFragmentInstanceState(Fragment f);
/**
+ * Returns true if the final {@link Activity#onDestroy() Activity.onDestroy()}
+ * call has been made on the FragmentManager's Activity, so this instance is now dead.
+ */
+ public abstract boolean isDestroyed();
+
+ /**
* Print the FragmentManager's state into the given stream.
*
* @param prefix Text to print at the front of each line.
@@ -588,6 +594,11 @@ final class FragmentManagerImpl extends FragmentManager {
}
@Override
+ public boolean isDestroyed() {
+ return mDestroyed;
+ }
+
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder(128);
sb.append("FragmentManager{");
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index d4f6c06..c14a703 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2414,6 +2414,12 @@ public class Intent implements Parcelable, Cloneable {
public static final String ACTION_USER_INFO_CHANGED =
"android.intent.action.USER_INFO_CHANGED";
+ /**
+ * Sent when the user taps on the clock widget in the system's "quick settings" area.
+ */
+ public static final String ACTION_QUICK_CLOCK =
+ "android.intent.action.QUICK_CLOCK";
+
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Standard intent categories (see addCategory()).
diff --git a/core/java/android/content/pm/PackageUserState.java b/core/java/android/content/pm/PackageUserState.java
index 7b3d8cd..3579977 100644
--- a/core/java/android/content/pm/PackageUserState.java
+++ b/core/java/android/content/pm/PackageUserState.java
@@ -34,14 +34,6 @@ public class PackageUserState {
public HashSet<String> enabledComponents;
public PackageUserState() {
- this(true);
- }
-
- /** @hide */
- public PackageUserState(boolean isSystem) {
- if (!isSystem) {
- stopped = notLaunched = true;
- }
installed = true;
enabled = COMPONENT_ENABLED_STATE_DEFAULT;
}
diff --git a/core/java/android/hardware/usb/IUsbManager.aidl b/core/java/android/hardware/usb/IUsbManager.aidl
index 98bd4f5..8286686 100644
--- a/core/java/android/hardware/usb/IUsbManager.aidl
+++ b/core/java/android/hardware/usb/IUsbManager.aidl
@@ -44,12 +44,12 @@ interface IUsbManager
/* Sets the default package for a USB device
* (or clears it if the package name is null)
*/
- void setDevicePackage(in UsbDevice device, String packageName);
+ void setDevicePackage(in UsbDevice device, String packageName, int userId);
/* Sets the default package for a USB accessory
* (or clears it if the package name is null)
*/
- void setAccessoryPackage(in UsbAccessory accessory, String packageName);
+ void setAccessoryPackage(in UsbAccessory accessory, String packageName, int userId);
/* Returns true if the caller has permission to access the device. */
boolean hasDevicePermission(in UsbDevice device);
@@ -77,10 +77,10 @@ interface IUsbManager
void grantAccessoryPermission(in UsbAccessory accessory, int uid);
/* Returns true if the USB manager has default preferences or permissions for the package */
- boolean hasDefaults(String packageName);
+ boolean hasDefaults(String packageName, int userId);
/* Clears default preferences and permissions for the package */
- void clearDefaults(String packageName);
+ void clearDefaults(String packageName, int userId);
/* Sets the current USB function. */
void setCurrentFunction(String function, boolean makeDefault);
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index cf3b802..f07002e 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -683,8 +683,8 @@ public class InputMethodService extends AbstractInputMethodService {
com.android.internal.R.layout.input_method, null);
mWindow.setContentView(mRootView);
mRootView.getViewTreeObserver().addOnComputeInternalInsetsListener(mInsetsComputer);
- if (Settings.System.getInt(getContentResolver(),
- Settings.System.FANCY_IME_ANIMATIONS, 0) != 0) {
+ if (Settings.Global.getInt(getContentResolver(),
+ Settings.Global.FANCY_IME_ANIMATIONS, 0) != 0) {
mWindow.getWindow().setWindowAnimations(
com.android.internal.R.style.Animation_InputMethodFancy);
}
diff --git a/core/java/android/net/CaptivePortalTracker.java b/core/java/android/net/CaptivePortalTracker.java
index 9b11094..ce71e6b 100644
--- a/core/java/android/net/CaptivePortalTracker.java
+++ b/core/java/android/net/CaptivePortalTracker.java
@@ -31,6 +31,7 @@ import android.os.UserHandle;
import android.os.Message;
import android.os.RemoteException;
import android.provider.Settings;
+import android.telephony.TelephonyManager;
import android.util.Log;
import com.android.internal.util.State;
@@ -63,6 +64,7 @@ public class CaptivePortalTracker extends StateMachine {
private boolean mNotificationShown = false;
private boolean mIsCaptivePortalCheckEnabled = false;
private IConnectivityManager mConnService;
+ private TelephonyManager mTelephonyManager;
private Context mContext;
private NetworkInfo mNetworkInfo;
@@ -84,6 +86,7 @@ public class CaptivePortalTracker extends StateMachine {
mContext = context;
mConnService = cs;
+ mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
IntentFilter filter = new IntentFilter();
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
@@ -326,17 +329,33 @@ public class CaptivePortalTracker extends StateMachine {
if (visible) {
CharSequence title;
- if (mNetworkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
- title = r.getString(R.string.wifi_available_sign_in, 0);
- } else {
- title = r.getString(R.string.network_available_sign_in, 0);
+ CharSequence details;
+ int icon;
+ switch (mNetworkInfo.getType()) {
+ case ConnectivityManager.TYPE_WIFI:
+ title = r.getString(R.string.wifi_available_sign_in, 0);
+ details = r.getString(R.string.network_available_sign_in_detailed,
+ mNetworkInfo.getExtraInfo());
+ icon = R.drawable.stat_notify_wifi_in_range;
+ break;
+ case ConnectivityManager.TYPE_MOBILE:
+ title = r.getString(R.string.network_available_sign_in, 0);
+ // TODO: Change this to pull from NetworkInfo once a printable
+ // name has been added to it
+ details = mTelephonyManager.getNetworkOperatorName();
+ icon = R.drawable.stat_notify_rssi_in_range;
+ break;
+ default:
+ title = r.getString(R.string.network_available_sign_in, 0);
+ details = r.getString(R.string.network_available_sign_in_detailed,
+ mNetworkInfo.getExtraInfo());
+ icon = R.drawable.stat_notify_rssi_in_range;
+ break;
}
- CharSequence details = r.getString(R.string.network_available_sign_in_detailed,
- mNetworkInfo.getExtraInfo());
Notification notification = new Notification();
notification.when = 0;
- notification.icon = com.android.internal.R.drawable.stat_notify_wifi_in_range;
+ notification.icon = icon;
notification.flags = Notification.FLAG_AUTO_CANCEL;
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mUrl));
intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT |
diff --git a/core/java/android/os/BatteryManager.java b/core/java/android/os/BatteryManager.java
index 7b16f4d..2e38960 100644
--- a/core/java/android/os/BatteryManager.java
+++ b/core/java/android/os/BatteryManager.java
@@ -117,4 +117,8 @@ public class BatteryManager {
public static final int BATTERY_PLUGGED_USB = 2;
/** Power source is wireless. */
public static final int BATTERY_PLUGGED_WIRELESS = 4;
+
+ /** @hide */
+ public static final int BATTERY_PLUGGED_ANY =
+ BATTERY_PLUGGED_AC | BATTERY_PLUGGED_USB | BATTERY_PLUGGED_WIRELESS;
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 8f1210b..3bbdf36 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -19,6 +19,7 @@ package android.provider;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.app.SearchManager;
+import android.app.WallpaperManager;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.ContentValues;
@@ -910,17 +911,20 @@ public final class Settings {
}
private static final HashSet<String> MOVED_TO_GLOBAL;
+ private static final HashSet<String> MOVED_TO_SECURE_THEN_GLOBAL;
static {
MOVED_TO_GLOBAL = new HashSet<String>();
+ MOVED_TO_SECURE_THEN_GLOBAL = new HashSet<String>();
+
// these were originally in system but migrated to secure in the past,
// so are duplicated in the Secure.* namespace
- MOVED_TO_GLOBAL.add(Global.ADB_ENABLED);
- MOVED_TO_GLOBAL.add(Global.BLUETOOTH_ON);
- MOVED_TO_GLOBAL.add(Global.DATA_ROAMING);
- MOVED_TO_GLOBAL.add(Global.DEVICE_PROVISIONED);
- MOVED_TO_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS);
- MOVED_TO_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
- MOVED_TO_GLOBAL.add(Global.HTTP_PROXY);
+ MOVED_TO_SECURE_THEN_GLOBAL.add(Global.ADB_ENABLED);
+ MOVED_TO_SECURE_THEN_GLOBAL.add(Global.BLUETOOTH_ON);
+ MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DATA_ROAMING);
+ MOVED_TO_SECURE_THEN_GLOBAL.add(Global.DEVICE_PROVISIONED);
+ MOVED_TO_SECURE_THEN_GLOBAL.add(Global.INSTALL_NON_MARKET_APPS);
+ MOVED_TO_SECURE_THEN_GLOBAL.add(Global.USB_MASS_STORAGE_ENABLED);
+ MOVED_TO_SECURE_THEN_GLOBAL.add(Global.HTTP_PROXY);
// these are moving directly from system to global
MOVED_TO_GLOBAL.add(Settings.Global.AIRPLANE_MODE_ON);
@@ -940,6 +944,28 @@ public final class Settings {
MOVED_TO_GLOBAL.add(Settings.Global.STAY_ON_WHILE_PLUGGED_IN);
MOVED_TO_GLOBAL.add(Settings.Global.WIFI_SLEEP_POLICY);
MOVED_TO_GLOBAL.add(Settings.Global.MODE_RINGER);
+ MOVED_TO_GLOBAL.add(Settings.Global.WINDOW_ANIMATION_SCALE);
+ MOVED_TO_GLOBAL.add(Settings.Global.TRANSITION_ANIMATION_SCALE);
+ MOVED_TO_GLOBAL.add(Settings.Global.ANIMATOR_DURATION_SCALE);
+ MOVED_TO_GLOBAL.add(Settings.Global.FANCY_IME_ANIMATIONS);
+ MOVED_TO_GLOBAL.add(Settings.Global.COMPATIBILITY_MODE);
+ MOVED_TO_GLOBAL.add(Settings.Global.EMERGENCY_TONE);
+ MOVED_TO_GLOBAL.add(Settings.Global.CALL_AUTO_RETRY);
+ MOVED_TO_GLOBAL.add(Settings.Global.DEBUG_APP);
+ MOVED_TO_GLOBAL.add(Settings.Global.WAIT_FOR_DEBUGGER);
+ MOVED_TO_GLOBAL.add(Settings.Global.SHOW_PROCESSES);
+ MOVED_TO_GLOBAL.add(Settings.Global.ALWAYS_FINISH_ACTIVITIES);
+ }
+
+ /** @hide */
+ public static void getMovedKeys(HashSet<String> outKeySet) {
+ outKeySet.addAll(MOVED_TO_GLOBAL);
+ outKeySet.addAll(MOVED_TO_SECURE_THEN_GLOBAL);
+ }
+
+ /** @hide */
+ public static void getNonLegacyMovedKeys(HashSet<String> outKeySet) {
+ outKeySet.addAll(MOVED_TO_GLOBAL);
}
/**
@@ -960,7 +986,7 @@ public final class Settings {
+ " to android.provider.Settings.Secure, returning read-only value.");
return Secure.getStringForUser(resolver, name, userHandle);
}
- if (MOVED_TO_GLOBAL.contains(name)) {
+ if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
+ " to android.provider.Settings.Global, returning read-only value.");
return Global.getStringForUser(resolver, name, userHandle);
@@ -987,7 +1013,7 @@ public final class Settings {
+ " to android.provider.Settings.Secure, value is unchanged.");
return false;
}
- if (MOVED_TO_GLOBAL.contains(name)) {
+ if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
+ " to android.provider.Settings.Global, value is unchanged.");
return false;
@@ -1007,7 +1033,7 @@ public final class Settings {
+ " to android.provider.Settings.Secure, returning Secure URI.");
return Secure.getUriFor(Secure.CONTENT_URI, name);
}
- if (MOVED_TO_GLOBAL.contains(name)) {
+ if (MOVED_TO_GLOBAL.contains(name) || MOVED_TO_SECURE_THEN_GLOBAL.contains(name)) {
Log.w(TAG, "Setting " + name + " has moved from android.provider.Settings.System"
+ " to android.provider.Settings.Global, returning read-only global URI.");
return Global.getUriFor(Global.CONTENT_URI, name);
@@ -1608,14 +1634,20 @@ public final class Settings {
/**
* Name of an application package to be debugged.
+ *
+ * @deprecated Use {@link Global#DEBUG_APP} instead
*/
- public static final String DEBUG_APP = "debug_app";
+ @Deprecated
+ public static final String DEBUG_APP = Global.DEBUG_APP;
/**
* If 1, when launching DEBUG_APP it will wait for the debugger before
* starting user code. If 0, it will run normally.
+ *
+ * @deprecated Use {@link Global#WAIT_FOR_DEBUGGER} instead
*/
- public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
+ @Deprecated
+ public static final String WAIT_FOR_DEBUGGER = Global.WAIT_FOR_DEBUGGER;
/**
* Whether or not to dim the screen. 0=no 1=yes
@@ -1630,14 +1662,6 @@ public final class Settings {
public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout";
/**
- * If 0, the compatibility mode is off for all applications.
- * If 1, older applications run under compatibility mode.
- * TODO: remove this settings before code freeze (bug/1907571)
- * @hide
- */
- public static final String COMPATIBILITY_MODE = "compatibility_mode";
-
- /**
* The screen backlight brightness between 0 and 255.
*/
public static final String SCREEN_BRIGHTNESS = "screen_brightness";
@@ -1666,16 +1690,21 @@ public final class Settings {
/**
* Control whether the process CPU usage meter should be shown.
+ *
+ * @deprecated Use {@link Global#SHOW_PROCESSES} instead
*/
- public static final String SHOW_PROCESSES = "show_processes";
+ @Deprecated
+ public static final String SHOW_PROCESSES = Global.SHOW_PROCESSES;
/**
* If 1, the activity manager will aggressively finish activities and
* processes as soon as they are no longer needed. If 0, the normal
* extended lifetime is used.
+ *
+ * @deprecated Use {@link Global#ALWAYS_FINISH_ACTIVITIES} instead
*/
- public static final String ALWAYS_FINISH_ACTIVITIES =
- "always_finish_activities";
+ @Deprecated
+ public static final String ALWAYS_FINISH_ACTIVITIES = Global.ALWAYS_FINISH_ACTIVITIES;
/**
* Determines which streams are affected by ringer mode changes. The
@@ -1899,7 +1928,10 @@ public final class Settings {
/**
* Name of activity to use for wallpaper on the home screen.
+ *
+ * @deprecated Use {@link WallpaperManager} instead.
*/
+ @Deprecated
public static final String WALLPAPER_ACTIVITY = "wallpaper_activity";
/**
@@ -1943,28 +1975,30 @@ public final class Settings {
/**
* Scaling factor for normal window animations. Setting to 0 will disable window
* animations.
+ *
+ * @deprecated Use {@link Global#WINDOW_ANIMATION_SCALE} instead
*/
- public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
+ @Deprecated
+ public static final String WINDOW_ANIMATION_SCALE = Global.WINDOW_ANIMATION_SCALE;
/**
* Scaling factor for activity transition animations. Setting to 0 will disable window
* animations.
+ *
+ * @deprecated Use {@link Global#TRANSITION_ANIMATION_SCALE} instead
*/
- public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
+ @Deprecated
+ public static final String TRANSITION_ANIMATION_SCALE = Global.TRANSITION_ANIMATION_SCALE;
/**
* Scaling factor for Animator-based animations. This affects both the start delay and
* duration of all such animations. Setting to 0 will cause animations to end immediately.
* The default value is 1.
+ *
+ * @deprecated Use {@link Global#ANIMATOR_DURATION_SCALE} instead
*/
- public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
-
- /**
- * Scaling factor for normal window animations. Setting to 0 will disable window
- * animations.
- * @hide
- */
- public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
+ @Deprecated
+ public static final String ANIMATOR_DURATION_SCALE = Global.ANIMATOR_DURATION_SCALE;
/**
* Control whether the accelerometer will be used to change screen
@@ -2028,23 +2062,6 @@ public final class Settings {
public static final String DTMF_TONE_TYPE_WHEN_DIALING = "dtmf_tone_type";
/**
- * CDMA only settings
- * Emergency Tone 0 = Off
- * 1 = Alert
- * 2 = Vibrate
- * @hide
- */
- public static final String EMERGENCY_TONE = "emergency_tone";
-
- /**
- * CDMA only settings
- * Whether the auto retry is enabled. The value is
- * boolean (1 or 0).
- * @hide
- */
- public static final String CALL_AUTO_RETRY = "call_auto_retry";
-
- /**
* Whether the hearing aid is enabled. The value is
* boolean (1 or 0).
* @hide
@@ -2254,7 +2271,7 @@ public final class Settings {
* @hide
*/
public static final String[] SETTINGS_TO_BACKUP = {
- STAY_ON_WHILE_PLUGGED_IN,
+ STAY_ON_WHILE_PLUGGED_IN, // moved to global
WIFI_USE_STATIC_IP,
WIFI_STATIC_IP,
WIFI_STATIC_GATEWAY,
@@ -2269,7 +2286,7 @@ public final class Settings {
SCREEN_BRIGHTNESS_MODE,
SCREEN_AUTO_BRIGHTNESS_ADJ,
VIBRATE_INPUT_DEVICES,
- MODE_RINGER,
+ MODE_RINGER, // moved to global
MODE_RINGER_STREAMS_AFFECTED,
MUTE_STREAMS_AFFECTED,
VOLUME_VOICE,
@@ -2290,20 +2307,18 @@ public final class Settings {
TEXT_AUTO_CAPS,
TEXT_AUTO_PUNCTUATE,
TEXT_SHOW_PASSWORD,
- AUTO_TIME,
- AUTO_TIME_ZONE,
+ AUTO_TIME, // moved to global
+ AUTO_TIME_ZONE, // moved to global
TIME_12_24,
DATE_FORMAT,
DTMF_TONE_WHEN_DIALING,
DTMF_TONE_TYPE_WHEN_DIALING,
- EMERGENCY_TONE,
- CALL_AUTO_RETRY,
HEARING_AID,
TTY_MODE,
SOUND_EFFECTS_ENABLED,
HAPTIC_FEEDBACK_ENABLED,
- POWER_SOUNDS_ENABLED,
- DOCK_SOUNDS_ENABLED,
+ POWER_SOUNDS_ENABLED, // moved to global
+ DOCK_SOUNDS_ENABLED, // moved to global
LOCKSCREEN_SOUNDS_ENABLED,
SHOW_WEB_SUGGESTIONS,
NOTIFICATION_LIGHT_PULSE,
@@ -2695,6 +2710,13 @@ public final class Settings {
MOVED_TO_GLOBAL.add(Settings.Global.GLOBAL_HTTP_PROXY_EXCLUSION_LIST);
MOVED_TO_GLOBAL.add(Settings.Global.SET_GLOBAL_HTTP_PROXY);
MOVED_TO_GLOBAL.add(Settings.Global.DEFAULT_DNS_SERVER);
+ MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_NETWORK_MODE);
+ MOVED_TO_GLOBAL.add(Settings.Global.PREFERRED_CDMA_SUBSCRIPTION);
+ }
+
+ /** @hide */
+ public static void getMovedKeys(HashSet<String> outKeySet) {
+ outKeySet.addAll(MOVED_TO_GLOBAL);
}
/**
@@ -3653,20 +3675,6 @@ public final class Settings {
= "allowed_geolocation_origins";
/**
- * The preferred network mode 7 = Global
- * 6 = EvDo only
- * 5 = CDMA w/o EvDo
- * 4 = CDMA / EvDo auto
- * 3 = GSM / WCDMA auto
- * 2 = WCDMA only
- * 1 = GSM only
- * 0 = GSM / WCDMA preferred
- * @hide
- */
- public static final String PREFERRED_NETWORK_MODE =
- "preferred_network_mode";
-
- /**
* The preferred TTY mode 0 = TTy Off, CDMA default
* 1 = TTY Full
* 2 = TTY HCO
@@ -3677,14 +3685,6 @@ public final class Settings {
"preferred_tty_mode";
/**
- * The cdma subscription 0 = Subscription from RUIM, when available
- * 1 = Subscription from NV
- * @hide
- */
- public static final String PREFERRED_CDMA_SUBSCRIPTION =
- "preferred_cdma_subscription";
-
- /**
* Whether the enhanced voice privacy mode is enabled.
* 0 = normal voice privacy
* 1 = enhanced voice privacy
@@ -4010,12 +4010,11 @@ public final class Settings {
* @hide
*/
public static final String[] SETTINGS_TO_BACKUP = {
- ADB_ENABLED,
BUGREPORT_IN_POWER_MENU,
ALLOW_MOCK_LOCATION,
PARENTAL_CONTROL_ENABLED,
PARENTAL_CONTROL_REDIRECT_URL,
- USB_MASS_STORAGE_ENABLED,
+ USB_MASS_STORAGE_ENABLED, // moved to global
ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED,
ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE,
ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
@@ -4034,9 +4033,9 @@ public final class Settings {
TTS_DEFAULT_COUNTRY,
TTS_ENABLED_PLUGINS,
TTS_DEFAULT_LOCALE,
- WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
- WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
- WIFI_NUM_OPEN_NETWORKS_KEPT,
+ WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global
+ WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global
+ WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global
MOUNT_PLAY_NOTIFICATION_SND,
MOUNT_UMS_AUTOSTART,
MOUNT_UMS_PROMPT,
@@ -5170,6 +5169,136 @@ public final class Settings {
return BLUETOOTH_INPUT_DEVICE_PRIORITY_PREFIX + address.toUpperCase();
}
+ /**
+ * Scaling factor for normal window animations. Setting to 0 will
+ * disable window animations.
+ */
+ public static final String WINDOW_ANIMATION_SCALE = "window_animation_scale";
+
+ /**
+ * Scaling factor for activity transition animations. Setting to 0 will
+ * disable window animations.
+ */
+ public static final String TRANSITION_ANIMATION_SCALE = "transition_animation_scale";
+
+ /**
+ * Scaling factor for Animator-based animations. This affects both the
+ * start delay and duration of all such animations. Setting to 0 will
+ * cause animations to end immediately. The default value is 1.
+ */
+ public static final String ANIMATOR_DURATION_SCALE = "animator_duration_scale";
+
+ /**
+ * Scaling factor for normal window animations. Setting to 0 will
+ * disable window animations.
+ *
+ * @hide
+ */
+ public static final String FANCY_IME_ANIMATIONS = "fancy_ime_animations";
+
+ /**
+ * If 0, the compatibility mode is off for all applications.
+ * If 1, older applications run under compatibility mode.
+ * TODO: remove this settings before code freeze (bug/1907571)
+ * @hide
+ */
+ public static final String COMPATIBILITY_MODE = "compatibility_mode";
+
+ /**
+ * CDMA only settings
+ * Emergency Tone 0 = Off
+ * 1 = Alert
+ * 2 = Vibrate
+ * @hide
+ */
+ public static final String EMERGENCY_TONE = "emergency_tone";
+
+ /**
+ * CDMA only settings
+ * Whether the auto retry is enabled. The value is
+ * boolean (1 or 0).
+ * @hide
+ */
+ public static final String CALL_AUTO_RETRY = "call_auto_retry";
+
+ /**
+ * The preferred network mode 7 = Global
+ * 6 = EvDo only
+ * 5 = CDMA w/o EvDo
+ * 4 = CDMA / EvDo auto
+ * 3 = GSM / WCDMA auto
+ * 2 = WCDMA only
+ * 1 = GSM only
+ * 0 = GSM / WCDMA preferred
+ * @hide
+ */
+ public static final String PREFERRED_NETWORK_MODE =
+ "preferred_network_mode";
+
+ /**
+ * The cdma subscription 0 = Subscription from RUIM, when available
+ * 1 = Subscription from NV
+ * @hide
+ */
+ public static final String PREFERRED_CDMA_SUBSCRIPTION =
+ "preferred_cdma_subscription";
+
+ /**
+ * Name of an application package to be debugged.
+ */
+ public static final String DEBUG_APP = "debug_app";
+
+ /**
+ * If 1, when launching DEBUG_APP it will wait for the debugger before
+ * starting user code. If 0, it will run normally.
+ */
+ public static final String WAIT_FOR_DEBUGGER = "wait_for_debugger";
+
+ /**
+ * Control whether the process CPU usage meter should be shown.
+ */
+ public static final String SHOW_PROCESSES = "show_processes";
+
+ /**
+ * If 1, the activity manager will aggressively finish activities and
+ * processes as soon as they are no longer needed. If 0, the normal
+ * extended lifetime is used.
+ */
+ public static final String ALWAYS_FINISH_ACTIVITIES =
+ "always_finish_activities";
+
+ /**
+ * Settings to backup. This is here so that it's in the same place as the settings
+ * keys and easy to update.
+ *
+ * These keys may be mentioned in the SETTINGS_TO_BACKUP arrays in System
+ * and Secure as well. This is because those tables drive both backup and
+ * restore, and restore needs to properly whitelist keys that used to live
+ * in those namespaces. The keys will only actually be backed up / restored
+ * if they are also mentioned in this table (Global.SETTINGS_TO_BACKUP).
+ *
+ * NOTE: Settings are backed up and restored in the order they appear
+ * in this array. If you have one setting depending on another,
+ * make sure that they are ordered appropriately.
+ *
+ * @hide
+ */
+ public static final String[] SETTINGS_TO_BACKUP = {
+ STAY_ON_WHILE_PLUGGED_IN,
+ MODE_RINGER,
+ AUTO_TIME,
+ AUTO_TIME_ZONE,
+ POWER_SOUNDS_ENABLED,
+ DOCK_SOUNDS_ENABLED,
+ USB_MASS_STORAGE_ENABLED,
+ ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED,
+ WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
+ WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
+ WIFI_NUM_OPEN_NETWORKS_KEPT,
+ EMERGENCY_TONE,
+ CALL_AUTO_RETRY,
+ };
+
// Populated lazily, guarded by class object:
private static NameValueCache sNameValueCache = new NameValueCache(
SYS_PROP_SETTING_VERSION,
diff --git a/core/java/android/service/dreams/DreamService.java b/core/java/android/service/dreams/DreamService.java
index f97354f..03b685b 100644
--- a/core/java/android/service/dreams/DreamService.java
+++ b/core/java/android/service/dreams/DreamService.java
@@ -47,24 +47,30 @@ import com.android.internal.policy.PolicyManager;
*
* <p>Dreams should be declared in the manifest as follows:</p>
* <pre>
- * {@code
- * <service
+ * &lt;service
* android:name=".MyDream"
* android:exported="true"
* android:icon="@drawable/my_icon"
* android:label="@string/my_dream_label" >
*
- * <intent-filter>
- * <action android:name="android.intent.action.MAIN" />
- * <category android:name="android.intent.category.DREAM" />
- * </intent-filter>
+ * &lt;intent-filter>
+ * &lt;action android:name="android.service.dreams.DreamService" />
+ * &lt;category android:name="android.intent.category.DEFAULT" />
+ * &lt;/intent-filter>
*
- * <!-- Point to additional information for this dream (optional) -->
- * <meta-data
+ * &lt;!-- Point to additional information for this dream (optional) -->
+ * &lt;meta-data
* android:name="android.service.dream"
* android:resource="@xml/my_dream" />
- * </service>
- * }
+ * &lt;/service>
+ * </pre>
+ * <p>If specified, additional information for the dream is defined using the
+ * <code>&lt;{@link android.R.styleable#Dream dream}&gt;</code> element. For example:</p>
+ * <pre>
+ * (in res/xml/my_dream.xml)
+ *
+ * &lt;dream xmlns:android="http://schemas.android.com/apk/res/android"
+ * android:settingsActivity="com.example.app/.MyDreamSettingsActivity" />
* </pre>
*/
public class DreamService extends Service implements Window.Callback {
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index cf58458..662dc45 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -79,38 +79,23 @@ public final class Display {
public static final int DEFAULT_DISPLAY = 0;
/**
- * Display flag: Indicates that the display supports secure video output.
+ * Display flag: Indicates that the display supports compositing content
+ * that is stored in protected graphics buffers.
* <p>
- * This flag is used to indicate that the display supports content protection
- * mechanisms for secure video output at the display interface, such as HDCP.
- * These mechanisms may be used to protect secure content as it leaves the device.
+ * Secure (DRM) video decoders may allocate protected graphics buffers to request that
+ * a hardware-protected path be provided between the video decoder and the external
+ * display sink. If a hardware-protected path is not available, then content stored
+ * in protected graphics buffers may not be composited.
* </p><p>
- * While mirroring content to multiple displays, it can happen that certain
- * display devices support secure video output while other display devices do not.
- * The secure content will be shown only on the display devices that support
- * secure video output and will be blanked on other display devices that do
- * not support secure video output.
- * </p><p>
- * This flag mainly applies to external display devices such as HDMI or
- * Wifi display. Built-in display devices are usually considered secure.
- * </p>
- *
- * @hide pending review
- */
- public static final int FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT = 1 << 0;
-
- /**
- * Display flag: Indicates that the display supports secure in-memory video buffers.
- * <p>
- * This flag is used to indicate that the display supports content protection
- * mechanisms for in-memory video buffers, such as secure memory areas.
- * These mechanisms may be used to protect secure video buffers in memory from
- * the video decoder to the display compositor and the video interface.
+ * If this flag is not set, then the display device does not support compositing
+ * protected buffers; the user may see a blank region on the screen instead of
+ * the protected content. An application can use this flag as a hint that it should
+ * select an alternate content stream or adopt a different strategy for decoding
+ * content that does not rely on protected buffers so as to ensure that the user
+ * can view the content on the display as expected.
* </p>
- *
- * @hide pending review
*/
- public static final int FLAG_SUPPORTS_SECURE_VIDEO_BUFFERS = 1 << 1;
+ public static final int FLAG_SUPPORTS_PROTECTED_BUFFERS = 1 << 0;
/**
* Internal method to create a display.
@@ -196,7 +181,7 @@ public final class Display {
*
* @return The display flags.
*
- * @hide pending review
+ * @see #FLAG_SUPPORTS_PROTECTED_BUFFERS
*/
public int getFlags() {
synchronized (this) {
diff --git a/core/java/android/view/DisplayInfo.java b/core/java/android/view/DisplayInfo.java
index c968ec5..fe05634 100644
--- a/core/java/android/view/DisplayInfo.java
+++ b/core/java/android/view/DisplayInfo.java
@@ -299,11 +299,8 @@ public final class DisplayInfo implements Parcelable {
private static String flagsToString(int flags) {
StringBuilder result = new StringBuilder();
- if ((flags & Display.FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT) != 0) {
- result.append(", FLAG_SUPPORTS_SECURE_VIDEO_OUTPUT");
- }
- if ((flags & Display.FLAG_SUPPORTS_SECURE_VIDEO_BUFFERS) != 0) {
- result.append(", FLAG_SUPPORTS_SECURE_VIDEO_BUFFERS");
+ if ((flags & Display.FLAG_SUPPORTS_PROTECTED_BUFFERS) != 0) {
+ result.append(", FLAG_SUPPORTS_PROTECTED_BUFFERS");
}
return result.toString();
}
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java
index 4873860..a74e438 100644
--- a/core/java/android/view/ScaleGestureDetector.java
+++ b/core/java/android/view/ScaleGestureDetector.java
@@ -19,9 +19,6 @@ package android.view;
import android.content.Context;
import android.os.SystemClock;
import android.util.FloatMath;
-import android.util.Log;
-
-import java.util.Arrays;
/**
* Detects scaling transformation gestures using the supplied {@link MotionEvent}s.
@@ -143,11 +140,16 @@ public class ScaleGestureDetector {
private int mSpanSlop;
private int mMinSpan;
- private float[] mTouchHistoryLastAccepted;
- private int[] mTouchHistoryDirection;
- private long[] mTouchHistoryLastAcceptedTime;
+ // Bounds for recently seen values
+ private float mTouchUpper;
+ private float mTouchLower;
+ private float mTouchHistoryLastAccepted;
+ private int mTouchHistoryDirection;
+ private long mTouchHistoryLastAcceptedTime;
+ private int mTouchMinMajor;
private static final long TOUCH_STABILIZE_TIME = 128; // ms
+ private static final int TOUCH_MIN_MAJOR = 48; // dp
/**
* Consistency verifier for debugging purposes.
@@ -160,6 +162,8 @@ public class ScaleGestureDetector {
mContext = context;
mListener = listener;
mSpanSlop = ViewConfiguration.get(context).getScaledTouchSlop() * 2;
+ mTouchMinMajor =
+ (int) (context.getResources().getDisplayMetrics().density * TOUCH_MIN_MAJOR + 0.5f);
mMinSpan = context.getResources().getDimensionPixelSize(
com.android.internal.R.dimen.config_minScalingSpan);
}
@@ -172,81 +176,55 @@ public class ScaleGestureDetector {
private void addTouchHistory(MotionEvent ev) {
final long currentTime = SystemClock.uptimeMillis();
final int count = ev.getPointerCount();
+ boolean accept = currentTime - mTouchHistoryLastAcceptedTime >= TOUCH_STABILIZE_TIME;
+ float total = 0;
+ int sampleCount = 0;
for (int i = 0; i < count; i++) {
- final int id = ev.getPointerId(i);
- ensureTouchHistorySize(id);
-
- final boolean hasLastAccepted = !Float.isNaN(mTouchHistoryLastAccepted[id]);
- boolean accept = true;
+ final boolean hasLastAccepted = !Float.isNaN(mTouchHistoryLastAccepted);
final int historySize = ev.getHistorySize();
- for (int h = 0; h < historySize + 1; h++) {
- final float major;
- final float minor;
+ final int pointerSampleCount = historySize + 1;
+ for (int h = 0; h < pointerSampleCount; h++) {
+ float major;
if (h < historySize) {
major = ev.getHistoricalTouchMajor(i, h);
- minor = ev.getHistoricalTouchMinor(i, h);
} else {
major = ev.getTouchMajor(i);
- minor = ev.getTouchMinor(i);
}
- final float avg = (major + minor) / 2;
+ if (major < mTouchMinMajor) major = mTouchMinMajor;
+ total += major;
+
+ if (Float.isNaN(mTouchUpper) || major > mTouchUpper) {
+ mTouchUpper = major;
+ }
+ if (Float.isNaN(mTouchLower) || major < mTouchLower) {
+ mTouchLower = major;
+ }
if (hasLastAccepted) {
- final int directionSig = (int) Math.signum(avg - mTouchHistoryLastAccepted[id]);
- if (directionSig != mTouchHistoryDirection[id] ||
- (directionSig == 0 && mTouchHistoryDirection[id] == 0)) {
- mTouchHistoryDirection[id] = directionSig;
+ final int directionSig = (int) Math.signum(major - mTouchHistoryLastAccepted);
+ if (directionSig != mTouchHistoryDirection ||
+ (directionSig == 0 && mTouchHistoryDirection == 0)) {
+ mTouchHistoryDirection = directionSig;
final long time = h < historySize ? ev.getHistoricalEventTime(h)
: ev.getEventTime();
- mTouchHistoryLastAcceptedTime[id] = time;
- accept = false;
- }
- if (currentTime - mTouchHistoryLastAcceptedTime[id] < TOUCH_STABILIZE_TIME) {
+ mTouchHistoryLastAcceptedTime = time;
accept = false;
}
}
}
-
- if (accept) {
- float newAccepted = (ev.getTouchMajor(i) + ev.getTouchMinor(i)) / 2;
- if (hasLastAccepted) {
- newAccepted = (mTouchHistoryLastAccepted[id] + newAccepted) / 2;
- }
- mTouchHistoryLastAccepted[id] = newAccepted;
- mTouchHistoryDirection[id] = 0;
- mTouchHistoryLastAcceptedTime[id] = ev.getEventTime();
- }
+ sampleCount += pointerSampleCount;
}
- }
- /**
- * Clear out the touch history for a given pointer id.
- * @param id pointer id to clear
- * @see #addTouchHistory(MotionEvent)
- */
- private boolean removeTouchHistoryForId(int id) {
- if (id >= mTouchHistoryLastAccepted.length) {
- return false;
- }
- mTouchHistoryLastAccepted[id] = Float.NaN;
- mTouchHistoryDirection[id] = 0;
- mTouchHistoryLastAcceptedTime[id] = 0;
- return true;
- }
+ final float avg = total / sampleCount;
- /**
- * Get the adjusted combined touchMajor/touchMinor value for a given pointer id
- * @param id the pointer id of the data to obtain
- * @return the adjusted major/minor value for the point at id
- * @see #addTouchHistory(MotionEvent)
- */
- private float getAdjustedTouchHistory(int id) {
- if (id >= mTouchHistoryLastAccepted.length) {
- Log.e(TAG, "Error retrieving adjusted touch history for id=" + id +
- " - incomplete event stream?");
- return 0;
+ if (accept) {
+ float newAccepted = (mTouchUpper + mTouchLower + avg) / 3;
+ mTouchUpper = (mTouchUpper + newAccepted) / 2;
+ mTouchLower = (mTouchLower + newAccepted) / 2;
+ mTouchHistoryLastAccepted = newAccepted;
+ mTouchHistoryDirection = 0;
+ mTouchHistoryLastAcceptedTime = ev.getEventTime();
}
- return mTouchHistoryLastAccepted[id];
}
/**
@@ -254,41 +232,11 @@ public class ScaleGestureDetector {
* @see #addTouchHistory(MotionEvent)
*/
private void clearTouchHistory() {
- if (mTouchHistoryLastAccepted == null) {
- // All three arrays will be null if this is the case; nothing to do.
- return;
- }
- Arrays.fill(mTouchHistoryLastAccepted, Float.NaN);
- Arrays.fill(mTouchHistoryDirection, 0);
- Arrays.fill(mTouchHistoryLastAcceptedTime, 0);
- }
-
- private void ensureTouchHistorySize(int id) {
- final int requiredSize = id + 1;
- if (mTouchHistoryLastAccepted == null || mTouchHistoryLastAccepted.length < requiredSize) {
- final float[] newLastAccepted = new float[requiredSize];
- final int[] newDirection = new int[requiredSize];
- final long[] newLastAcceptedTime = new long[requiredSize];
-
- int oldLength = 0;
- if (mTouchHistoryLastAccepted != null) {
- System.arraycopy(mTouchHistoryLastAccepted, 0, newLastAccepted, 0,
- mTouchHistoryLastAccepted.length);
- System.arraycopy(mTouchHistoryDirection, 0, newDirection, 0,
- mTouchHistoryDirection.length);
- System.arraycopy(mTouchHistoryLastAcceptedTime, 0, newLastAcceptedTime, 0,
- mTouchHistoryLastAcceptedTime.length);
- oldLength = mTouchHistoryLastAccepted.length;
- }
-
- Arrays.fill(newLastAccepted, oldLength, newLastAccepted.length, Float.NaN);
- Arrays.fill(newDirection, oldLength, newDirection.length, 0);
- Arrays.fill(newLastAcceptedTime, oldLength, newLastAcceptedTime.length, 0);
-
- mTouchHistoryLastAccepted = newLastAccepted;
- mTouchHistoryDirection = newDirection;
- mTouchHistoryLastAcceptedTime = newLastAcceptedTime;
- }
+ mTouchUpper = Float.NaN;
+ mTouchLower = Float.NaN;
+ mTouchHistoryLastAccepted = Float.NaN;
+ mTouchHistoryDirection = 0;
+ mTouchHistoryLastAcceptedTime = 0;
}
/**
@@ -346,23 +294,16 @@ public class ScaleGestureDetector {
final float focusX = sumX / div;
final float focusY = sumY / div;
- if (pointerUp) {
- final int id = event.getPointerId(event.getActionIndex());
- if (!removeTouchHistoryForId(id)) {
- Log.e(TAG, "Got ACTION_POINTER_UP for previously unknown id=" + id +
- " - incomplete event stream?");
- }
- } else {
- addTouchHistory(event);
- }
+
+ addTouchHistory(event);
// Determine average deviation from focal point
float devSumX = 0, devSumY = 0;
for (int i = 0; i < count; i++) {
if (skipIndex == i) continue;
- // Average touch major and touch minor and convert the resulting diameter into a radius.
- final float touchSize = getAdjustedTouchHistory(event.getPointerId(i)) / 2;
+ // Convert the resulting diameter into a radius.
+ final float touchSize = mTouchHistoryLastAccepted / 2;
devSumX += Math.abs(event.getX(i) - focusX) + touchSize;
devSumY += Math.abs(event.getY(i) - focusY) + touchSize;
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 63ec577..2d083b6 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5871,6 +5871,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
((layoutDirection << PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT) & PFLAG2_LAYOUT_DIRECTION_MASK);
// We need to resolve all RTL properties as they all depend on layout direction
resolveRtlPropertiesIfNeeded();
+ requestLayout();
+ invalidate(true);
}
}
@@ -6466,11 +6468,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (viewRootImpl != null) {
viewRootImpl.setAccessibilityFocus(this, null);
}
- if (mAttachInfo != null) {
- Rect rectangle = mAttachInfo.mTmpInvalRect;
- getDrawingRect(rectangle);
- requestRectangleOnScreen(rectangle);
- }
invalidate();
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
notifyAccessibilityStateChanged();
@@ -11573,8 +11570,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (!isDrawablesResolved()) {
resolveDrawables();
}
- requestLayout();
- invalidate(true);
onRtlPropertiesChanged(getLayoutDirection());
}
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 7f0af09..871f752 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -1055,30 +1055,30 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
if (mChoiceMode == CHOICE_MODE_MULTIPLE ||
(mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL && mChoiceActionMode != null)) {
- boolean newValue = !mCheckStates.get(position, false);
- mCheckStates.put(position, newValue);
+ boolean checked = !mCheckStates.get(position, false);
+ mCheckStates.put(position, checked);
if (mCheckedIdStates != null && mAdapter.hasStableIds()) {
- if (newValue) {
+ if (checked) {
mCheckedIdStates.put(mAdapter.getItemId(position), position);
} else {
mCheckedIdStates.delete(mAdapter.getItemId(position));
}
}
- if (newValue) {
+ if (checked) {
mCheckedItemCount++;
} else {
mCheckedItemCount--;
}
if (mChoiceActionMode != null) {
mMultiChoiceModeCallback.onItemCheckedStateChanged(mChoiceActionMode,
- position, id, newValue);
+ position, id, checked);
dispatchItemClick = false;
}
checkedStateChanged = true;
} else if (mChoiceMode == CHOICE_MODE_SINGLE) {
- boolean newValue = !mCheckStates.get(position, false);
- if (newValue) {
- mCheckStates.clear();
+ boolean checked = !mCheckStates.get(position, false);
+ mCheckStates.clear();
+ if (checked) {
mCheckStates.put(position, true);
if (mCheckedIdStates != null && mAdapter.hasStableIds()) {
mCheckedIdStates.clear();
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index c67cae6..19b825c 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -122,6 +122,7 @@ public class Editor {
InputMethodState mInputMethodState;
DisplayList[] mTextDisplayLists;
+ int mLastLayoutHeight;
boolean mFrozenWithFocus;
boolean mSelectionMoved;
@@ -1258,6 +1259,16 @@ public class Editor {
mTextDisplayLists = new DisplayList[ArrayUtils.idealObjectArraySize(0)];
}
+ // If the height of the layout changes (usually when inserting or deleting a line,
+ // but could be changes within a span), invalidate everything. We could optimize
+ // more aggressively (for example, adding offsets to blocks) but it would be more
+ // complex and we would only get the benefit in some cases.
+ int layoutHeight = layout.getHeight();
+ if (mLastLayoutHeight != layoutHeight) {
+ invalidateTextDisplayList();
+ mLastLayoutHeight = layoutHeight;
+ }
+
DynamicLayout dynamicLayout = (DynamicLayout) layout;
int[] blockEndLines = dynamicLayout.getBlockEndLines();
int[] blockIndices = dynamicLayout.getBlockIndices();
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index 317baf1..925864c 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -30,8 +30,11 @@ import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
+import android.view.ViewTreeObserver;
+import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.widget.PopupWindow.OnDismissListener;
/**
@@ -978,6 +981,30 @@ public class Spinner extends AbsSpinner implements OnClickListener {
super.show();
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
setSelection(Spinner.this.getSelectedItemPosition());
+
+ // Make sure we hide if our anchor goes away.
+ // TODO: This might be appropriate to push all the way down to PopupWindow,
+ // but it may have other side effects to investigate first. (Text editing handles, etc.)
+ final ViewTreeObserver vto = getViewTreeObserver();
+ if (vto != null) {
+ final OnGlobalLayoutListener layoutListener = new OnGlobalLayoutListener() {
+ @Override
+ public void onGlobalLayout() {
+ if (!Spinner.this.isVisibleToUser()) {
+ dismiss();
+ }
+ }
+ };
+ vto.addOnGlobalLayoutListener(layoutListener);
+ setOnDismissListener(new OnDismissListener() {
+ @Override public void onDismiss() {
+ final ViewTreeObserver vto = getViewTreeObserver();
+ if (vto != null) {
+ vto.removeOnGlobalLayoutListener(layoutListener);
+ }
+ }
+ });
+ }
}
}
}
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 84e1d95..f987fc5 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -125,7 +125,9 @@ public class LockPatternUtils {
private final ContentResolver mContentResolver;
private DevicePolicyManager mDevicePolicyManager;
private ILockSettings mLockSettingsService;
- private int mCurrentUserId = UserHandle.USER_NULL;
+
+ // The current user is set by KeyguardViewMediator and shared by all LockPatternUtils.
+ private static volatile int sCurrentUserId = UserHandle.USER_NULL;
public DevicePolicyManager getDevicePolicyManager() {
if (mDevicePolicyManager == null) {
@@ -215,13 +217,13 @@ public class LockPatternUtils {
}
public void setCurrentUser(int userId) {
- mCurrentUserId = userId;
+ sCurrentUserId = userId;
}
public int getCurrentUser() {
- if (mCurrentUserId != UserHandle.USER_NULL) {
+ if (sCurrentUserId != UserHandle.USER_NULL) {
// Someone is regularly updating using setCurrentUser() use that value.
- return mCurrentUserId;
+ return sCurrentUserId;
}
try {
return ActivityManagerNative.getDefault().getCurrentUser().id;
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index ba8cea4..4669c37 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -111,7 +111,7 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
// Compute advances and store them
mShaper->computeValues(value.get(), paint,
- reinterpret_cast<const UChar*>(text), start, count,
+ reinterpret_cast<const UChar*>(key.getText()), start, count,
size_t(contextCount), int(dirFlags));
if (mDebugEnabled) {
@@ -139,15 +139,12 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
// Update current cache size
mSize += size;
- // Copy the text when we insert the new entry
- key.internalTextCopy();
-
bool putOne = mCache.put(key, value);
LOG_ALWAYS_FATAL_IF(!putOne, "Failed to put an entry into the cache. "
"This indicates that the cache already has an entry with the "
"same key but it should not since we checked earlier!"
" - start = %d, count = %d, contextCount = %d - Text = '%s'",
- start, count, contextCount, String8(text + start, count).string());
+ start, count, contextCount, String8(key.getText() + start, count).string());
if (mDebugEnabled) {
nsecs_t totalTime = systemTime(SYSTEM_TIME_MONOTONIC) - startTime;
@@ -158,7 +155,7 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
value.get(), start, count, contextCount, size, mMaxSize - mSize,
value->getElapsedTime() * 0.000001f,
(totalTime - value->getElapsedTime()) * 0.000001f,
- String8(text + start, count).string());
+ String8(key.getText() + start, count).string());
}
} else {
if (mDebugEnabled) {
@@ -168,7 +165,7 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
" - Compute time %0.6f ms - Text = '%s'",
start, count, contextCount, size, mMaxSize - mSize,
value->getElapsedTime() * 0.000001f,
- String8(text + start, count).string());
+ String8(key.getText() + start, count).string());
}
}
} else {
@@ -188,7 +185,7 @@ sp<TextLayoutValue> TextLayoutCache::getValue(const SkPaint* paint,
value->getElapsedTime() * 0.000001f,
elapsedTimeThruCacheGet * 0.000001f,
deltaPercent,
- String8(text + start, count).string());
+ String8(key.getText() + start, count).string());
}
if (mCacheHitCount % DEFAULT_DUMP_STATS_CACHE_HIT_INTERVAL == 0) {
dumpCacheStats();
@@ -225,15 +222,16 @@ void TextLayoutCache::dumpCacheStats() {
/**
* TextLayoutCacheKey
*/
-TextLayoutCacheKey::TextLayoutCacheKey(): text(NULL), start(0), count(0), contextCount(0),
+TextLayoutCacheKey::TextLayoutCacheKey(): start(0), count(0), contextCount(0),
dirFlags(0), typeface(NULL), textSize(0), textSkewX(0), textScaleX(0), flags(0),
hinting(SkPaint::kNo_Hinting), variant(SkPaint::kDefault_Variant), language() {
}
TextLayoutCacheKey::TextLayoutCacheKey(const SkPaint* paint, const UChar* text,
size_t start, size_t count, size_t contextCount, int dirFlags) :
- text(text), start(start), count(count), contextCount(contextCount),
+ start(start), count(count), contextCount(contextCount),
dirFlags(dirFlags) {
+ textCopy.setTo(text, contextCount);
typeface = paint->getTypeface();
textSize = paint->getTextSize();
textSkewX = paint->getTextSkewX();
@@ -245,7 +243,6 @@ TextLayoutCacheKey::TextLayoutCacheKey(const SkPaint* paint, const UChar* text,
}
TextLayoutCacheKey::TextLayoutCacheKey(const TextLayoutCacheKey& other) :
- text(NULL),
textCopy(other.textCopy),
start(other.start),
count(other.count),
@@ -259,9 +256,6 @@ TextLayoutCacheKey::TextLayoutCacheKey(const TextLayoutCacheKey& other) :
hinting(other.hinting),
variant(other.variant),
language(other.language) {
- if (other.text) {
- textCopy.setTo(other.text, other.contextCount);
- }
}
int TextLayoutCacheKey::compare(const TextLayoutCacheKey& lhs, const TextLayoutCacheKey& rhs) {
@@ -304,11 +298,6 @@ int TextLayoutCacheKey::compare(const TextLayoutCacheKey& lhs, const TextLayoutC
return memcmp(lhs.getText(), rhs.getText(), lhs.contextCount * sizeof(UChar));
}
-void TextLayoutCacheKey::internalTextCopy() {
- textCopy.setTo(text, contextCount);
- text = NULL;
-}
-
size_t TextLayoutCacheKey::getSize() const {
return sizeof(TextLayoutCacheKey) + sizeof(UChar) * contextCount;
}
diff --git a/core/jni/android/graphics/TextLayoutCache.h b/core/jni/android/graphics/TextLayoutCache.h
index 1f4e22c..9994393 100644
--- a/core/jni/android/graphics/TextLayoutCache.h
+++ b/core/jni/android/graphics/TextLayoutCache.h
@@ -77,20 +77,15 @@ public:
TextLayoutCacheKey(const TextLayoutCacheKey& other);
/**
- * We need to copy the text when we insert the key into the cache itself.
- * We don't need to copy the text when we are only comparing keys.
- */
- void internalTextCopy();
-
- /**
* Get the size of the Cache key.
*/
size_t getSize() const;
static int compare(const TextLayoutCacheKey& lhs, const TextLayoutCacheKey& rhs);
+ inline const UChar* getText() const { return textCopy.string(); }
+
private:
- const UChar* text; // if text is NULL, use textCopy
String16 textCopy;
size_t start;
size_t count;
@@ -105,8 +100,6 @@ private:
SkPaint::FontVariant variant;
SkLanguage language;
- inline const UChar* getText() const { return text ? text : textCopy.string(); }
-
}; // TextLayoutCacheKey
inline int strictly_order_type(const TextLayoutCacheKey& lhs, const TextLayoutCacheKey& rhs) {
@@ -316,6 +309,12 @@ public:
TextLayoutEngine();
virtual ~TextLayoutEngine();
+ /**
+ * Note: this method currently does a defensive copy of the text argument, in case
+ * there is concurrent mutation of it. The contract may change, and may in the
+ * future require the caller to guarantee that the contents will not change during
+ * the call. Be careful of this when doing optimization.
+ **/
sp<TextLayoutValue> getValue(const SkPaint* paint, const jchar* text, jint start,
jint count, jint contextCount, jint dirFlags);
diff --git a/core/res/res/drawable-hdpi/stat_notify_rssi_in_range.png b/core/res/res/drawable-hdpi/stat_notify_rssi_in_range.png
new file mode 100644
index 0000000..74977e6
--- /dev/null
+++ b/core/res/res/drawable-hdpi/stat_notify_rssi_in_range.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/stat_notify_rssi_in_range.png b/core/res/res/drawable-mdpi/stat_notify_rssi_in_range.png
new file mode 100644
index 0000000..62e4fe9
--- /dev/null
+++ b/core/res/res/drawable-mdpi/stat_notify_rssi_in_range.png
Binary files differ
diff --git a/core/res/res/drawable-nodpi/kg_widget_overscroll_layer_left.9.png b/core/res/res/drawable-nodpi/kg_widget_overscroll_layer_left.9.png
deleted file mode 100644
index c30eb1c..0000000
--- a/core/res/res/drawable-nodpi/kg_widget_overscroll_layer_left.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-nodpi/kg_widget_overscroll_layer_right.9.png b/core/res/res/drawable-nodpi/kg_widget_overscroll_layer_right.9.png
deleted file mode 100644
index e5d5771..0000000
--- a/core/res/res/drawable-nodpi/kg_widget_overscroll_layer_right.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/stat_notify_rssi_in_range.png b/core/res/res/drawable-xhdpi/stat_notify_rssi_in_range.png
new file mode 100644
index 0000000..c0586d8
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/stat_notify_rssi_in_range.png
Binary files differ
diff --git a/core/res/res/layout-land/keyguard_host_view.xml b/core/res/res/layout-land/keyguard_host_view.xml
index 18e23f0..ac943cb 100644
--- a/core/res/res/layout-land/keyguard_host_view.xml
+++ b/core/res/res/layout-land/keyguard_host_view.xml
@@ -28,17 +28,16 @@
android:orientation="horizontal">
<include layout="@layout/keyguard_widget_region"
- android:layout_width="0dip"
- android:layout_height="230dip"
- android:layout_weight=".45"/>
+ android:layout_width="0dp"
+ android:layout_weight=".45" />
<com.android.internal.policy.impl.keyguard.KeyguardSecurityViewFlipper
android:id="@+id/view_flipper"
- android:layout_width="0dip"
+ android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.55"
- android:layout_marginLeft="8dip"
- android:layout_marginRight="8dip"
+ android:layout_marginLeft="8dp"
+ android:layout_marginRight="8dp"
android:gravity="center">
<!-- SelectorView is always used, so add it here. The rest are loaded dynamically -->
diff --git a/core/res/res/layout/keyguard_multi_user_avatar.xml b/core/res/res/layout/keyguard_multi_user_avatar.xml
index a3621c0..d6a858f 100644
--- a/core/res/res/layout/keyguard_multi_user_avatar.xml
+++ b/core/res/res/layout/keyguard_multi_user_avatar.xml
@@ -22,6 +22,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="125dp"
android:layout_height="125dp"
+ android:background="#000000"
android:gravity="center_horizontal">
<ImageView
android:id="@+id/keyguard_user_avatar"
@@ -29,12 +30,23 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/>
- <TextView
- android:id="@+id/keyguard_user_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|right"
- android:textSize="12sp"
- android:background="#99FFFFFF"
- android:textColor="#ff000000"/>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="0.78" />
+ <TextView
+ android:id="@+id/keyguard_user_name"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="0.22"
+ android:paddingLeft="6dp"
+ android:layout_gravity="center_vertical|left"
+ android:textSize="16sp"
+ android:textColor="#ffffff"
+ android:background="#808080" />
+ </LinearLayout>
</com.android.internal.policy.impl.keyguard.KeyguardMultiUserAvatar> \ No newline at end of file
diff --git a/core/res/res/layout/keyguard_multi_user_selector.xml b/core/res/res/layout/keyguard_multi_user_selector.xml
index c599fd5..5a6e998 100644
--- a/core/res/res/layout/keyguard_multi_user_selector.xml
+++ b/core/res/res/layout/keyguard_multi_user_selector.xml
@@ -21,7 +21,8 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_gravity="center">
+ android:layout_gravity="center"
+ android:contentDescription="@string/keyguard_accessibility_user_selector">
<com.android.internal.policy.impl.keyguard.KeyguardSubdivisionLayout
android:id="@+id/keyguard_users_grid"
diff --git a/core/res/res/layout/keyguard_multi_user_selector_widget.xml b/core/res/res/layout/keyguard_multi_user_selector_widget.xml
index c00089c..ad9fdfe 100644
--- a/core/res/res/layout/keyguard_multi_user_selector_widget.xml
+++ b/core/res/res/layout/keyguard_multi_user_selector_widget.xml
@@ -20,6 +20,7 @@
<!-- This is a view that shows general status information in Keyguard. -->
<com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame
xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/keyguard_multi_user_selector"
android:layout_width="match_parent"
android:layout_height="match_parent">
diff --git a/core/res/res/layout/keyguard_selector_view.xml b/core/res/res/layout/keyguard_selector_view.xml
index 710a78e..8ef3b75 100644
--- a/core/res/res/layout/keyguard_selector_view.xml
+++ b/core/res/res/layout/keyguard_selector_view.xml
@@ -29,10 +29,7 @@
<include layout="@layout/keyguard_widget_region"
android:layout_width="match_parent"
android:layout_height="0dip"
- android:layout_weight="0.45"
- android:layout_marginTop="35dip"
- android:layout_marginLeft="33dip"
- android:layout_marginRight="33dip"/>
+ android:layout_weight="0.45" />
<RelativeLayout
android:layout_width="wrap_content"
diff --git a/core/res/res/layout/keyguard_status_view.xml b/core/res/res/layout/keyguard_status_view.xml
index d8adc93..c7f6863 100644
--- a/core/res/res/layout/keyguard_status_view.xml
+++ b/core/res/res/layout/keyguard_status_view.xml
@@ -20,16 +20,17 @@
<!-- This is a view that shows general status information in Keyguard. -->
<com.android.internal.policy.impl.keyguard.KeyguardWidgetFrame
xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/keyguard_status_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:id="@+id/keyguard_status_view"
android:gravity="center_horizontal">
<com.android.internal.policy.impl.keyguard.KeyguardStatusView
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:gravity="center_horizontal">
+ android:gravity="center_horizontal"
+ android:contentDescription="@string/keyguard_accessibility_status">
<com.android.internal.policy.impl.keyguard.ClockView
android:id="@+id/clock_view"
diff --git a/core/res/res/layout/keyguard_transport_control_view.xml b/core/res/res/layout/keyguard_transport_control_view.xml
index c40aa66..5a6083a 100644
--- a/core/res/res/layout/keyguard_transport_control_view.xml
+++ b/core/res/res/layout/keyguard_transport_control_view.xml
@@ -26,7 +26,8 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:foreground="@drawable/ic_lockscreen_player_background">
+ android:foreground="@drawable/ic_lockscreen_player_background"
+ android:contentDescription="@string/keygaurd_accessibility_media_controls">
<!-- Use ImageView for its cropping features; otherwise could be android:background -->
<ImageView
android:id="@+id/albumart"
diff --git a/core/res/res/layout/keyguard_widget_region.xml b/core/res/res/layout/keyguard_widget_region.xml
index 123d105..01b5551 100644
--- a/core/res/res/layout/keyguard_widget_region.xml
+++ b/core/res/res/layout/keyguard_widget_region.xml
@@ -25,44 +25,46 @@
android:visibility="gone"
android:gravity="center"
android:orientation="vertical">
- <Space
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1" />
<com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
android:id="@+id/app_widget_container"
android:layout_width="match_parent"
- android:layout_height="@dimen/kg_widget_container_height">
- <!-- TODO: Remove this when supported as a widget -->
- <include layout="@layout/keyguard_status_view"/>
- <include layout="@layout/keyguard_transport_control_view"/>
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:clipChildren="false"
+ android:clipToPadding="false">
</com.android.internal.policy.impl.keyguard.KeyguardWidgetPager>
<LinearLayout
android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1"
- android:orientation="horizontal">
+ android:layout_height="10dp"
+ android:orientation="horizontal"
+ android:paddingLeft="@dimen/kg_widget_pager_horizontal_padding"
+ android:paddingRight="@dimen/kg_widget_pager_horizontal_padding"
+ android:layout_marginTop="@dimen/kg_runway_lights_top_margin">
<com.android.internal.policy.impl.keyguard.KeyguardGlowStripView
android:id="@+id/left_strip"
- android:layout_width="0dip"
+ android:paddingTop="@dimen/kg_runway_lights_vertical_padding"
+ android:paddingBottom="@dimen/kg_runway_lights_vertical_padding"
+ android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
prvandroid:numDots="5"
- prvandroid:dotSize="7dip"
+ prvandroid:dotSize="@dimen/kg_runway_lights_height"
prvandroid:leftToRight="false"
prvandroid:glowDot="@*android:drawable/ic_lockscreen_glowdot" />
<Space
- android:layout_width="0dip"
+ android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.6"/>
<com.android.internal.policy.impl.keyguard.KeyguardGlowStripView
android:id="@+id/right_strip"
- android:layout_width="0dip"
+ android:paddingTop="@dimen/kg_runway_lights_vertical_padding"
+ android:paddingBottom="@dimen/kg_runway_lights_vertical_padding"
+ android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
prvandroid:numDots="5"
- prvandroid:dotSize="7dip"
+ prvandroid:dotSize="@dimen/kg_runway_lights_height"
prvandroid:leftToRight="true"
prvandroid:glowDot="@*android:drawable/ic_lockscreen_glowdot" />
</LinearLayout>
-</com.android.internal.policy.impl.keyguard.KeyguardWidgetRegion> \ No newline at end of file
+</com.android.internal.policy.impl.keyguard.KeyguardWidgetRegion>
diff --git a/core/res/res/values-mcc310/config.xml b/core/res/res/values-mcc310/config.xml
new file mode 100644
index 0000000..df398f9
--- /dev/null
+++ b/core/res/res/values-mcc310/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <bool name="config_safe_media_volume_enabled">false</bool>
+
+</resources>
diff --git a/core/res/res/values-mcc311/config.xml b/core/res/res/values-mcc311/config.xml
new file mode 100644
index 0000000..df398f9
--- /dev/null
+++ b/core/res/res/values-mcc311/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <bool name="config_safe_media_volume_enabled">false</bool>
+
+</resources>
diff --git a/core/res/res/values-mcc312/config.xml b/core/res/res/values-mcc312/config.xml
new file mode 100644
index 0000000..df398f9
--- /dev/null
+++ b/core/res/res/values-mcc312/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <bool name="config_safe_media_volume_enabled">false</bool>
+
+</resources>
diff --git a/core/res/res/values-mcc313/config.xml b/core/res/res/values-mcc313/config.xml
new file mode 100644
index 0000000..df398f9
--- /dev/null
+++ b/core/res/res/values-mcc313/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <bool name="config_safe_media_volume_enabled">false</bool>
+
+</resources>
diff --git a/core/res/res/values-mcc314/config.xml b/core/res/res/values-mcc314/config.xml
new file mode 100644
index 0000000..df398f9
--- /dev/null
+++ b/core/res/res/values-mcc314/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <bool name="config_safe_media_volume_enabled">false</bool>
+
+</resources>
diff --git a/core/res/res/values-mcc315/config.xml b/core/res/res/values-mcc315/config.xml
new file mode 100644
index 0000000..df398f9
--- /dev/null
+++ b/core/res/res/values-mcc315/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <bool name="config_safe_media_volume_enabled">false</bool>
+
+</resources>
diff --git a/core/res/res/values-mcc316/config.xml b/core/res/res/values-mcc316/config.xml
new file mode 100644
index 0000000..df398f9
--- /dev/null
+++ b/core/res/res/values-mcc316/config.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <bool name="config_safe_media_volume_enabled">false</bool>
+
+</resources>
diff --git a/core/res/res/values-sw600dp/dimens.xml b/core/res/res/values-sw600dp/dimens.xml
index 4e202ac..0c36d4a 100644
--- a/core/res/res/values-sw600dp/dimens.xml
+++ b/core/res/res/values-sw600dp/dimens.xml
@@ -77,5 +77,13 @@
<!-- Preference fragment padding, sides -->
<dimen name="preference_fragment_padding_side">24dp</dimen>
<dimen name="preference_screen_header_padding_side">24dip</dimen>
+
+ <!-- Keyguard dimensions -->
+ <!-- Bottom padding for the widget pager -->
+ <dimen name="kg_widget_pager_bottom_padding">16dp</dimen>
+
+ <!-- Top margin for the runway lights. We add a negative margin in large
+ devices to account for the widget pager padding -->
+ <dimen name="kg_runway_lights_top_margin">-10dp</dimen>
</resources>
diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml
index 07d0d74..6a93f30 100644
--- a/core/res/res/values/colors.xml
+++ b/core/res/res/values/colors.xml
@@ -115,6 +115,11 @@
<color name="lockscreen_clock_am_pm">#ffffffff</color>
<color name="lockscreen_owner_info">#ff9a9a9a</color>
+ <!-- keyguard overscroll widget pager -->
+ <color name="kg_multi_user_text_active">#ffffffff</color>
+ <color name="kg_multi_user_text_inactive">#ff808080</color>
+ <color name="kg_widget_pager_gradient">#ff33B5E5</color>
+
<!-- FaceLock -->
<color name="facelock_spotlight_mask">#CC000000</color>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index f143d50..16960c8 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -964,4 +964,21 @@
on the headphone/microphone jack. When false use the older uevent framework. -->
<bool name="config_useDevInputEventForAudioJack">false</bool>
+ <!-- Whether safe headphone volume is enabled or not (country specific). -->
+ <bool name="config_safe_media_volume_enabled">true</bool>
+
+ <!-- Set to true if the wifi display supports compositing content stored
+ in gralloc protected buffers. For this to be true, there must exist
+ a protected hardware path for surface flinger to composite and send
+ protected buffers to the wifi display video encoder.
+
+ If this flag is false, we advise applications not to use protected
+ buffers (if possible) when presenting content to a wifi display because
+ the content may be blanked.
+
+ This flag controls whether the {@link Display#FLAG_SUPPORTS_PROTECTED_BUFFERS}
+ flag is set for wifi displays.
+ -->
+ <bool name="config_wifiDisplaySupportsProtectedBuffers">false</bool>
+
</resources>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 01a35b0..10f0d39 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -254,9 +254,6 @@
<!-- Height of widget view in keyguard. -->
<dimen name="kg_widget_view_height">0dp</dimen>
- <!-- Padding surrounding each widget page -->
- <dimen name="kg_widget_page_padding">10dp</dimen>
-
<!-- Size of the clock font in keyguard's status view -->
<dimen name="kg_status_clock_font_size">94dp</dimen>
@@ -285,8 +282,24 @@
<!-- Space reserved at the bottom of secure views (pin/pattern/password/SIM pin/SIM puk) -->
<dimen name="kg_secure_padding_height">46dp</dimen>
- <!-- The height of the widget container -->
- <dimen name="kg_widget_container_height">200dp</dimen>
+ <!-- The height of the runway lights strip -->
+ <dimen name="kg_runway_lights_height">7dp</dimen>
+
+ <!-- The height of the runway lights strip -->
+ <dimen name="kg_runway_lights_vertical_padding">2dp</dimen>
+
+ <!-- Horizontal padding for the widget pager -->
+ <dimen name="kg_widget_pager_horizontal_padding">16dp</dimen>
+
+ <!-- Top padding for the widget pager -->
+ <dimen name="kg_widget_pager_top_padding">16dp</dimen>
+
+ <!-- Bottom padding for the widget pager -->
+ <dimen name="kg_widget_pager_bottom_padding">6dp</dimen>
+
+ <!-- Top margin for the runway lights. We add a negative margin in large
+ devices to account for the widget pager padding -->
+ <dimen name="kg_runway_lights_top_margin">0dp</dimen>
<!-- Touch slop for the global toggle accessibility gesture -->
<dimen name="accessibility_touch_slop">80dip</dimen>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 2f9ce0c..fb8005a 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2272,6 +2272,15 @@
<!-- Accessibility description sent when user completes drawing a pattern. [CHAR LIMIT=NONE] -->
<string name="lockscreen_access_pattern_detected">Pattern completed</string>
+ <!-- Accessibility description sent when user changes the current lock screen widget. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_widget_changed">%1$s. Widget %2$d of %3$d.</string>
+ <!-- Accessibility description of the lock screen user selector widget. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_user_selector">User selector</string>
+ <!-- Accessibility description of the lock screen status widget. [CHAR_LIMIT=none] -->
+ <string name="keyguard_accessibility_status">Status</string>
+ <!-- Accessibility description of the lock media control widget. [CHAR_LIMIT=none] -->
+ <string name="keygaurd_accessibility_media_controls">Media controls</string>
+
<!-- Password keyboard strings. Used by LockScreen and Settings --><skip />
<!-- Label for "switch to symbols" key. Must be short to fit on key! -->
<string name="password_keyboard_label_symbol_key">\?123</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 0b30324..d423ecd 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -261,6 +261,7 @@
<java-symbol type="bool" name="config_ui_enableFadingMarquee" />
<java-symbol type="bool" name="config_use_strict_phone_number_comparation" />
<java-symbol type="bool" name="config_voice_capable" />
+ <java-symbol type="bool" name="config_wifiDisplaySupportsProtectedBuffers" />
<java-symbol type="bool" name="preferences_prefer_dual_pane" />
<java-symbol type="bool" name="skip_restoring_network_selection" />
<java-symbol type="bool" name="split_action_bar_is_narrow" />
@@ -272,7 +273,8 @@
<java-symbol type="bool" name="config_bluetooth_default_profiles" />
<java-symbol type="bool" name="config_enableWifiDisplay" />
<java-symbol type="bool" name="config_useDevInputEventForAudioJack" />
-
+ <java-symbol type="bool" name="config_safe_media_volume_enabled" />
+
<java-symbol type="integer" name="config_cursorWindowSize" />
<java-symbol type="integer" name="config_longPressOnPowerBehavior" />
<java-symbol type="integer" name="config_max_pan_devices" />
@@ -547,6 +549,10 @@
<java-symbol type="string" name="keyboardview_keycode_enter" />
<java-symbol type="string" name="keyboardview_keycode_mode_change" />
<java-symbol type="string" name="keyboardview_keycode_shift" />
+ <java-symbol type="string" name="keygaurd_accessibility_media_controls" />
+ <java-symbol type="string" name="keyguard_accessibility_status" />
+ <java-symbol type="string" name="keyguard_accessibility_user_selector" />
+ <java-symbol type="string" name="keyguard_accessibility_widget_changed" />
<java-symbol type="string" name="kilobyteShort" />
<java-symbol type="string" name="last_month" />
<java-symbol type="string" name="launchBrowserDefault" />
@@ -947,6 +953,7 @@
<java-symbol type="drawable" name="platlogo_alt" />
<java-symbol type="drawable" name="stat_notify_sync_error" />
<java-symbol type="drawable" name="stat_notify_wifi_in_range" />
+ <java-symbol type="drawable" name="stat_notify_rssi_in_range" />
<java-symbol type="drawable" name="stat_sys_gps_on" />
<java-symbol type="drawable" name="stat_sys_tether_wifi" />
<java-symbol type="drawable" name="status_bar_background" />
@@ -1096,6 +1103,7 @@
<java-symbol type="xml" name="kg_password_kbd_numeric" />
<java-symbol type="xml" name="power_profile" />
<java-symbol type="xml" name="time_zones_by_country" />
+ <java-symbol type="xml" name="sms_short_codes" />
<java-symbol type="raw" name="accessibility_gestures" />
<java-symbol type="raw" name="incognito_mode_start_page" />
@@ -1180,11 +1188,16 @@
<java-symbol type="bool" name="config_reverseDefaultRotation" />
<java-symbol type="bool" name="config_showNavigationBar" />
<java-symbol type="bool" name="target_honeycomb_needs_options_menu" />
+ <java-symbol type="color" name="kg_multi_user_text_active" />
+ <java-symbol type="color" name="kg_multi_user_text_inactive" />
+ <java-symbol type="color" name="kg_widget_pager_gradient" />
<java-symbol type="dimen" name="navigation_bar_height" />
<java-symbol type="dimen" name="navigation_bar_height_landscape" />
<java-symbol type="dimen" name="navigation_bar_width" />
<java-symbol type="dimen" name="status_bar_height" />
- <java-symbol type="dimen" name="kg_widget_page_padding" />
+ <java-symbol type="dimen" name="kg_widget_pager_horizontal_padding" />
+ <java-symbol type="dimen" name="kg_widget_pager_top_padding" />
+ <java-symbol type="dimen" name="kg_widget_pager_bottom_padding" />
<java-symbol type="drawable" name="ic_jog_dial_sound_off" />
<java-symbol type="drawable" name="ic_jog_dial_sound_on" />
<java-symbol type="drawable" name="ic_jog_dial_unlock" />
@@ -1203,8 +1216,6 @@
<java-symbol type="drawable" name="magnified_region_frame" />
<java-symbol type="drawable" name="menu_background" />
<java-symbol type="drawable" name="stat_sys_secure" />
- <java-symbol type="drawable" name="kg_widget_overscroll_layer_left" />
- <java-symbol type="drawable" name="kg_widget_overscroll_layer_right" />
<java-symbol type="id" name="action_mode_bar_stub" />
<java-symbol type="id" name="alarm_status" />
<java-symbol type="id" name="backspace" />
@@ -1288,6 +1299,7 @@
<java-symbol type="id" name="kg_widget_region" />
<java-symbol type="id" name="left_strip" />
<java-symbol type="id" name="right_strip" />
+ <java-symbol type="id" name="keyguard_multi_user_selector" />
<java-symbol type="integer" name="config_carDockRotation" />
<java-symbol type="integer" name="config_defaultUiModeType" />
@@ -1327,6 +1339,8 @@
<java-symbol type="layout" name="screen_title" />
<java-symbol type="layout" name="screen_title_icons" />
<java-symbol type="layout" name="keyguard_host_view" />
+ <java-symbol type="layout" name="keyguard_transport_control_view" />
+ <java-symbol type="layout" name="keyguard_status_view" />
<java-symbol type="string" name="abbrev_wday_month_day_no_year" />
<java-symbol type="string" name="android_upgrading_title" />
<java-symbol type="string" name="bugreport_title" />
@@ -1396,7 +1410,6 @@
<java-symbol type="string" name="kg_password_wrong_pin_code" />
<java-symbol type="string" name="kg_invalid_sim_pin_hint" />
<java-symbol type="string" name="kg_invalid_sim_puk_hint" />
- <java-symbol type="string" name="kg_sim_puk_recovery_hint" />
<java-symbol type="string" name="kg_invalid_puk" />
<java-symbol type="string" name="kg_login_too_many_attempts" />
<java-symbol type="string" name="kg_login_instructions" />
diff --git a/core/res/res/xml/sms_short_codes.xml b/core/res/res/xml/sms_short_codes.xml
new file mode 100644
index 0000000..8b395af
--- /dev/null
+++ b/core/res/res/xml/sms_short_codes.xml
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!-- Regex patterns for SMS short codes by country. -->
+<shortcodes>
+
+ <!-- The country attribute is the ISO country code of the user's account (from SIM card or NV).
+ The pattern attribute is a regex that matches all SMS short codes for the country.
+ The premium attribute is a regex that matches premium rate SMS short codes.
+ The free attribute matches short codes that we know will not cost the user, such as
+ emergency numbers. The standard attribute matches short codes that are billed at the
+ standard SMS rate. The user is warned when the destination phone number matches the
+ "pattern" or "premium" regexes, and does not match the "free" or "standard" regexes. -->
+
+ <!-- Harmonised European Short Codes are 6 digit numbers starting with 116 (free helplines).
+ Premium patterns include short codes from: http://aonebill.com/coverage&tariffs
+ and http://mobilcent.com/info-worldwide.asp and extracted from:
+ http://smscoin.net/software/engine/WordPress/Paid+SMS-registration/ -->
+
+ <!-- Albania: 5 digits, known short codes listed -->
+ <shortcode country="al" pattern="\\d{5}" premium="15191|55[56]00" />
+
+ <!-- Armenia: 3-4 digits, emergency numbers 10[123] -->
+ <shortcode country="am" pattern="\\d{3,4}" premium="11[2456]1|3024" free="10[123]" />
+
+ <!-- Austria: 10 digits, premium prefix 09xx, plus EU -->
+ <shortcode country="at" pattern="11\\d{4}" premium="09.*" free="116\\d{3}" />
+
+ <!-- Australia: 6 or 8 digits starting with "19" -->
+ <shortcode country="au" pattern="19(?:\\d{4}|\\d{6})" premium="19998882" />
+
+ <!-- Azerbaijan: 4-5 digits, known premium codes listed -->
+ <shortcode country="az" pattern="\\d{4,5}" premium="330[12]|87744|901[234]|93(?:94|101)|9426|9525" />
+
+ <!-- Belgium: 4 digits, plus EU: http://www.mobileweb.be/en/mobileweb/sms-numberplan.asp -->
+ <shortcode country="be" premium="\\d{4}" free="8\\d{3}|116\\d{3}" />
+
+ <!-- Bulgaria: 4-5 digits, plus EU -->
+ <shortcode country="bg" pattern="\\d{4,5}" premium="18(?:16|423)|19(?:1[56]|35)" free="116\\d{3}" />
+
+ <!-- Belarus: 4 digits -->
+ <shortcode country="by" pattern="\\d{4}" premium="3336|4161|444[4689]|501[34]|7781" />
+
+ <!-- Canada: 5-6 digits -->
+ <shortcode country="ca" pattern="\\d{5,6}" premium="60999|88188" />
+
+ <!-- Switzerland: 3-5 digits: http://www.swisscom.ch/fxres/kmu/thirdpartybusiness_code_of_conduct_en.pdf -->
+ <shortcode country="ch" pattern="[2-9]\\d{2,4}" premium="543|83111" />
+
+ <!-- China: premium shortcodes start with "1066", free shortcodes start with "1065":
+ http://clients.txtnation.com/entries/197192-china-premium-sms-short-code-requirements -->
+ <shortcode country="cn" premium="1066.*" free="1065.*" />
+
+ <!-- Cyprus: 4-6 digits (not confirmed), known premium codes listed, plus EU -->
+ <shortcode country="cy" pattern="\\d{4,6}" premium="7510" free="116\\d{3}" />
+
+ <!-- Czech Republic: 7-8 digits, starting with 9, plus EU:
+ http://www.o2.cz/osobni/en/services-by-alphabet/91670-premium_sms.html -->
+ <shortcode country="cz" premium="9\\d{6,7}" free="116\\d{3}" />
+
+ <!-- Germany: 4-5 digits plus 1232xxx (premium codes from http://www.vodafone.de/infofaxe/537.pdf and http://premiumdienste.eplus.de/pdf/kodex.pdf), plus EU. To keep the premium regex from being too large, it only includes payment processors that have been used by SMS malware, with the regular pattern matching the other premium short codes. -->
+ <shortcode country="de" pattern="\\d{4,5}|1232\\d{3}" premium="11(?:111|833)|1232(?:013|021|060|075|286|358)|118(?:44|80|86)|20[25]00|220(?:21|22|88|99)|221(?:14|21)|223(?:44|53|77)|224[13]0|225(?:20|59|90)|226(?:06|10|20|26|30|40|56|70)|227(?:07|33|39|66|76|78|79|88|99)|228(?:08|11|66|77)|23300|30030|3[12347]000|330(?:33|55|66)|33(?:233|331|366|533)|34(?:34|567)|37000|40(?:040|123|444|[3568]00)|41(?:010|414)|44(?:000|044|344|44[24]|544)|50005|50100|50123|50555|51000|52(?:255|783)|54(?:100|2542)|55(?:077|[24]00|222|333|55|[12369]55)|56(?:789|886)|60800|6[13]000|66(?:[12348]66|566|766|777|88|999)|68888|70(?:07|123|777)|76766|77(?:007|070|222|444|[567]77)|80(?:008|123|888)|82(?:002|[378]00|323|444|472|474|488|727)|83(?:005|[169]00|333|830)|84(?:141|300|32[34]|343|488|499|777|888)|85888|86(?:188|566|640|644|650|677|868|888)|870[24]9|871(?:23|[49]9)|872(?:1[0-8]|49|99)|87499|875(?:49|55|99)|876(?:0[1367]|1[1245678]|54|99)|877(?:00|99)|878(?:15|25|3[567]|8[12])|87999|880(?:08|44|55|77|99)|88688|888(?:03|10|8|89)|8899|90(?:009|999)|99999" free="116\\d{3}" />
+
+ <!-- Denmark: see http://iprs.webspacecommerce.com/Denmark-Premium-Rate-Numbers -->
+ <shortcode country="dk" pattern="\\d{4,5}" premium="1\\d{3}" free="116\\d{3}" />
+
+ <!-- Estonia: short codes 3-5 digits starting with 1, plus premium 7 digit numbers starting with 90, plus EU.
+ http://www.tja.ee/public/documents/Elektrooniline_side/Oigusaktid/ENG/Estonian_Numbering_Plan_annex_06_09_2010.mht -->
+ <shortcode country="ee" pattern="1\\d{2,4}" premium="90\\d{5}|15330|1701[0-3]" free="116\\d{3}" />
+
+ <!-- Spain: 5-6 digits: 25xxx, 27xxx, 280xx, 35xxx, 37xxx, 795xxx, 797xxx, 995xxx, 997xxx, plus EU.
+ http://www.legallink.es/?q=en/content/which-current-regulatory-status-premium-rate-services-spain -->
+ <shortcode country="es" premium="[23][57]\\d{3}|280\\d{2}|[79]9[57]\\d{3}" free="116\\d{3}" />
+
+ <!-- Finland: 5-6 digits, premium 0600, 0700: http://en.wikipedia.org/wiki/Telephone_numbers_in_Finland -->
+ <shortcode country="fi" pattern="\\d{5,6}" premium="0600.*|0700.*|171(?:59|63)" free="116\\d{3}" />
+
+ <!-- France: 5 digits, free: 3xxxx, premium [4-8]xxxx, plus EU:
+ http://clients.txtnation.com/entries/161972-france-premium-sms-short-code-requirements -->
+ <shortcode country="fr" premium="[4-8]\\d{4}" free="3\\d{4}|116\\d{3}" />
+
+ <!-- United Kingdom (Great Britain): 4-6 digits, common codes [5-8]xxxx, plus EU:
+ http://www.short-codes.com/media/Co-regulatoryCodeofPracticeforcommonshortcodes170206.pdf -->
+ <shortcode country="gb" pattern="\\d{4,6}" premium="[5-8]\\d{4}" free="116\\d{3}" />
+
+ <!-- Georgia: 4 digits, known premium codes listed -->
+ <shortcode country="ge" pattern="\\d{4}" premium="801[234]|888[239]" />
+
+ <!-- Greece: 5 digits (54xxx, 19yxx, x=0-9, y=0-5): http://www.cmtelecom.com/premium-sms/greece -->
+ <shortcode country="gr" pattern="\\d{5}" premium="54\\d{3}|19[0-5]\\d{2}" free="116\\d{3}" />
+
+ <!-- Hungary: 4 or 10 digits starting with 1 or 0, plus EU:
+ http://clients.txtnation.com/entries/209633-hungary-premium-sms-short-code-regulations -->
+ <shortcode country="hu" pattern="[01](?:\\d{3}|\\d{9})" premium="0691227910|1784" free="116\\d{3}" />
+
+ <!-- Ireland: 5 digits, 5xxxx (50xxx=free, 5[12]xxx=standard), plus EU:
+ http://www.comreg.ie/_fileupload/publications/ComReg1117.pdf -->
+ <shortcode country="ie" pattern="\\d{5}" premium="5[3-9]\\d{3}" free="50\\d{3}|116\\d{3}" standard="5[12]\\d{3}" />
+
+ <!-- Israel: 4 digits, known premium codes listed -->
+ <shortcode country="il" pattern="\\d{4}" premium="4422|4545" />
+
+ <!-- Italy: 5 digits (premium=4xxxx), plus EU:
+ http://clients.txtnation.com/attachments/token/di5kfblvubttvlw/?name=Italy_CASP_EN.pdf -->
+ <shortcode country="it" pattern="\\d{5}" premium="4\\d{4}" free="116\\d{3}" />
+
+ <!-- Kyrgyzstan: 4 digits, known premium codes listed -->
+ <shortcode country="kg" pattern="\\d{4}" premium="415[2367]|444[69]" />
+
+ <!-- Kazakhstan: 4 digits, known premium codes listed: http://smscoin.net/info/pricing-kazakhstan/ -->
+ <shortcode country="kz" pattern="\\d{4}" premium="335[02]|4161|444[469]|77[2359]0|8444|919[3-5]|968[2-5]" />
+
+ <!-- Lithuania: 3-5 digits, known premium codes listed, plus EU -->
+ <shortcode country="lt" pattern="\\d{3,5}" premium="13[89]1|1394|16[34]5" free="116\\d{3}" />
+
+ <!-- Luxembourg: 5 digits, 6xxxx, plus EU:
+ http://www.luxgsm.lu/assets/files/filepage/file_1253803400.pdf -->
+ <shortcode country="lu" premium="6\\d{4}" free="116\\d{3}" />
+
+ <!-- Latvia: 4 digits, known premium codes listed, plus EU -->
+ <shortcode country="lv" pattern="\\d{4}" premium="18(?:19|63|7[1-4])" free="116\\d{3}" />
+
+ <!-- Mexico: 4-5 digits (not confirmed), known premium codes listed -->
+ <shortcode country="mx" pattern="\\d{4,5}" premium="53035|7766" />
+
+ <!-- Malaysia: 5 digits: http://www.skmm.gov.my/attachment/Consumer_Regulation/Mobile_Content_Services_FAQs.pdf -->
+ <shortcode country="my" pattern="\\d{5}" premium="32298|33776" />
+
+ <!-- The Netherlands, 4 digits, known premium codes listed, plus EU -->
+ <shortcode country="nl" pattern="\\d{4}" premium="4466|5040" free="116\\d{3}" />
+
+ <!-- Norway: 4-5 digits (not confirmed), known premium codes listed -->
+ <shortcode country="no" pattern="\\d{4,5}" premium="2201|222[67]" />
+
+ <!-- New Zealand: 3-4 digits, known premium codes listed -->
+ <shortcode country="nz" pattern="\\d{3,4}" premium="3903|8995" />
+
+ <!-- Poland: 4-5 digits (not confirmed), known premium codes listed, plus EU -->
+ <shortcode country="pl" pattern="\\d{4,5}" premium="74240|79(?:10|866)|92525" free="116\\d{3}" />
+
+ <!-- Portugal: 5 digits, plus EU:
+ http://clients.txtnation.com/entries/158326-portugal-premium-sms-short-code-regulations -->
+ <shortcode country="pt" premium="6[1289]\\d{3}" free="116\\d{3}" />
+
+ <!-- Romania: 4 digits, plus EU: http://www.simplus.ro/en/resources/glossary-of-terms/ -->
+ <shortcode country="ro" pattern="\\d{4}" premium="12(?:63|66|88)|13(?:14|80)" free="116\\d{3}" />
+
+ <!-- Russia: 4 digits, known premium codes listed: http://smscoin.net/info/pricing-russia/ -->
+ <shortcode country="ru" pattern="\\d{4}" premium="1(?:1[56]1|899)|2(?:09[57]|322|47[46]|880|990)|3[589]33|4161|44(?:4[3-9]|81)|77(?:33|81)" />
+
+ <!-- Sweden: 5 digits (72xxx), plus EU: http://www.viatel.se/en/premium-sms/ -->
+ <shortcode country="se" premium="72\\d{3}" free="116\\d{3}" />
+
+ <!-- Singapore: 5 digits: http://clients.txtnation.com/entries/306442-singapore-premium-sms-short-code-requirements
+ Free government directory info at 74688: http://app.sgdi.gov.sg/sms_help.asp -->
+ <shortcode country="sg" pattern="7\\d{4}" premium="73800" standard="74688" />
+
+ <!-- Slovenia: 4 digits (premium=3xxx, 6xxx, 8xxx), plus EU: http://www.cmtelecom.com/premium-sms/slovenia -->
+ <shortcode country="si" pattern="\\d{4}" premium="[368]\\d{3}" free="116\\d{3}" />
+
+ <!-- Slovakia: 4 digits (premium), plus EU: http://www.cmtelecom.com/premium-sms/slovakia -->
+ <shortcode country="sk" premium="\\d{4}" free="116\\d{3}" />
+
+ <!-- Tajikistan: 4 digits, known premium codes listed -->
+ <shortcode country="tj" pattern="\\d{4}" premium="11[3-7]1|4161|4333|444[689]" />
+
+ <!-- Ukraine: 4 digits, known premium codes listed -->
+ <shortcode country="ua" pattern="\\d{4}" premium="444[3-9]|70[579]4|7540" />
+
+ <!-- USA: 5-6 digits (premium codes from https://www.premiumsmsrefunds.com/ShortCodes.htm) -->
+ <shortcode country="us" pattern="\\d{5,6}" premium="20433|21(?:344|472)|22715|23(?:333|847)|24(?:15|28)0|25209|27(?:449|606|663)|28498|305(?:00|83)|32(?:340|941)|33(?:166|786|849)|34746|35(?:182|564)|37975|38(?:135|146|254)|41(?:366|463)|42335|43(?:355|500)|44(?:578|711|811)|45814|46(?:157|173|327)|46666|47553|48(?:221|277|669)|50(?:844|920)|51(?:062|368)|52944|54(?:723|892)|55928|56483|57370|59(?:182|187|252|342)|60339|61(?:266|982)|62478|64(?:219|898)|65(?:108|500)|69(?:208|388)|70877|71851|72(?:078|087|465)|73(?:288|588|882|909|997)|74(?:034|332|815)|76426|79213|81946|83177|84(?:103|685)|85797|86(?:234|236|666)|89616|90(?:715|842|938)|91(?:362|958)|94719|95297|96(?:040|666|835|969)|97(?:142|294|688)|99(?:689|796|807)" />
+
+</shortcodes>