diff options
Diffstat (limited to 'services/java/com/android')
10 files changed, 131 insertions, 41 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 0f2bb20..ec58e43 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -745,6 +745,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub // set the current ime to the proper one. resetDefaultImeLocked(mContext); } + } else { + // If the locale is changed, needs to reset the default ime + resetDefaultImeLocked(mContext); } updateFromSettingsLocked(); mLastSystemLocale = newLocale; diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java index b567992..87b0eb3 100644 --- a/services/java/com/android/server/StatusBarManagerService.java +++ b/services/java/com/android/server/StatusBarManagerService.java @@ -117,45 +117,34 @@ public class StatusBarManagerService extends IStatusBarService.Stub // ================================================================================ // From IStatusBarService // ================================================================================ - public void expandNotifications() { + public void expandNotificationsPanel() { enforceExpandStatusBar(); if (mBar != null) { try { - mBar.animateExpandNotifications(); + mBar.animateExpandNotificationsPanel(); } catch (RemoteException ex) { } } } - public void collapseNotifications() { + public void collapsePanels() { enforceExpandStatusBar(); if (mBar != null) { try { - mBar.animateCollapseNotifications(); + mBar.animateCollapsePanels(); } catch (RemoteException ex) { } } } - public void expandQuickSettings() { + public void expandSettingsPanel() { enforceExpandStatusBar(); if (mBar != null) { try { - mBar.animateExpandQuickSettings(); - } catch (RemoteException ex) { - } - } - } - - public void collapseQuickSettings() { - enforceExpandStatusBar(); - - if (mBar != null) { - try { - mBar.animateCollapseQuickSettings(); + mBar.animateExpandSettingsPanel(); } catch (RemoteException ex) { } } @@ -620,8 +609,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub String action = intent.getAction(); if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action) || Intent.ACTION_SCREEN_OFF.equals(action)) { - collapseNotifications(); - collapseQuickSettings(); + collapsePanels(); } /* else if (Telephony.Intents.SPN_STRINGS_UPDATED_ACTION.equals(action)) { diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index cae67e9..2f57eb0 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -827,7 +827,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private void tryAddServiceLocked(Service service, int userId) { try { UserState userState = getUserStateLocked(userId); - if (userState.mServices.contains(service) || !service.isConfigured()) { + if (userState.mServices.contains(service)) { return; } service.linkToOwnDeath(); @@ -876,7 +876,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private boolean canDispathEventLocked(Service service, AccessibilityEvent event, int handledFeedbackTypes) { - if (!service.isConfigured()) { + if (!service.canReceiveEvents()) { return false; } @@ -1192,7 +1192,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private void tryEnableTouchExplorationLocked(final Service service) { UserState userState = getUserStateLocked(service.mUserId); - if (!userState.mIsTouchExplorationEnabled && service.mRequestTouchExplorationMode) { + if (!userState.mIsTouchExplorationEnabled && service.mRequestTouchExplorationMode + && service.canReceiveEvents()) { final boolean canToggleTouchExploration = userState.mTouchExplorationGrantedServices.contains(service.mComponentName); if (!service.mIsAutomation && !canToggleTouchExploration) { @@ -1205,6 +1206,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } private void tryDisableTouchExplorationLocked(Service service) { + if (!service.canReceiveEvents()) { + return; + } UserState userState = getUserStateLocked(service.mUserId); if (userState.mIsTouchExplorationEnabled) { final int serviceCount = userState.mServices.size(); @@ -1464,7 +1468,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { // If this service is up and running we may have to enable touch // exploration, otherwise this will happen when the service connects. synchronized (mLock) { - if (isConfigured()) { + if (canReceiveEvents()) { if (mRequestTouchExplorationMode) { tryEnableTouchExplorationLocked(this); } else { @@ -1505,13 +1509,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { return false; } - /** - * Returns if the service is configured i.e. at least event types of interest - * and feedback type must be set. - * - * @return True if the service is configured, false otherwise. - */ - public boolean isConfigured() { + public boolean canReceiveEvents() { return (mEventTypes != 0 && mFeedbackType != 0 && mService != null); } @@ -2028,7 +2026,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { StatusBarManager statusBarManager = (StatusBarManager) mContext.getSystemService( android.app.Service.STATUS_BAR_SERVICE); - statusBarManager.expandNotifications(); + statusBarManager.expandNotificationsPanel(); Binder.restoreCallingIdentity(token); } @@ -2038,7 +2036,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { StatusBarManager statusBarManager = (StatusBarManager) mContext.getSystemService( android.app.Service.STATUS_BAR_SERVICE); - statusBarManager.expandQuickSettings(); + statusBarManager.expandSettingsPanel(); Binder.restoreCallingIdentity(token); } diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java index 921bed7..3e9bef0 100644 --- a/services/java/com/android/server/accessibility/TouchExplorer.java +++ b/services/java/com/android/server/accessibility/TouchExplorer.java @@ -102,6 +102,10 @@ class TouchExplorer implements EventStreamTransformation { // The timeout after which we are no longer trying to detect a gesture. private static final int EXIT_GESTURE_DETECTION_TIMEOUT = 2000; + // The timeout to send interaction end events in case we did not + // receive the expected hover exit event due to a misbehaving app. + private static final int SEND_INTERACTION_END_EVENTS_TIMEOUT = 200; + // Temporary array for storing pointer IDs. private final int[] mTempPointerIds = new int[MAX_POINTER_COUNT]; @@ -135,6 +139,9 @@ class TouchExplorer implements EventStreamTransformation { // Command for delayed sending of a hover exit event. private final SendHoverDelayed mSendHoverExitDelayed; + // Command for delayed sending of interaction ending events. + private final SendInteractionEndEventsDelayed mSendInteractionEndEventsDelayed; + // Command for delayed sending of a long press. private final PerformLongPressDelayed mPerformLongPressDelayed; @@ -233,6 +240,7 @@ class TouchExplorer implements EventStreamTransformation { mGestureLibrary.load(); mSendHoverEnterDelayed = new SendHoverDelayed(MotionEvent.ACTION_HOVER_ENTER, true); mSendHoverExitDelayed = new SendHoverDelayed(MotionEvent.ACTION_HOVER_EXIT, false); + mSendInteractionEndEventsDelayed = new SendInteractionEndEventsDelayed(); mDoubleTapDetector = new DoubleTapDetector(); final float density = context.getResources().getDisplayMetrics().density; mScaledMinPointerDistanceToUseMiddleLocation = @@ -278,6 +286,7 @@ class TouchExplorer implements EventStreamTransformation { mSendHoverExitDelayed.remove(); mPerformLongPressDelayed.remove(); mExitGestureDetectionModeDelayed.remove(); + mSendInteractionEndEventsDelayed.remove(); // Reset the pointer trackers. mReceivedPointerTracker.clear(); mInjectedPointerTracker.clear(); @@ -334,6 +343,7 @@ class TouchExplorer implements EventStreamTransformation { // last hover exit event. if (mTouchExplorationGestureEnded && eventType == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT) { + mSendInteractionEndEventsDelayed.remove(); mTouchExplorationGestureEnded = false; sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END); } @@ -342,6 +352,7 @@ class TouchExplorer implements EventStreamTransformation { // last hover exit and the touch exploration gesture end events. if (mTouchInteractionEnded && eventType == AccessibilityEvent.TYPE_VIEW_HOVER_EXIT) { + mSendInteractionEndEventsDelayed.remove(); mTouchInteractionEnded = false; sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); } @@ -416,6 +427,10 @@ class TouchExplorer implements EventStreamTransformation { mSendHoverExitDelayed.remove(); } + if (mSendInteractionEndEventsDelayed.isPending()) { + mSendInteractionEndEventsDelayed.forceSendAndRemove(); + } + mPerformLongPressDelayed.remove(); // If we have the first tap schedule a long press and break @@ -873,6 +888,9 @@ class TouchExplorer implements EventStreamTransformation { final int pointerIdBits = event.getPointerIdBits(); mTouchExplorationGestureEnded = true; mTouchInteractionEnded = true; + if (!mSendInteractionEndEventsDelayed.isPending()) { + mSendInteractionEndEventsDelayed.post(); + } sendMotionEvent(event, MotionEvent.ACTION_HOVER_EXIT, pointerIdBits, policyFlags); } } @@ -1300,6 +1318,11 @@ class TouchExplorer implements EventStreamTransformation { @Override public void run() { + // Announce the end of gesture recognition. + sendAccessibilityEvent(AccessibilityEvent.TYPE_GESTURE_DETECTION_END); + // Clearing puts is in touch exploration state with a finger already + // down, so announce the transition to exploration state. + sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START); clear(); } } @@ -1479,10 +1502,16 @@ class TouchExplorer implements EventStreamTransformation { } else { mTouchExplorationGestureEnded = true; mTouchInteractionEnded = true; + if (!mSendInteractionEndEventsDelayed.isPending()) { + mSendInteractionEndEventsDelayed.post(); + } } } else { if (!mGestureStarted) { mTouchInteractionEnded = true; + if (!mSendInteractionEndEventsDelayed.isPending()) { + mSendInteractionEndEventsDelayed.post(); + } } } sendMotionEvent(mPrototype, mHoverAction, mPointerIdBits, mPolicyFlags); @@ -1490,6 +1519,40 @@ class TouchExplorer implements EventStreamTransformation { } } + private class SendInteractionEndEventsDelayed implements Runnable { + + public void remove() { + mHandler.removeCallbacks(this); + } + + public void post() { + mHandler.postDelayed(this, SEND_INTERACTION_END_EVENTS_TIMEOUT); + } + + public boolean isPending() { + return mHandler.hasCallbacks(this); + } + + public void forceSendAndRemove() { + if (isPending()) { + run(); + remove(); + } + } + + @Override + public void run() { + if (mTouchExplorationGestureEnded) { + mTouchExplorationGestureEnded = false; + sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END); + } + if (mTouchInteractionEnded) { + mTouchInteractionEnded = false; + sendAccessibilityEvent(AccessibilityEvent.TYPE_TOUCH_INTERACTION_END); + } + } + } + @Override public String toString() { return LOG_TAG; diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 2db0f97..3428326 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -14106,6 +14106,7 @@ public final class ActivityManagerService extends ActivityManagerNative return false; } + mWindowManager.lockNow(); mWindowManager.startFreezingScreen(R.anim.screen_user_exit, R.anim.screen_user_enter); diff --git a/services/java/com/android/server/dreams/DreamController.java b/services/java/com/android/server/dreams/DreamController.java index 81c80187..c01a45d 100644 --- a/services/java/com/android/server/dreams/DreamController.java +++ b/services/java/com/android/server/dreams/DreamController.java @@ -53,6 +53,8 @@ final class DreamController { private final Intent mDreamingStoppedIntent = new Intent(Dream.ACTION_DREAMING_STOPPED) .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); + private final Intent mCloseNotificationShadeIntent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS); + private DreamRecord mCurrentDream; public DreamController(Context context, Handler handler, Listener listener) { @@ -81,6 +83,9 @@ final class DreamController { public void startDream(Binder token, ComponentName name, boolean isTest, int userId) { stopDream(); + // Close the notification shade + mContext.sendBroadcast(mCloseNotificationShadeIntent); + Slog.i(TAG, "Starting dream: name=" + name + ", isTest=" + isTest + ", userId=" + userId); mCurrentDream = new DreamRecord(token, name, isTest, userId); diff --git a/services/java/com/android/server/input/InputManagerService.java b/services/java/com/android/server/input/InputManagerService.java index 0b4a721..7b0c452 100644 --- a/services/java/com/android/server/input/InputManagerService.java +++ b/services/java/com/android/server/input/InputManagerService.java @@ -1238,11 +1238,15 @@ public class InputManagerService extends IInputManager.Stub } // Native callback. - private void notifySwitch(long whenNanos, int switchCode, int switchValue) { - switch (switchCode) { - case SW_LID: - mWindowManagerCallbacks.notifyLidSwitchChanged(whenNanos, switchValue == 0); - break; + private void notifySwitch(long whenNanos, int switchValues, int switchMask) { + if (DEBUG) { + Slog.d(TAG, "notifySwitch: values=" + Integer.toHexString(switchValues) + + ", mask=" + Integer.toHexString(switchMask)); + } + + if ((switchMask & (1 << SW_LID)) != 0) { + final boolean lidOpen = ((switchValues & (1 << SW_LID)) == 0); + mWindowManagerCallbacks.notifyLidSwitchChanged(whenNanos, lidOpen); } } diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 6accb39..1eafd9c 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -5614,7 +5614,7 @@ public class PackageManagerService extends IPackageManager.Stub { int flags, String installerPackageName, Uri verificationURI, ManifestDigest manifestDigest, ContainerEncryptionParams encryptionParams) { VerificationParams verificationParams = new VerificationParams(verificationURI, null, null, - manifestDigest); + VerificationParams.NO_UID, manifestDigest); installPackageWithVerificationAndEncryption(packageURI, observer, flags, installerPackageName, verificationParams, encryptionParams); } @@ -6438,6 +6438,10 @@ public class PackageManagerService extends IPackageManager.Stub { verification.putExtra(Intent.EXTRA_REFERRER, verificationParams.getReferrer()); } + if (verificationParams.getOriginatingUid() >= 0) { + verification.putExtra(Intent.EXTRA_ORIGINATING_UID, + verificationParams.getOriginatingUid()); + } if (verificationParams.getInstallerUid() >= 0) { verification.putExtra(PackageManager.EXTRA_VERIFICATION_INSTALLER_UID, verificationParams.getInstallerUid()); diff --git a/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java b/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java index e07230d..4480151 100644 --- a/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java +++ b/services/java/com/android/server/updates/ConfigUpdateInstallReceiver.java @@ -126,7 +126,7 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { CertificateFactory cf = CertificateFactory.getInstance("X.509"); return (X509Certificate) cf.generateCertificate(istream); } catch (CertificateException e) { - throw new IllegalStateException("Got malformed certificate from settings, ignoring", e); + throw new IllegalStateException("Got malformed certificate from settings, ignoring"); } } @@ -167,7 +167,7 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { String strVersion = IoUtils.readFileAsString(updateVersion.getCanonicalPath()).trim(); return Integer.parseInt(strVersion); } catch (IOException e) { - Slog.i(TAG, "Couldn't find current metadata, assuming first update", e); + Slog.i(TAG, "Couldn't find current metadata, assuming first update"); return 0; } } @@ -181,7 +181,7 @@ public class ConfigUpdateInstallReceiver extends BroadcastReceiver { try { return IoUtils.readFileAsString(updateContent.getCanonicalPath()).trim(); } catch (IOException e) { - Slog.i(TAG, "Failed to read current content, assuming first update!", e); + Slog.i(TAG, "Failed to read current content, assuming first update!"); return null; } } diff --git a/services/java/com/android/server/updates/SmsShortCodesInstallReceiver.java b/services/java/com/android/server/updates/SmsShortCodesInstallReceiver.java new file mode 100644 index 0000000..0f14f57 --- /dev/null +++ b/services/java/com/android/server/updates/SmsShortCodesInstallReceiver.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 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. + */ + +package com.android.server.updates; + +public class SmsShortCodesInstallReceiver extends ConfigUpdateInstallReceiver { + + public SmsShortCodesInstallReceiver() { + super("/data/misc/sms/", "codes", "metadata/", "version"); + } +} |