diff options
41 files changed, 211 insertions, 108 deletions
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 86bbc55..6d5705d 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -574,7 +574,8 @@ public abstract class WallpaperService extends Service { final boolean flagsChanged = mCurWindowFlags != mWindowFlags || mCurWindowPrivateFlags != mWindowPrivateFlags; if (forceRelayout || creating || surfaceCreating || formatChanged || sizeChanged - || typeChanged || flagsChanged || redrawNeeded) { + || typeChanged || flagsChanged || redrawNeeded + || !mIWallpaperEngine.mShownReported) { if (DEBUG) Log.v(TAG, "Changes: creating=" + creating + " format=" + formatChanged + " size=" + sizeChanged); @@ -739,6 +740,7 @@ public abstract class WallpaperService extends Service { if (redrawNeeded) { mSession.finishDrawing(mWindow); } + mIWallpaperEngine.reportShown(); } } catch (RemoteException ex) { } @@ -950,6 +952,7 @@ public abstract class WallpaperService extends Service { final IBinder mWindowToken; final int mWindowType; final boolean mIsPreview; + boolean mShownReported; int mReqWidth; int mReqHeight; @@ -1002,6 +1005,18 @@ public abstract class WallpaperService extends Service { } } + public void reportShown() { + if (!mShownReported) { + mShownReported = true; + try { + mConnection.engineShown(this); + } catch (RemoteException e) { + Log.w(TAG, "Wallpaper host disappeared", e); + return; + } + } + } + public void destroy() { Message msg = mCaller.obtainMessage(DO_DETACH); mCaller.sendMessage(msg); @@ -1020,12 +1035,6 @@ public abstract class WallpaperService extends Service { mEngine = engine; mActiveEngines.add(engine); engine.attach(this); - try { - mConnection.engineShown(this); - } catch (RemoteException e) { - Log.w(TAG, "Wallpaper host disappeared", e); - return; - } return; } case DO_DETACH: { diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp index 1f70c66..150caf3 100644 --- a/core/jni/android/graphics/Paint.cpp +++ b/core/jni/android/graphics/Paint.cpp @@ -629,7 +629,7 @@ public: jint count, jint flags, jint offset, jint opt) { jfloat scalarArray[count]; - TextLayout::getTextRunAdvances(paint, text, start, count, count, flags, + TextLayout::getTextRunAdvances(paint, text, start, count, start + count, flags, scalarArray, NULL /* dont need totalAdvance */); jint pos = offset - start; diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index c794c51..aa67ec2 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -620,6 +620,13 @@ android:description="@string/permdesc_bluetoothAdmin" android:label="@string/permlab_bluetoothAdmin" /> + <!-- Allows bluetooth stack to access files + @hide This should only be used by Bluetooth apk. + --> + <permission android:name="android.permission.BLUETOOTH_STACK" + android:permissionGroup="android.permission-group.SYSTEM_TOOLS" + android:protectionLevel="signature" /> + <!-- Allows applications to perform I/O operations over NFC --> <permission android:name="android.permission.NFC" android:permissionGroup="android.permission-group.NETWORK" diff --git a/core/res/res/layout/keyguard_status_view.xml b/core/res/res/layout/keyguard_status_view.xml index c7f6863..951787b 100644 --- a/core/res/res/layout/keyguard_status_view.xml +++ b/core/res/res/layout/keyguard_status_view.xml @@ -59,6 +59,7 @@ android:layout_height="wrap_content" android:layout_gravity="end" android:layout_marginTop="-16dp" + android:layout_marginBottom="24dp" android:layout_marginEnd="@dimen/kg_status_line_font_right_margin" android:singleLine="true" android:ellipsize="marquee" @@ -69,7 +70,7 @@ <TextView android:id="@+id/alarm_status" android:layout_gravity="end" - android:layout_marginTop="28dp" + android:layout_marginTop="4dp" android:layout_marginEnd="@dimen/kg_status_line_font_right_margin" android:singleLine="true" android:ellipsize="marquee" diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index ad3234a..16960c8 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -636,12 +636,19 @@ of new location providers at run-time. The new package does not have to be explicitly listed here, however it must have a signature that matches the signature of at least one package on this list. + Platforms should overlay additional packages in + config_overlay_locationProviderPackageNames, instead of overlaying + this config, if they only want to append packages and not replace + the entire array. --> <string-array name="config_locationProviderPackageNames" translatable="false"> - <!-- The standard AOSP fused location provider --> <item>com.android.location.fused</item> </string-array> + <!-- Pacakge name(s) supplied by overlay, and appended to + config_locationProviderPackageNames. --> + <string-array name="config_overlay_locationProviderPackageNames" translatable="false" /> + <!-- Boolean indicating if current platform supports bluetooth SCO for off call use cases --> <bool name="config_bluetooth_sco_off_call">true</bool> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 6eea65a..281d92a 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1467,6 +1467,7 @@ <java-symbol type="array" name="radioAttributes" /> <java-symbol type="array" name="config_oemUsbModeOverride" /> <java-symbol type="array" name="config_locationProviderPackageNames" /> + <java-symbol type="array" name="config_overlay_locationProviderPackageNames" /> <java-symbol type="bool" name="config_animateScreenLights" /> <java-symbol type="bool" name="config_automatic_brightness_available" /> <java-symbol type="bool" name="config_sf_limitedAlpha" /> diff --git a/data/etc/platform.xml b/data/etc/platform.xml index a19b9b4..13d1791 100644 --- a/data/etc/platform.xml +++ b/data/etc/platform.xml @@ -42,6 +42,10 @@ <group gid="net_bt" /> </permission> + <permission name="android.permission.BLUETOOTH_STACK" > + <group gid="net_bt_stack" /> + </permission> + <permission name="android.permission.NET_TUNNELING" > <group gid="vpn" /> </permission> @@ -176,6 +180,7 @@ <assign-permission name="android.permission.INTERACT_ACROSS_USERS" uid="shell" /> <assign-permission name="android.permission.INTERACT_ACROSS_USERS_FULL" uid="shell" /> <assign-permission name="android.permission.MANAGE_USERS" uid="shell" /> + <assign-permission name="android.permission.BLUETOOTH_STACK" uid="shell" /> <assign-permission name="android.permission.MODIFY_AUDIO_SETTINGS" uid="media" /> <assign-permission name="android.permission.ACCESS_DRM" uid="media" /> diff --git a/data/fonts/Roboto-Bold.ttf b/data/fonts/Roboto-Bold.ttf Binary files differindex b707456..40ecd14 100644 --- a/data/fonts/Roboto-Bold.ttf +++ b/data/fonts/Roboto-Bold.ttf diff --git a/data/fonts/Roboto-BoldItalic.ttf b/data/fonts/Roboto-BoldItalic.ttf Binary files differindex 43bc15b..d9067c5 100644 --- a/data/fonts/Roboto-BoldItalic.ttf +++ b/data/fonts/Roboto-BoldItalic.ttf diff --git a/data/fonts/Roboto-Italic.ttf b/data/fonts/Roboto-Italic.ttf Binary files differindex d9041db..88e4a5b 100644 --- a/data/fonts/Roboto-Italic.ttf +++ b/data/fonts/Roboto-Italic.ttf diff --git a/data/fonts/Roboto-Light.ttf b/data/fonts/Roboto-Light.ttf Binary files differindex 8224692..2ae4dec 100644 --- a/data/fonts/Roboto-Light.ttf +++ b/data/fonts/Roboto-Light.ttf diff --git a/data/fonts/Roboto-LightItalic.ttf b/data/fonts/Roboto-LightItalic.ttf Binary files differindex 979a8ef..44177ef 100644 --- a/data/fonts/Roboto-LightItalic.ttf +++ b/data/fonts/Roboto-LightItalic.ttf diff --git a/data/fonts/Roboto-Regular.ttf b/data/fonts/Roboto-Regular.ttf Binary files differindex cf9968f..f592adf 100644 --- a/data/fonts/Roboto-Regular.ttf +++ b/data/fonts/Roboto-Regular.ttf diff --git a/data/fonts/Roboto-Thin.ttf b/data/fonts/Roboto-Thin.ttf Binary files differindex 9f3b93c..5ae4d7f 100644 --- a/data/fonts/Roboto-Thin.ttf +++ b/data/fonts/Roboto-Thin.ttf diff --git a/data/fonts/Roboto-ThinItalic.ttf b/data/fonts/Roboto-ThinItalic.ttf Binary files differindex 9c53b16..9cd3927 100644 --- a/data/fonts/Roboto-ThinItalic.ttf +++ b/data/fonts/Roboto-ThinItalic.ttf diff --git a/data/fonts/RobotoCondensed-Bold.ttf b/data/fonts/RobotoCondensed-Bold.ttf Binary files differindex 7fd9dd8..21c10f5 100644 --- a/data/fonts/RobotoCondensed-Bold.ttf +++ b/data/fonts/RobotoCondensed-Bold.ttf diff --git a/data/fonts/RobotoCondensed-BoldItalic.ttf b/data/fonts/RobotoCondensed-BoldItalic.ttf Binary files differindex b0dba13..d8edd2d 100644 --- a/data/fonts/RobotoCondensed-BoldItalic.ttf +++ b/data/fonts/RobotoCondensed-BoldItalic.ttf diff --git a/data/fonts/RobotoCondensed-Italic.ttf b/data/fonts/RobotoCondensed-Italic.ttf Binary files differindex 48f02b5..4dec2cf 100644 --- a/data/fonts/RobotoCondensed-Italic.ttf +++ b/data/fonts/RobotoCondensed-Italic.ttf diff --git a/data/fonts/RobotoCondensed-Regular.ttf b/data/fonts/RobotoCondensed-Regular.ttf Binary files differindex d7254f4..875ea1a 100644 --- a/data/fonts/RobotoCondensed-Regular.ttf +++ b/data/fonts/RobotoCondensed-Regular.ttf diff --git a/packages/FusedLocation/AndroidManifest.xml b/packages/FusedLocation/AndroidManifest.xml index 7df4b72..4c57401 100644 --- a/packages/FusedLocation/AndroidManifest.xml +++ b/packages/FusedLocation/AndroidManifest.xml @@ -39,7 +39,7 @@ <intent-filter> <action android:name="com.android.location.service.FusedLocationProvider" /> </intent-filter> - <meta-data android:name="serviceVersion" android:value="1" /> + <meta-data android:name="version" android:value="1" /> </service> </application> </manifest> diff --git a/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java b/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java index c62c0d7..2cf795d 100644 --- a/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java +++ b/packages/FusedLocation/src/com/android/location/fused/FusionEngine.java @@ -247,7 +247,7 @@ public class FusionEngine implements LocationListener { mNetworkWeight /= totalWeight; mGpsWeight /= totalWeight; - Location fused = new Location(/* LocationManager.FUSED_PROVIDER */ "fused"); + Location fused = new Location(LocationManager.FUSED_PROVIDER); // fuse lat/long // assumes the two locations are close enough that earth curvature doesn't matter fused.setLatitude(weigh(mGpsLocation.getLatitude(), mNetworkLocation.getLatitude())); @@ -303,12 +303,7 @@ public class FusionEngine implements LocationListener { } if (mNetworkLocation != null) { - // Manually set the extras for the "no gps" location, pointing at the NLP - Bundle extras = new Bundle(); - extras.putParcelable("noGPSLocation", mNetworkLocation); - fused.setExtras(extras); - // Done inline above to compile against SDK 17 - //fused.setExtraLocation(Location.EXTRA_NO_GPS_LOCATION, mNetworkLocation); + fused.setExtraLocation(Location.EXTRA_NO_GPS_LOCATION, mNetworkLocation); } mFusedLocation = fused; diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml index ab8e961..9e137ce 100644 --- a/packages/SettingsProvider/res/values/defaults.xml +++ b/packages/SettingsProvider/res/values/defaults.xml @@ -174,4 +174,7 @@ <bool name="def_screensaver_activate_on_sleep">false</bool> <!-- ComponentName of the default screen saver (Settings.Secure.SCREENSAVER_COMPONENT) --> <string name="def_screensaver_component">com.google.android.deskclock/com.android.deskclock.Screensaver</string> + + <!-- Default for Settings.Secure.USER_SETUP_COMPLETE --> + <bool name="def_user_setup_complete">false</bool> </resources> diff --git a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java index a9869d9..0b61abe 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java @@ -68,7 +68,7 @@ public class DatabaseHelper extends SQLiteOpenHelper { // database gets upgraded properly. At a minimum, please confirm that 'upgradeVersion' // is properly propagated through your change. Not doing so will result in a loss of user // settings. - private static final int DATABASE_VERSION = 92; + private static final int DATABASE_VERSION = 93; private Context mContext; private int mUserHandle; @@ -1449,6 +1449,30 @@ public class DatabaseHelper extends SQLiteOpenHelper { upgradeVersion = 92; } + if (upgradeVersion == 92) { + SQLiteStatement stmt = null; + try { + stmt = db.compileStatement("INSERT OR IGNORE INTO secure(name,value)" + + " VALUES(?,?);"); + if (mUserHandle == UserHandle.USER_OWNER) { + // consider existing primary users to have made it through user setup + // if the globally-scoped device-provisioned bit is set + // (indicating they already made it through setup as primary) + int deviceProvisioned = getIntValueFromTable(db, TABLE_GLOBAL, + Settings.Global.DEVICE_PROVISIONED, 0); + loadSetting(stmt, Settings.Secure.USER_SETUP_COMPLETE, + deviceProvisioned); + } else { + // otherwise use the default + loadBooleanSetting(stmt, Settings.Secure.USER_SETUP_COMPLETE, + R.bool.def_user_setup_complete); + } + } finally { + if (stmt != null) stmt.close(); + } + upgradeVersion = 93; + } + // *** Remember to update DATABASE_VERSION above! if (upgradeVersion != currentVersion) { @@ -2016,6 +2040,9 @@ public class DatabaseHelper extends SQLiteOpenHelper { loadBooleanSetting(stmt, Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE, R.bool.def_accessibility_display_magnification_auto_update); + + loadBooleanSetting(stmt, Settings.Secure.USER_SETUP_COMPLETE, + R.bool.def_user_setup_complete); } finally { if (stmt != null) stmt.close(); } diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 76a5022..8086bbc 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -556,59 +556,52 @@ public class SettingsProvider extends ContentProvider { } } - // Okay, permission checks have cleared. Reset to our own identity so we can - // manipulate all users' data with impunity. - long oldId = Binder.clearCallingIdentity(); - try { - // Note: we assume that get/put operations for moved-to-global names have already - // been directed to the new location on the caller side (otherwise we'd fix them - // up here). - DatabaseHelper dbHelper; - SettingsCache cache; - - // Get methods - if (Settings.CALL_METHOD_GET_SYSTEM.equals(method)) { - if (LOCAL_LOGV) Slog.v(TAG, "call(system:" + request + ") for " + callingUser); - dbHelper = getOrEstablishDatabase(callingUser); - cache = sSystemCaches.get(callingUser); - return lookupValue(dbHelper, TABLE_SYSTEM, cache, request); - } - if (Settings.CALL_METHOD_GET_SECURE.equals(method)) { - if (LOCAL_LOGV) Slog.v(TAG, "call(secure:" + request + ") for " + callingUser); - dbHelper = getOrEstablishDatabase(callingUser); - cache = sSecureCaches.get(callingUser); - return lookupValue(dbHelper, TABLE_SECURE, cache, request); - } - if (Settings.CALL_METHOD_GET_GLOBAL.equals(method)) { - if (LOCAL_LOGV) Slog.v(TAG, "call(global:" + request + ") for " + callingUser); - // fast path: owner db & cache are immutable after onCreate() so we need not - // guard on the attempt to look them up - return lookupValue(getOrEstablishDatabase(UserHandle.USER_OWNER), TABLE_GLOBAL, - sGlobalCache, request); - } + // Note: we assume that get/put operations for moved-to-global names have already + // been directed to the new location on the caller side (otherwise we'd fix them + // up here). + DatabaseHelper dbHelper; + SettingsCache cache; + + // Get methods + if (Settings.CALL_METHOD_GET_SYSTEM.equals(method)) { + if (LOCAL_LOGV) Slog.v(TAG, "call(system:" + request + ") for " + callingUser); + dbHelper = getOrEstablishDatabase(callingUser); + cache = sSystemCaches.get(callingUser); + return lookupValue(dbHelper, TABLE_SYSTEM, cache, request); + } + if (Settings.CALL_METHOD_GET_SECURE.equals(method)) { + if (LOCAL_LOGV) Slog.v(TAG, "call(secure:" + request + ") for " + callingUser); + dbHelper = getOrEstablishDatabase(callingUser); + cache = sSecureCaches.get(callingUser); + return lookupValue(dbHelper, TABLE_SECURE, cache, request); + } + if (Settings.CALL_METHOD_GET_GLOBAL.equals(method)) { + if (LOCAL_LOGV) Slog.v(TAG, "call(global:" + request + ") for " + callingUser); + // fast path: owner db & cache are immutable after onCreate() so we need not + // guard on the attempt to look them up + return lookupValue(getOrEstablishDatabase(UserHandle.USER_OWNER), TABLE_GLOBAL, + sGlobalCache, request); + } - // Put methods - new value is in the args bundle under the key named by - // the Settings.NameValueTable.VALUE static. - final String newValue = (args == null) - ? null : args.getString(Settings.NameValueTable.VALUE); - - final ContentValues values = new ContentValues(); - values.put(Settings.NameValueTable.NAME, request); - values.put(Settings.NameValueTable.VALUE, newValue); - if (Settings.CALL_METHOD_PUT_SYSTEM.equals(method)) { - if (LOCAL_LOGV) Slog.v(TAG, "call_put(system:" + request + "=" + newValue + ") for " + callingUser); - insertForUser(Settings.System.CONTENT_URI, values, callingUser); - } else if (Settings.CALL_METHOD_PUT_SECURE.equals(method)) { - if (LOCAL_LOGV) Slog.v(TAG, "call_put(secure:" + request + "=" + newValue + ") for " + callingUser); - insertForUser(Settings.Secure.CONTENT_URI, values, callingUser); - } else if (Settings.CALL_METHOD_PUT_GLOBAL.equals(method)) { - if (LOCAL_LOGV) Slog.v(TAG, "call_put(global:" + request + "=" + newValue + ") for " + callingUser); - insertForUser(Settings.Global.CONTENT_URI, values, callingUser); - } else { - Slog.w(TAG, "call() with invalid method: " + method); - } - } finally { - Binder.restoreCallingIdentity(oldId); + // Put methods - new value is in the args bundle under the key named by + // the Settings.NameValueTable.VALUE static. + final String newValue = (args == null) + ? null : args.getString(Settings.NameValueTable.VALUE); + + final ContentValues values = new ContentValues(); + values.put(Settings.NameValueTable.NAME, request); + values.put(Settings.NameValueTable.VALUE, newValue); + if (Settings.CALL_METHOD_PUT_SYSTEM.equals(method)) { + if (LOCAL_LOGV) Slog.v(TAG, "call_put(system:" + request + "=" + newValue + ") for " + callingUser); + insertForUser(Settings.System.CONTENT_URI, values, callingUser); + } else if (Settings.CALL_METHOD_PUT_SECURE.equals(method)) { + if (LOCAL_LOGV) Slog.v(TAG, "call_put(secure:" + request + "=" + newValue + ") for " + callingUser); + insertForUser(Settings.Secure.CONTENT_URI, values, callingUser); + } else if (Settings.CALL_METHOD_PUT_GLOBAL.equals(method)) { + if (LOCAL_LOGV) Slog.v(TAG, "call_put(global:" + request + "=" + newValue + ") for " + callingUser); + insertForUser(Settings.Global.CONTENT_URI, values, callingUser); + } else { + Slog.w(TAG, "call() with invalid method: " + method); } return null; diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_clock_hour.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_clock_hour.png Binary files differindex 045a3d1..ca73621 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_qs_clock_hour.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_qs_clock_hour.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_qs_clock_minute.png b/packages/SystemUI/res/drawable-hdpi/ic_qs_clock_minute.png Binary files differindex eef78c1..8ee38ee 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_qs_clock_minute.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_qs_clock_minute.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_clock_hour.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_clock_hour.png Binary files differindex ee887e9..f7f8c42 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_qs_clock_hour.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_qs_clock_hour.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_qs_clock_minute.png b/packages/SystemUI/res/drawable-mdpi/ic_qs_clock_minute.png Binary files differindex 12e7818..fb17e5a 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_qs_clock_minute.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_qs_clock_minute.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_clock_hour.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_clock_hour.png Binary files differindex d1d29dc..02c4a05 100644 --- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_clock_hour.png +++ b/packages/SystemUI/res/drawable-xhdpi/ic_qs_clock_hour.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_qs_clock_minute.png b/packages/SystemUI/res/drawable-xhdpi/ic_qs_clock_minute.png Binary files differindex bb0c17c..aa6be72 100644 --- a/packages/SystemUI/res/drawable-xhdpi/ic_qs_clock_minute.png +++ b/packages/SystemUI/res/drawable-xhdpi/ic_qs_clock_minute.png diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java index 4962199..6ae09b0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelBar.java @@ -160,7 +160,7 @@ public class PanelBar extends FrameLayout { } } if (DEBUG) LOG("collapseAllPanels: animate=%s waiting=%s", animate, waiting); - if (!waiting) { + if (!waiting && mState != STATE_CLOSED) { // it's possible that nothing animated, so we replicate the termination // conditions of panelExpansionChanged here go(STATE_CLOSED); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 362bb1c..a8a92ec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -105,7 +105,7 @@ public class PanelView extends FrameLayout { mTimeAnimator = new TimeAnimator(); mTimeAnimator.setTimeListener(mAnimationCallback); - mPeekAnimator.cancel(); + if (mPeekAnimator != null) mPeekAnimator.cancel(); mTimeAnimator.start(); @@ -261,7 +261,7 @@ public class PanelView extends FrameLayout { case MotionEvent.ACTION_MOVE: final float h = rawY - mAbsPos[1] - mTouchOffset; if (h > mPeekHeight) { - if (mPeekAnimator.isRunning()) { + if (mPeekAnimator != null && mPeekAnimator.isRunning()) { mPeekAnimator.cancel(); } mJustPeeked = false; @@ -385,7 +385,7 @@ public class PanelView extends FrameLayout { public void setExpandedHeight(float height) { if (DEBUG) LOG("setExpandedHeight(%.1f)", height); - mTracking = mRubberbanding = false; + mRubberbanding = false; if (mTimeAnimator.isRunning()) { post(mStopAnimator); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index e587422..3aa81ea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1269,8 +1269,8 @@ public class PhoneStatusBar extends BaseStatusBar { return; } - // Ensure the panel is fully collapsed (just in case; bug 6765842) - // @@@ mStatusBarView.collapseAllPanels(/*animate=*/ false); + // Ensure the panel is fully collapsed (just in case; bug 6765842, 7260868) + mStatusBarView.collapseAllPanels(/*animate=*/ false); mExpandedVisible = false; mPile.setLayoutTransitionsEnabled(false); diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java index 4f2545f..a4e8ea4 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPasswordView.java @@ -54,7 +54,7 @@ import com.android.internal.widget.PasswordEntryKeyboardHelper; */ public class KeyguardPasswordView extends LinearLayout - implements KeyguardSecurityView, OnEditorActionListener { + implements KeyguardSecurityView, OnEditorActionListener, TextWatcher { private KeyguardSecurityCallback mCallback; private EditText mPasswordEntry; private LockPatternUtils mLockPatternUtils; @@ -121,6 +121,7 @@ public class KeyguardPasswordView extends LinearLayout mKeyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard); mPasswordEntry = (EditText) findViewById(R.id.passwordEntry); mPasswordEntry.setOnEditorActionListener(this); + mPasswordEntry.addTextChangedListener(this); mKeyboardHelper = new PasswordEntryKeyboardHelper(mContext, mKeyboardView, this, false, new int[] { @@ -351,5 +352,20 @@ public class KeyguardPasswordView extends LinearLayout return mCallback; } + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + if (mCallback != null) { + mCallback.userActivity(KeyguardViewManager.DIGIT_PRESS_WAKE_MILLIS); + } + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + + @Override + public void afterTextChanged(Editable s) { + } + } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java index f913519..5a9ffcf 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPinView.java @@ -30,6 +30,8 @@ import com.android.internal.widget.PasswordEntryKeyboardHelper; import com.android.internal.widget.PasswordEntryKeyboardView; import com.android.internal.R; +import android.text.Editable; +import android.text.TextWatcher; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.MotionEvent; @@ -45,9 +47,7 @@ import android.widget.TextView.OnEditorActionListener; * Displays a dialer like interface to unlock the SIM PIN. */ public class KeyguardSimPinView extends LinearLayout - implements KeyguardSecurityView, OnEditorActionListener { - - private static final int DIGIT_PRESS_WAKE_MILLIS = 5000; + implements KeyguardSecurityView, OnEditorActionListener, TextWatcher { private EditText mPinEntry; private ProgressDialog mSimUnlockProgressDialog = null; @@ -80,6 +80,7 @@ public class KeyguardSimPinView extends LinearLayout mPinEntry = (EditText) findViewById(R.id.sim_pin_entry); mPinEntry.setOnEditorActionListener(this); + mPinEntry.addTextChangedListener(this); mKeyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard); mKeyboardHelper = new PasswordEntryKeyboardHelper(mContext, mKeyboardView, this, false, @@ -163,7 +164,7 @@ public class KeyguardSimPinView extends LinearLayout public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { // Check if this was the result of hitting the enter key - mCallback.userActivity(DIGIT_PRESS_WAKE_MILLIS); + mCallback.userActivity(KeyguardViewManager.DIGIT_PRESS_WAKE_MILLIS); if (event.getAction() == MotionEvent.ACTION_DOWN && ( actionId == EditorInfo.IME_NULL || actionId == EditorInfo.IME_ACTION_DONE @@ -247,4 +248,19 @@ public class KeyguardSimPinView extends LinearLayout return mCallback; } + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + if (mCallback != null) { + mCallback.userActivity(KeyguardViewManager.DIGIT_PRESS_WAKE_MILLIS); + } + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + + @Override + public void afterTextChanged(Editable s) { + } + } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java index 2015826..2cdb52d 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSimPukView.java @@ -23,6 +23,7 @@ import android.graphics.Rect; import android.os.RemoteException; import android.os.ServiceManager; import android.text.Editable; +import android.text.TextWatcher; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.MotionEvent; @@ -40,9 +41,7 @@ import com.android.internal.widget.PasswordEntryKeyboardView; import com.android.internal.R; public class KeyguardSimPukView extends LinearLayout implements View.OnClickListener, - KeyguardSecurityView, OnEditorActionListener { - - private static final int DIGIT_PRESS_WAKE_MILLIS = 5000; + KeyguardSecurityView, OnEditorActionListener, TextWatcher { private View mDeleteButton; @@ -135,6 +134,7 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList mSimPinEntry = (TextView) findViewById(R.id.sim_pin_entry); mSimPinEntry.setOnEditorActionListener(this); + mSimPinEntry.addTextChangedListener(this); mDeleteButton = findViewById(R.id.delete_button); mDeleteButton.setOnClickListener(this); mKeyboardView = (PasswordEntryKeyboardView) findViewById(R.id.keyboard); @@ -222,7 +222,7 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList digits.delete(len-1, len); } } - mCallback.userActivity(DIGIT_PRESS_WAKE_MILLIS); + mCallback.userActivity(KeyguardViewManager.DIGIT_PRESS_WAKE_MILLIS); } private Dialog getSimUnlockProgressDialog() { @@ -292,7 +292,7 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList @Override public boolean onEditorAction(TextView view, int actionId, KeyEvent event) { // Check if this was the result of hitting the enter key - mCallback.userActivity(DIGIT_PRESS_WAKE_MILLIS); + mCallback.userActivity(KeyguardViewManager.DIGIT_PRESS_WAKE_MILLIS); if (event.getAction() == MotionEvent.ACTION_DOWN) { if (actionId == EditorInfo.IME_NULL || actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) { @@ -318,4 +318,19 @@ public class KeyguardSimPukView extends LinearLayout implements View.OnClickList return mCallback; } + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + if (mCallback != null) { + mCallback.userActivity(KeyguardViewManager.DIGIT_PRESS_WAKE_MILLIS); + } + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + + @Override + public void afterTextChanged(Editable s) { + } + } diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java index 69b85c3..fd52575 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java @@ -52,6 +52,9 @@ public class KeyguardViewManager { private static String TAG = "KeyguardViewManager"; public static boolean USE_UPPER_CASE = true; + // Timeout used for keypresses + static final int DIGIT_PRESS_WAKE_MILLIS = 5000; + private final Context mContext; private final ViewManager mViewManager; private final KeyguardViewMediator.ViewMediatorCallback mViewMediatorCallback; diff --git a/services/java/com/android/server/BluetoothManagerService.java b/services/java/com/android/server/BluetoothManagerService.java index ce75e35..e7cd279 100755 --- a/services/java/com/android/server/BluetoothManagerService.java +++ b/services/java/com/android/server/BluetoothManagerService.java @@ -481,7 +481,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mHandler.sendMessageDelayed(timeoutMsg,TIMEOUT_BIND_MS); Intent i = new Intent(IBluetooth.class.getName()); if (!mContext.bindService(i, mConnection, - Context.BIND_AUTO_CREATE)) { + Context.BIND_AUTO_CREATE, UserHandle.USER_CURRENT)) { mHandler.removeMessages(MESSAGE_TIMEOUT_BIND); Log.e(TAG, "fail to bind to: " + IBluetooth.class.getName()); } @@ -717,7 +717,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mHandler.sendMessageDelayed(timeoutMsg,TIMEOUT_BIND_MS); mConnection.setGetNameAddressOnly(false); Intent i = new Intent(IBluetooth.class.getName()); - if (!mContext.bindService(i, mConnection,Context.BIND_AUTO_CREATE)) { + if (!mContext.bindService(i, mConnection, Context.BIND_AUTO_CREATE, + UserHandle.USER_CURRENT)) { mHandler.removeMessages(MESSAGE_TIMEOUT_BIND); Log.e(TAG, "Fail to bind to: " + IBluetooth.class.getName()); } diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index dfe7ca9..0087b57 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -275,10 +275,14 @@ public class LocationManagerService extends ILocationManager.Stub implements Run */ Resources resources = mContext.getResources(); ArrayList<String> providerPackageNames = new ArrayList<String>(); - String[] pkgs = resources.getStringArray( + String[] pkgs1 = resources.getStringArray( com.android.internal.R.array.config_locationProviderPackageNames); - if (D) Log.d(TAG, "built-in location providers: " + Arrays.toString(pkgs)); - if (pkgs != null) providerPackageNames.addAll(Arrays.asList(pkgs)); + String[] pkgs2 = resources.getStringArray( + com.android.internal.R.array.config_overlay_locationProviderPackageNames); + if (D) Log.d(TAG, "built-in location providers: " + Arrays.toString(pkgs1)); + if (D) Log.d(TAG, "overlay location providers: " + Arrays.toString(pkgs2)); + if (pkgs1 != null) providerPackageNames.addAll(Arrays.asList(pkgs1)); + if (pkgs2 != null) providerPackageNames.addAll(Arrays.asList(pkgs2)); // bind to network provider LocationProviderProxy networkProvider = LocationProviderProxy.createAndBind( diff --git a/services/java/com/android/server/ServiceWatcher.java b/services/java/com/android/server/ServiceWatcher.java index 299c675..e99949b 100644 --- a/services/java/com/android/server/ServiceWatcher.java +++ b/services/java/com/android/server/ServiceWatcher.java @@ -42,7 +42,7 @@ import java.util.List; */ public class ServiceWatcher implements ServiceConnection { private static final boolean D = false; - private static final String EXTRA_SERVICE_VERSION = "serviceVersion"; + private static final String EXTRA_VERSION = "version"; private final String mTag; private final Context mContext; @@ -127,7 +127,7 @@ public class ServiceWatcher implements ServiceConnection { // check version int version = 0; if (rInfo.serviceInfo.metaData != null) { - version = rInfo.serviceInfo.metaData.getInt(EXTRA_SERVICE_VERSION, 0); + version = rInfo.serviceInfo.metaData.getInt(EXTRA_VERSION, 0); } if (version > mVersion) { bestVersion = version; diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java index 98f561c..e0f3814 100644 --- a/services/java/com/android/server/WallpaperManagerService.java +++ b/services/java/com/android/server/WallpaperManagerService.java @@ -99,6 +99,13 @@ class WallpaperManagerService extends IWallpaperManager.Stub { static final String WALLPAPER_INFO = "wallpaper_info.xml"; /** + * Name of the component used to display bitmap wallpapers from either the gallery or + * built-in wallpapers. + */ + static final ComponentName IMAGE_WALLPAPER = new ComponentName("com.android.systemui", + "com.android.systemui.ImageWallpaper"); + + /** * Observes the wallpaper for changes and notifies all IWallpaperServiceCallbacks * that the wallpaper has changed. The CREATE is triggered when there is no * wallpaper set and is created for the first time. The CLOSE_WRITE is triggered @@ -138,7 +145,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub { if (event == CLOSE_WRITE) { mWallpaper.imageWallpaperPending = false; } - bindWallpaperComponentLocked(mWallpaper.imageWallpaperComponent, true, + bindWallpaperComponentLocked(IMAGE_WALLPAPER, true, false, mWallpaper, null); saveSettingsLocked(mWallpaper); } @@ -183,13 +190,6 @@ class WallpaperManagerService extends IWallpaperManager.Stub { */ ComponentName nextWallpaperComponent; - /** - * Name of the component used to display bitmap wallpapers from either the gallery or - * built-in wallpapers. - */ - ComponentName imageWallpaperComponent = new ComponentName("com.android.systemui", - "com.android.systemui.ImageWallpaper"); - WallpaperConnection connection; long lastDiedTime; boolean wallpaperUpdating; @@ -559,7 +559,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub { wallpaper.imageWallpaperPending = false; if (userId != mCurrentUserId) return; if (bindWallpaperComponentLocked(defaultFailed - ? wallpaper.imageWallpaperComponent + ? IMAGE_WALLPAPER : null, true, false, wallpaper, reply)) { return; } @@ -792,7 +792,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub { } if (componentName == null) { // Fall back to static image wallpaper - componentName = wallpaper.imageWallpaperComponent; + componentName = IMAGE_WALLPAPER; //clearWallpaperComponentLocked(); //return; if (DEBUG) Slog.v(TAG, "Using image wallpaper"); @@ -815,7 +815,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub { WallpaperInfo wi = null; Intent intent = new Intent(WallpaperService.SERVICE_INTERFACE); - if (componentName != null && !componentName.equals(wallpaper.imageWallpaperComponent)) { + if (componentName != null && !componentName.equals(IMAGE_WALLPAPER)) { // Make sure the selected service is actually a wallpaper service. List<ResolveInfo> ris = mIPackageManager.queryIntentServices(intent, @@ -990,7 +990,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub { out.attribute(null, "height", Integer.toString(wallpaper.height)); out.attribute(null, "name", wallpaper.name); if (wallpaper.wallpaperComponent != null - && !wallpaper.wallpaperComponent.equals(wallpaper.imageWallpaperComponent)) { + && !wallpaper.wallpaperComponent.equals(IMAGE_WALLPAPER)) { out.attribute(null, "component", wallpaper.wallpaperComponent.flattenToShortString()); } @@ -1062,7 +1062,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub { if (wallpaper.nextWallpaperComponent == null || "android".equals(wallpaper.nextWallpaperComponent .getPackageName())) { - wallpaper.nextWallpaperComponent = wallpaper.imageWallpaperComponent; + wallpaper.nextWallpaperComponent = IMAGE_WALLPAPER; } if (DEBUG) { @@ -1124,7 +1124,7 @@ class WallpaperManagerService extends IWallpaperManager.Stub { loadSettingsLocked(0); wallpaper = mWallpaperMap.get(0); if (wallpaper.nextWallpaperComponent != null - && !wallpaper.nextWallpaperComponent.equals(wallpaper.imageWallpaperComponent)) { + && !wallpaper.nextWallpaperComponent.equals(IMAGE_WALLPAPER)) { if (!bindWallpaperComponentLocked(wallpaper.nextWallpaperComponent, false, false, wallpaper, null)) { // No such live wallpaper or other failure; fall back to the default |
