diff options
308 files changed, 4197 insertions, 1532 deletions
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index 3d060feff70e..e7cce068cf5f 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -319,6 +319,8 @@ message Atom { 217 [(log_from_module) = "permissioncontroller"]; PermissionAppsFragmentViewed permission_apps_fragment_viewed = 218 [(log_from_module) = "permissioncontroller"]; + ExclusionRectStateChanged exclusion_rect_state_changed = 223; + BackGesture back_gesture_reported_reported = 224; } // Pulled events will start at field 10000. @@ -2500,6 +2502,41 @@ message PhoneStateChanged { optional State state = 1; } +message BackGesture { + enum BackType { + DEFAULT_BACK_TYPE = 0; + COMPLETED = 1; + COMPLETED_REJECTED = 2; // successful because coming from rejected area + INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area + INCOMPLETE = 4; + } + optional BackType type = 1; + + optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event + enum WindowHorizontalLocation { + DEFAULT_LOCATION = 0; + LEFT = 1; + RIGHT = 2; + } + optional WindowHorizontalLocation x_location = 3; +} + +message ExclusionRectStateChanged { + optional string component_name = 1; // if not available, simply packageName + optional int32 requested_height = 2; // px + optional int32 rejected_height = 3; // px + + enum WindowHorizontalLocation { + DEFAULT_LOCATION = 0; + LEFT = 1; + RIGHT = 2; + } + optional WindowHorizontalLocation x_location = 4; + optional bool landscape = 5; + optional bool splitscreen = 6; + optional int32 duration_millis = 7; +} + message LauncherUIChanged { optional android.stats.launcher.LauncherAction action = 1; optional android.stats.launcher.LauncherState src_state = 2; @@ -5301,7 +5338,7 @@ message NetworkDnsEventReported { // Only valid for event_type = EVENT_RESNSEND. optional int32 res_nsend_flags = 5; - optional android.stats.dnsresolver.Transport network_type = 6; + optional android.stats.dnsresolver.NetworkType network_type = 6; // The DNS over TLS mode on a specific netId. optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7; @@ -5309,6 +5346,9 @@ message NetworkDnsEventReported { // Additional pass-through fields opaque to statsd. // The DNS resolver Mainline module can add new fields here without requiring an OS update. optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES]; + + // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom. + optional int32 sampling_rate_denom = 9; } /** diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java index cebe6e1211e0..90b80e73c323 100644 --- a/core/java/android/accessibilityservice/AccessibilityService.java +++ b/core/java/android/accessibilityservice/AccessibilityService.java @@ -309,7 +309,7 @@ public abstract class AccessibilityService extends Service { * Name under which an AccessibilityService component publishes information * about itself. This meta-data must reference an XML resource containing an * <code><{@link android.R.styleable#AccessibilityService accessibility-service}></code> - * tag. This is a a sample XML file configuring an accessibility service: + * tag. This is a sample XML file configuring an accessibility service: * <pre> <accessibility-service * android:accessibilityEventTypes="typeViewClicked|typeViewFocused" * android:packageNames="foo.bar, foo.baz" diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index dc52c52cca1f..f5b0b592e6a7 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -1547,7 +1547,9 @@ public class Activity extends ContextThemeWrapper * had previously been frozen by {@link #onSaveInstanceState}. * * <p>This method is called between {@link #onStart} and - * {@link #onPostCreate}. + * {@link #onPostCreate}. This method is called only when recreating + * an activity; the method isn't invoked if {@link #onStart} is called for + * any other reason.</p> * * @param savedInstanceState the data most recently supplied in {@link #onSaveInstanceState}. * diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java index 8508c2c95666..1725db046a95 100644 --- a/core/java/android/app/ActivityManagerInternal.java +++ b/core/java/android/app/ActivityManagerInternal.java @@ -120,17 +120,6 @@ public abstract class ActivityManagerInternal { public abstract void setHasOverlayUi(int pid, boolean hasOverlayUi); /** - * Sets if the given pid is currently running a remote animation, which is taken a signal for - * determining oom adjustment and scheduling behavior. - * - * @param pid The pid we are setting overlay UI for. - * @param runningRemoteAnimation True if the process is running a remote animation, false - * otherwise. - * @see RemoteAnimationAdapter - */ - public abstract void setRunningRemoteAnimation(int pid, boolean runningRemoteAnimation); - - /** * Called after the network policy rules are updated by * {@link com.android.server.net.NetworkPolicyManagerService} for a specific {@param uid} and * {@param procStateSeq}. diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index f66448f518c8..ceadd8510e44 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -5437,10 +5437,11 @@ public class Notification implements Parcelable /** * Construct a RemoteViews for the display in public contexts like on the lockscreen. * + * @param isLowPriority is this notification low priority * @hide */ @UnsupportedAppUsage - public RemoteViews makePublicContentView() { + public RemoteViews makePublicContentView(boolean isLowPriority) { if (mN.publicVersion != null) { final Builder builder = recoverBuilder(mContext, mN.publicVersion); return builder.createContentView(); @@ -5467,7 +5468,11 @@ public class Notification implements Parcelable } mN.extras = publicExtras; RemoteViews view; - view = makeNotificationHeader(); + StandardTemplateParams params = mParams.reset().fillTextsFrom(this); + if (isLowPriority) { + params.forceDefaultColor(); + } + view = makeNotificationHeader(params); view.setBoolean(R.id.notification_header, "setExpandOnlyOnButton", true); mN.extras = savedBundle; mN.mLargeIcon = largeIcon; diff --git a/core/java/android/hardware/biometrics/BiometricManager.java b/core/java/android/hardware/biometrics/BiometricManager.java index af66dc161343..d8110f33d723 100644 --- a/core/java/android/hardware/biometrics/BiometricManager.java +++ b/core/java/android/hardware/biometrics/BiometricManager.java @@ -129,6 +129,25 @@ public class BiometricManager { } /** + * @hide + * @param userId + * @return + */ + @RequiresPermission(USE_BIOMETRIC_INTERNAL) + public boolean hasEnrolledBiometrics(int userId) { + if (mService != null) { + try { + return mService.hasEnrolledBiometrics(userId); + } catch (RemoteException e) { + Slog.w(TAG, "Remote exception in hasEnrolledBiometrics(): " + e); + return false; + } + } else { + return false; + } + } + + /** * Listens for changes to biometric eligibility on keyguard from user settings. * @param callback * @hide diff --git a/core/java/android/hardware/biometrics/IBiometricService.aidl b/core/java/android/hardware/biometrics/IBiometricService.aidl index 18c14cb835a8..f0a0b2f0235f 100644 --- a/core/java/android/hardware/biometrics/IBiometricService.aidl +++ b/core/java/android/hardware/biometrics/IBiometricService.aidl @@ -42,6 +42,9 @@ interface IBiometricService { // Checks if biometrics can be used. int canAuthenticate(String opPackageName, int userId); + // Checks if any biometrics are enrolled. + boolean hasEnrolledBiometrics(int userId); + // Register callback for when keyguard biometric eligibility changes. void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback); diff --git a/core/java/android/os/ParcelFileDescriptor.java b/core/java/android/os/ParcelFileDescriptor.java index 8355e08b6aa8..2a4576adf192 100644 --- a/core/java/android/os/ParcelFileDescriptor.java +++ b/core/java/android/os/ParcelFileDescriptor.java @@ -581,12 +581,16 @@ public class ParcelFileDescriptor implements Parcelable, Closeable { public static ParcelFileDescriptor fromData(byte[] data, String name) throws IOException { if (data == null) return null; MemoryFile file = new MemoryFile(name, data.length); - if (data.length > 0) { - file.writeBytes(data, 0, 0, data.length); + try { + if (data.length > 0) { + file.writeBytes(data, 0, 0, data.length); + } + file.deactivate(); + FileDescriptor fd = file.getFileDescriptor(); + return fd != null ? ParcelFileDescriptor.dup(fd) : null; + } finally { + file.close(); } - file.deactivate(); - FileDescriptor fd = file.getFileDescriptor(); - return fd != null ? ParcelFileDescriptor.dup(fd) : null; } /** diff --git a/core/java/android/provider/DeviceConfig.java b/core/java/android/provider/DeviceConfig.java index 1fd212df4469..ea50ae810535 100644 --- a/core/java/android/provider/DeviceConfig.java +++ b/core/java/android/provider/DeviceConfig.java @@ -338,6 +338,20 @@ public final class DeviceConfig { "system_gestures_excluded_by_pre_q_sticky_immersive"; /** + * The minimum duration between gesture exclusion logging for a given window in + * milliseconds. + * + * Events that happen in-between will be silently dropped. + * + * A non-positive value disables logging. + * + * @see android.provider.DeviceConfig#NAMESPACE_WINDOW_MANAGER + * @hide + */ + String KEY_SYSTEM_GESTURE_EXCLUSION_LOG_DEBOUNCE_MILLIS = + "system_gesture_exclusion_log_debounce_millis"; + + /** * Key for controlling which packages are explicitly blocked from running at refresh rates * higher than 60hz. * diff --git a/core/java/android/view/IRecentsAnimationController.aidl b/core/java/android/view/IRecentsAnimationController.aidl index 956161acd762..955be8d40c47 100644 --- a/core/java/android/view/IRecentsAnimationController.aidl +++ b/core/java/android/view/IRecentsAnimationController.aidl @@ -77,6 +77,21 @@ interface IRecentsAnimationController { void hideCurrentInputMethod(); /** + * This call is deprecated, use #setDeferCancelUntilNextTransition() instead + * TODO(138144750): Remove this method once there are no callers + * @deprecated + */ + void setCancelWithDeferredScreenshot(boolean screenshot); + + /** + * Clean up the screenshot of previous task which was created during recents animation that + * was cancelled by a stack order change. + * + * @see {@link IRecentsAnimationRunner#onAnimationCanceled} + */ + void cleanupScreenshot(); + + /** * Set a state for controller whether would like to cancel recents animations with deferred * task screenshot presentation. * @@ -86,22 +101,23 @@ interface IRecentsAnimationController { * screenshot, so that Launcher can still control the leash lifecycle & make the next app * transition animate smoothly without flickering. * - * @param screenshot When set {@code true}, means recents animation will be canceled when the - * next app launch. System will take previous task's screenshot when the next - * app transition starting, and skip previous task's animation. - * Set {@code false} means will not take screenshot & skip animation - * for previous task. + * @param defer When set {@code true}, means that the recents animation will defer canceling the + * animation when a stack order change is triggered until the subsequent app + * transition start and skip previous task's animation. + * When set to {@code false}, means that the recents animation will be canceled + * immediately when the stack order changes. + * @param screenshot When set {@code true}, means that the system will take previous task's + * screenshot and replace the contents of the leash with it when the next app + * transition starting. The runner must call #cleanupScreenshot() to end the + * recents animation. + * When set to {@code false}, means that the system will simply wait for the + * next app transition start to immediately cancel the recents animation. This + * can be useful when you want an immediate transition into a state where the + * task is shown in the home/recents activity (without waiting for a + * screenshot). * * @see #cleanupScreenshot() * @see IRecentsAnimationRunner#onCancelled */ - void setCancelWithDeferredScreenshot(boolean screenshot); - - /** - * Clean up the screenshot of previous task which was created during recents animation that - * was cancelled by a stack order change. - * - * @see {@link IRecentsAnimationRunner#onAnimationCanceled} - */ - void cleanupScreenshot(); + void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot); } diff --git a/core/java/android/view/IRecentsAnimationRunner.aidl b/core/java/android/view/IRecentsAnimationRunner.aidl index 9c652a8d990b..6cda60c80b7d 100644 --- a/core/java/android/view/IRecentsAnimationRunner.aidl +++ b/core/java/android/view/IRecentsAnimationRunner.aidl @@ -36,7 +36,7 @@ oneway interface IRecentsAnimationRunner { * @param deferredWithScreenshot If set to {@code true}, the contents of the task will be * replaced with a screenshot, such that the runner's leash is * still active. As soon as the runner doesn't need the leash - * anymore, it can call + * anymore, it must call * {@link IRecentsAnimationController#cleanupScreenshot). * * @see {@link RecentsAnimationController#cleanupScreenshot} diff --git a/core/java/android/view/ISystemGestureExclusionListener.aidl b/core/java/android/view/ISystemGestureExclusionListener.aidl index a032625547d2..9c2f9a6a192c 100644 --- a/core/java/android/view/ISystemGestureExclusionListener.aidl +++ b/core/java/android/view/ISystemGestureExclusionListener.aidl @@ -28,7 +28,14 @@ oneway interface ISystemGestureExclusionListener { * Called when the system gesture exclusion for the given display changed. * @param displayId the display whose system gesture exclusion changed * @param systemGestureExclusion a {@code Region} where the app would like priority over the - * system gestures, in display coordinates. + * system gestures, in display coordinates. Certain restrictions + * might be applied such that apps don't get all the exclusions + * they request. + * @param systemGestureExclusionUnrestricted a {@code Region} where the app would like priority + * over the system gestures, in display coordinates, without + * any restrictions applied. Null if no restrictions have been + * applied. */ - void onSystemGestureExclusionChanged(int displayId, in Region systemGestureExclusion); + void onSystemGestureExclusionChanged(int displayId, in Region systemGestureExclusion, + in Region systemGestureExclusionUnrestricted); }
\ No newline at end of file diff --git a/core/java/android/view/RemoteAnimationAdapter.java b/core/java/android/view/RemoteAnimationAdapter.java index bc2fe545a8ac..c686440171a2 100644 --- a/core/java/android/view/RemoteAnimationAdapter.java +++ b/core/java/android/view/RemoteAnimationAdapter.java @@ -55,6 +55,7 @@ public class RemoteAnimationAdapter implements Parcelable { /** @see #getCallingPid */ private int mCallingPid; + private int mCallingUid; /** * @param runner The interface that gets notified when we actually need to start the animation. @@ -103,10 +104,11 @@ public class RemoteAnimationAdapter implements Parcelable { } /** - * To be called by system_server to keep track which pid is running this animation. + * To be called by system_server to keep track which pid and uid is running this animation. */ - public void setCallingPid(int pid) { + public void setCallingPidUid(int pid, int uid) { mCallingPid = pid; + mCallingUid = uid; } /** @@ -116,6 +118,13 @@ public class RemoteAnimationAdapter implements Parcelable { return mCallingPid; } + /** + * @return The uid of the process running the animation. + */ + public int getCallingUid() { + return mCallingUid; + } + @Override public int describeContents() { return 0; diff --git a/core/java/android/view/RemoteAnimationDefinition.java b/core/java/android/view/RemoteAnimationDefinition.java index 884cae440bed..da599efb6eee 100644 --- a/core/java/android/view/RemoteAnimationDefinition.java +++ b/core/java/android/view/RemoteAnimationDefinition.java @@ -118,9 +118,9 @@ public class RemoteAnimationDefinition implements Parcelable { * To be called by system_server to keep track which pid is running the remote animations inside * this definition. */ - public void setCallingPid(int pid) { + public void setCallingPidUid(int pid, int uid) { for (int i = mTransitionAnimationMap.size() - 1; i >= 0; i--) { - mTransitionAnimationMap.valueAt(i).adapter.setCallingPid(pid); + mTransitionAnimationMap.valueAt(i).adapter.setCallingPidUid(pid, uid); } } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index fd4dafc81f36..4e86e60fdd62 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -967,6 +967,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ static boolean sBrokenInsetsDispatch; + /** + * Prior to Q, calling + * {@link com.android.internal.policy.DecorView#setBackgroundDrawable(Drawable)} + * did not call update the window format so the opacity of the background was not correctly + * applied to the window. Some applications rely on this misbehavior to work properly. + * <p> + * From Q, {@link com.android.internal.policy.DecorView#setBackgroundDrawable(Drawable)} is + * the same as {@link com.android.internal.policy.DecorView#setWindowBackground(Drawable)} + * which updates the window format. + * @hide + */ + protected static boolean sBrokenWindowBackground; + /** @hide */ @IntDef({NOT_FOCUSABLE, FOCUSABLE, FOCUSABLE_AUTO}) @Retention(RetentionPolicy.SOURCE) @@ -5223,6 +5236,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, sBrokenInsetsDispatch = ViewRootImpl.sNewInsetsMode != NEW_INSETS_MODE_FULL || targetSdkVersion < Build.VERSION_CODES.Q; + sBrokenWindowBackground = targetSdkVersion < Build.VERSION_CODES.Q; + sCompatibilityDone = true; } } @@ -11070,6 +11085,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * * <p>Do not modify the provided list after this method is called.</p> * + * <p>Note: the system will put a limit of <code>200dp</code> on the vertical extent of the + * exclusions it takes into account. The limit does not apply while the navigation + * bar is {@link #SYSTEM_UI_FLAG_IMMERSIVE_STICKY stickily} hidden, nor to the + * {@link android.inputmethodservice.InputMethodService input method} and + * {@link Intent#CATEGORY_HOME home activity}. + * </p> + * * @param rects A list of precision gesture regions that this view needs to function correctly */ public void setSystemGestureExclusionRects(@NonNull List<Rect> rects) { diff --git a/core/java/android/view/WindowInsets.java b/core/java/android/view/WindowInsets.java index 9340b71a5280..bcc6a552f569 100644 --- a/core/java/android/view/WindowInsets.java +++ b/core/java/android/view/WindowInsets.java @@ -35,6 +35,7 @@ import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; +import android.content.Intent; import android.graphics.Insets; import android.graphics.Rect; import android.util.SparseArray; @@ -644,6 +645,14 @@ public final class WindowInsets { * {@link View#setSystemGestureExclusionRects} outside of the * {@link #getMandatorySystemGestureInsets() mandatory system gesture insets}. * + * <p>Note: the system will put a limit of <code>200dp</code> on the vertical extent of the + * exclusions it takes into account. The limit does not apply while the navigation + * bar is {@link View#SYSTEM_UI_FLAG_IMMERSIVE_STICKY stickily} hidden, nor to the + * {@link android.inputmethodservice.InputMethodService input method} and + * {@link Intent#CATEGORY_HOME home activity}. + * </p> + * + * * <p>Simple taps are guaranteed to reach the window even within the system gesture insets, * as long as they are outside the {@link #getTappableElementInsets() system window insets}. * diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index a46580dcc539..18d4d691f726 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -464,7 +464,9 @@ public abstract class WebSettings { * Note that the feature will continue to be supported on older versions of * Android as before. * - * This function does not have any effect. + * @deprecated In Android O and afterwards, this function does not have + * any effect, the form data will be saved to platform's autofill service + * if applicable. */ @Deprecated public abstract void setSaveFormData(boolean save); diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java index 50bb6883b903..1db91233aefb 100644 --- a/core/java/android/widget/AbsSeekBar.java +++ b/core/java/android/widget/AbsSeekBar.java @@ -91,6 +91,7 @@ public abstract class AbsSeekBar extends ProgressBar { @UnsupportedAppUsage private float mDisabledAlpha; + private int mThumbExclusionMaxSize; private int mScaledTouchSlop; private float mTouchDownX; @UnsupportedAppUsage @@ -170,6 +171,8 @@ public abstract class AbsSeekBar extends ProgressBar { applyTickMarkTint(); mScaledTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); + mThumbExclusionMaxSize = getResources().getDimensionPixelSize( + com.android.internal.R.dimen.seekbar_thumb_exclusion_max_size); } /** @@ -762,12 +765,30 @@ public abstract class AbsSeekBar extends ProgressBar { } mGestureExclusionRects.clear(); thumb.copyBounds(mThumbRect); + mThumbRect.offset(mPaddingLeft - mThumbOffset, mPaddingTop); + growRectTo(mThumbRect, Math.min(getHeight(), mThumbExclusionMaxSize)); mGestureExclusionRects.add(mThumbRect); mGestureExclusionRects.addAll(mUserGestureExclusionRects); super.setSystemGestureExclusionRects(mGestureExclusionRects); } /** + * Grows {@code r} from its center such that each dimension is at least {@code minimumSize}. + */ + private void growRectTo(Rect r, int minimumSize) { + int dy = (minimumSize - r.height()) / 2; + if (dy > 0) { + r.top -= dy; + r.bottom += dy; + } + int dx = (minimumSize - r.width()) / 2; + if (dx > 0) { + r.left -= dx; + r.right += dx; + } + } + + /** * @hide */ @Override diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java index 49a0f39b3bad..4c67b080252a 100644 --- a/core/java/android/widget/TabWidget.java +++ b/core/java/android/widget/TabWidget.java @@ -433,7 +433,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { * to the next tabbed view, in this example). * <p> * To move both the focus AND the selected tab at once, please use - * {@link #setCurrentTab}. Normally, the view logic takes care of + * {@link #focusCurrentTab}. Normally, the view logic takes care of * adjusting the focus, so unless you're circumventing the UI, * you'll probably just focus your interest here. * diff --git a/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java b/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java index e91a0eac1264..40ee511b0727 100644 --- a/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java +++ b/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java @@ -187,6 +187,38 @@ public final class SystemUiDeviceConfigFlags { public static final String ASSIST_HANDLES_SHOW_WHEN_TAUGHT = "assist_handles_show_when_taught"; /** + * (long) Duration per pixel, in milliseconds, of scrolling text at fast speed. + */ + public static final String ASSIST_TRANSCRIPTION_DURATION_PER_PX_FAST = + "assist_transcription_duration_per_px_fast"; + + /** + * (long) Duration per pixel, in milliseconds, of scrolling text at regular speed. + */ + public static final String ASSIST_TRANSCRIPTION_DURATION_PER_PX_REGULAR = + "assist_transcription_duration_per_px_regular"; + + /** + * (long) Duration, in milliseconds, over which text fades in. + */ + public static final String ASSIST_TRANSCRIPTION_FADE_IN_DURATION = + "assist_transcription_fade_in_duration"; + + /** + * (long) Maximum total duration, in milliseconds, for a given transcription. + */ + public static final String ASSIST_TRANSCRIPTION_MAX_DURATION = + "assist_transcription_max_duration"; + + /** + * (long) Minimum total duration, in milliseconds, for a given transcription. + */ + public static final String ASSIST_TRANSCRIPTION_MIN_DURATION = + "assist_transcription_min_duration"; + + // Flags related to brightline falsing + + /** * (bool) Whether to use the new BrightLineFalsingManager. */ public static final String BRIGHTLINE_FALSING_MANAGER_ENABLED = @@ -275,5 +307,6 @@ public final class SystemUiDeviceConfigFlags { "brightline_falsing_zigzag_y_secondary_deviance"; - private SystemUiDeviceConfigFlags() { } + private SystemUiDeviceConfigFlags() { + } } diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java index fe66cf9aab7d..7c52a40d4494 100644 --- a/core/java/com/android/internal/policy/DecorView.java +++ b/core/java/com/android/internal/policy/DecorView.java @@ -983,13 +983,14 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind @Override public void setBackgroundDrawable(Drawable background) { - // TODO: This should route through setWindowBackground, but late in the release to make this // change. if (mOriginalBackgroundDrawable != background) { mOriginalBackgroundDrawable = background; updateBackgroundDrawable(); - drawableChanged(); + if (!View.sBrokenWindowBackground) { + drawableChanged(); + } } } diff --git a/core/java/com/android/internal/widget/MediaNotificationView.java b/core/java/com/android/internal/widget/MediaNotificationView.java index e7d240a1035e..9bb45012b61a 100644 --- a/core/java/com/android/internal/widget/MediaNotificationView.java +++ b/core/java/com/android/internal/widget/MediaNotificationView.java @@ -26,6 +26,8 @@ import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.RemoteViews; +import java.util.ArrayList; + /** * A TextView that can float around an image on the end. * @@ -42,6 +44,7 @@ public class MediaNotificationView extends FrameLayout { private View mMainColumn; private View mMediaContent; private int mImagePushIn; + private ArrayList<VisibilityChangeListener> mListeners; public MediaNotificationView(Context context) { this(context, null); @@ -168,4 +171,50 @@ public class MediaNotificationView extends FrameLayout { mMainColumn = findViewById(com.android.internal.R.id.notification_main_column); mMediaContent = findViewById(com.android.internal.R.id.notification_media_content); } + + @Override + public void onVisibilityAggregated(boolean isVisible) { + super.onVisibilityAggregated(isVisible); + if (mListeners != null) { + for (int i = 0; i < mListeners.size(); i++) { + mListeners.get(i).onAggregatedVisibilityChanged(isVisible); + } + } + } + + /** + * Add a listener to receive updates on the visibility of this view + * + * @param listener The listener to add. + */ + public void addVisibilityListener(VisibilityChangeListener listener) { + if (mListeners == null) { + mListeners = new ArrayList<>(); + } + if (!mListeners.contains(listener)) { + mListeners.add(listener); + } + } + + /** + * Remove the specified listener + * + * @param listener The listener to remove. + */ + public void removeVisibilityListener(VisibilityChangeListener listener) { + if (mListeners != null) { + mListeners.remove(listener); + } + } + + /** + * Interface for receiving updates when the view's visibility changes + */ + public interface VisibilityChangeListener { + /** + * Method called when the visibility of this view has changed + * @param isVisible true if the view is now visible + */ + void onAggregatedVisibilityChanged(boolean isVisible); + } } diff --git a/core/java/com/android/internal/widget/PointerLocationView.java b/core/java/com/android/internal/widget/PointerLocationView.java index 9084f625f9cb..d48034b66266 100644 --- a/core/java/com/android/internal/widget/PointerLocationView.java +++ b/core/java/com/android/internal/widget/PointerLocationView.java @@ -53,6 +53,12 @@ public class PointerLocationView extends View implements InputDeviceListener, // to plot alongside the default one. Useful for testing and comparison purposes. private static final String ALT_STRATEGY_PROPERY_KEY = "debug.velocitytracker.alt"; + /** + * If set to a positive value between 1-255, shows an overlay with the approved (red) and + * rejected (blue) exclusions. + */ + private static final String GESTURE_EXCLUSION_PROP = "debug.pointerlocation.showexclusion"; + public static class PointerState { // Trace of previous points. private float[] mTraceX = new float[32]; @@ -138,8 +144,10 @@ public class PointerLocationView extends View implements InputDeviceListener, private final PointerCoords mTempCoords = new PointerCoords(); private final Region mSystemGestureExclusion = new Region(); + private final Region mSystemGestureExclusionRejected = new Region(); private final Path mSystemGestureExclusionPath = new Path(); private final Paint mSystemGestureExclusionPaint; + private final Paint mSystemGestureExclusionRejectedPaint; private final VelocityTracker mVelocity; private final VelocityTracker mAltVelocity; @@ -190,6 +198,10 @@ public class PointerLocationView extends View implements InputDeviceListener, mSystemGestureExclusionPaint.setARGB(25, 255, 0, 0); mSystemGestureExclusionPaint.setStyle(Paint.Style.FILL_AND_STROKE); + mSystemGestureExclusionRejectedPaint = new Paint(); + mSystemGestureExclusionRejectedPaint.setARGB(25, 0, 0, 255); + mSystemGestureExclusionRejectedPaint.setStyle(Paint.Style.FILL_AND_STROKE); + PointerState ps = new PointerState(); mPointers.add(ps); mActivePointerId = 0; @@ -263,6 +275,12 @@ public class PointerLocationView extends View implements InputDeviceListener, canvas.drawPath(mSystemGestureExclusionPath, mSystemGestureExclusionPaint); } + if (!mSystemGestureExclusionRejected.isEmpty()) { + mSystemGestureExclusionPath.reset(); + mSystemGestureExclusionRejected.getBoundaryPath(mSystemGestureExclusionPath); + canvas.drawPath(mSystemGestureExclusionPath, mSystemGestureExclusionRejectedPaint); + } + // Labels if (mActivePointerId >= 0) { final PointerState ps = mPointers.get(mActivePointerId); @@ -754,6 +772,9 @@ public class PointerLocationView extends View implements InputDeviceListener, } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } + final int alpha = systemGestureExclusionOpacity(); + mSystemGestureExclusionPaint.setAlpha(alpha); + mSystemGestureExclusionRejectedPaint.setAlpha(alpha); } else { mSystemGestureExclusion.setEmpty(); } @@ -805,7 +826,12 @@ public class PointerLocationView extends View implements InputDeviceListener, } private static boolean shouldShowSystemGestureExclusion() { - return SystemProperties.getBoolean("debug.pointerlocation.showexclusion", false); + return systemGestureExclusionOpacity() > 0; + } + + private static int systemGestureExclusionOpacity() { + int x = SystemProperties.getInt(GESTURE_EXCLUSION_PROP, 0); + return x >= 0 && x <= 255 ? x : 0; } // HACK @@ -928,12 +954,19 @@ public class PointerLocationView extends View implements InputDeviceListener, private ISystemGestureExclusionListener mSystemGestureExclusionListener = new ISystemGestureExclusionListener.Stub() { @Override - public void onSystemGestureExclusionChanged(int displayId, Region systemGestureExclusion) { + public void onSystemGestureExclusionChanged(int displayId, Region systemGestureExclusion, + Region systemGestureExclusionUnrestricted) { Region exclusion = Region.obtain(systemGestureExclusion); + Region rejected = Region.obtain(); + if (systemGestureExclusionUnrestricted != null) { + rejected.set(systemGestureExclusionUnrestricted); + rejected.op(exclusion, Region.Op.DIFFERENCE); + } Handler handler = getHandler(); if (handler != null) { handler.post(() -> { mSystemGestureExclusion.set(exclusion); + mSystemGestureExclusionRejected.set(rejected); exclusion.recycle(); invalidate(); }); diff --git a/core/proto/android/stats/dnsresolver/dns_resolver.proto b/core/proto/android/stats/dnsresolver/dns_resolver.proto index af6fea017bef..9eaabfbca463 100644 --- a/core/proto/android/stats/dnsresolver/dns_resolver.proto +++ b/core/proto/android/stats/dnsresolver/dns_resolver.proto @@ -1,214 +1,217 @@ -/*
- * Copyright (C) 2019 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.
- */
-syntax = "proto2";
-package android.stats.dnsresolver;
-
-enum EventType {
- EVENT_UNKNOWN = 0;
- EVENT_GETADDRINFO = 1;
- EVENT_GETHOSTBYNAME = 2;
- EVENT_GETHOSTBYADDR = 3;
- EVENT_RES_NSEND = 4;
-}
-
-// The return value of the DNS resolver for each DNS lookups.
-// bionic/libc/include/netdb.h
-// system/netd/resolv/include/netd_resolv/resolv.h
-enum ReturnCode {
- RC_EAI_NO_ERROR = 0;
- RC_EAI_ADDRFAMILY = 1;
- RC_EAI_AGAIN = 2;
- RC_EAI_BADFLAGS = 3;
- RC_EAI_FAIL = 4;
- RC_EAI_FAMILY = 5;
- RC_EAI_MEMORY = 6;
- RC_EAI_NODATA = 7;
- RC_EAI_NONAME = 8;
- RC_EAI_SERVICE = 9;
- RC_EAI_SOCKTYPE = 10;
- RC_EAI_SYSTEM = 11;
- RC_EAI_BADHINTS = 12;
- RC_EAI_PROTOCOL = 13;
- RC_EAI_OVERFLOW = 14;
- RC_RESOLV_TIMEOUT = 255;
- RC_EAI_MAX = 256;
-}
-
-enum NsRcode {
- NS_R_NO_ERROR = 0; // No error occurred.
- NS_R_FORMERR = 1; // Format error.
- NS_R_SERVFAIL = 2; // Server failure.
- NS_R_NXDOMAIN = 3; // Name error.
- NS_R_NOTIMPL = 4; // Unimplemented.
- NS_R_REFUSED = 5; // Operation refused.
- // these are for BIND_UPDATE
- NS_R_YXDOMAIN = 6; // Name exists
- NS_R_YXRRSET = 7; // RRset exists
- NS_R_NXRRSET = 8; // RRset does not exist
- NS_R_NOTAUTH = 9; // Not authoritative for zone
- NS_R_NOTZONE = 10; // Zone of record different from zone section
- NS_R_MAX = 11;
- // The following are EDNS extended rcodes
- NS_R_BADVERS = 16;
- // The following are TSIG errors
- // NS_R_BADSIG = 16,
- NS_R_BADKEY = 17;
- NS_R_BADTIME = 18;
-}
-
-// Currently defined type values for resources and queries.
-enum NsType {
- NS_T_INVALID = 0; // Cookie.
- NS_T_A = 1; // Host address.
- NS_T_NS = 2; // Authoritative server.
- NS_T_MD = 3; // Mail destination.
- NS_T_MF = 4; // Mail forwarder.
- NS_T_CNAME = 5; // Canonical name.
- NS_T_SOA = 6; // Start of authority zone.
- NS_T_MB = 7; // Mailbox domain name.
- NS_T_MG = 8; // Mail group member.
- NS_T_MR = 9; // Mail rename name.
- NS_T_NULL = 10; // Null resource record.
- NS_T_WKS = 11; // Well known service.
- NS_T_PTR = 12; // Domain name pointer.
- NS_T_HINFO = 13; // Host information.
- NS_T_MINFO = 14; // Mailbox information.
- NS_T_MX = 15; // Mail routing information.
- NS_T_TXT = 16; // Text strings.
- NS_T_RP = 17; // Responsible person.
- NS_T_AFSDB = 18; // AFS cell database.
- NS_T_X25 = 19; // X_25 calling address.
- NS_T_ISDN = 20; // ISDN calling address.
- NS_T_RT = 21; // Router.
- NS_T_NSAP = 22; // NSAP address.
- NS_T_NSAP_PTR = 23; // Reverse NSAP lookup (deprecated).
- NS_T_SIG = 24; // Security signature.
- NS_T_KEY = 25; // Security key.
- NS_T_PX = 26; // X.400 mail mapping.
- NS_T_GPOS = 27; // Geographical position (withdrawn).
- NS_T_AAAA = 28; // IPv6 Address.
- NS_T_LOC = 29; // Location Information.
- NS_T_NXT = 30; // Next domain (security).
- NS_T_EID = 31; // Endpoint identifier.
- NS_T_NIMLOC = 32; // Nimrod Locator.
- NS_T_SRV = 33; // Server Selection.
- NS_T_ATMA = 34; // ATM Address
- NS_T_NAPTR = 35; // Naming Authority PoinTeR
- NS_T_KX = 36; // Key Exchange
- NS_T_CERT = 37; // Certification record
- NS_T_A6 = 38; // IPv6 address (experimental)
- NS_T_DNAME = 39; // Non-terminal DNAME
- NS_T_SINK = 40; // Kitchen sink (experimentatl)
- NS_T_OPT = 41; // EDNS0 option (meta-RR)
- NS_T_APL = 42; // Address prefix list (RFC 3123)
- NS_T_DS = 43; // Delegation Signer
- NS_T_SSHFP = 44; // SSH Fingerprint
- NS_T_IPSECKEY = 45; // IPSEC Key
- NS_T_RRSIG = 46; // RRset Signature
- NS_T_NSEC = 47; // Negative security
- NS_T_DNSKEY = 48; // DNS Key
- NS_T_DHCID = 49; // Dynamic host configuratin identifier
- NS_T_NSEC3 = 50; // Negative security type 3
- NS_T_NSEC3PARAM = 51; // Negative security type 3 parameters
- NS_T_HIP = 55; // Host Identity Protocol
- NS_T_SPF = 99; // Sender Policy Framework
- NS_T_TKEY = 249; // Transaction key
- NS_T_TSIG = 250; // Transaction signature.
- NS_T_IXFR = 251; // Incremental zone transfer.
- NS_T_AXFR = 252; // Transfer zone of authority.
- NS_T_MAILB = 253; // Transfer mailbox records.
- NS_T_MAILA = 254; // Transfer mail agent records.
- NS_T_ANY = 255; // Wildcard match.
- NS_T_ZXFR = 256; // BIND-specific, nonstandard.
- NS_T_DLV = 32769; // DNSSEC look-aside validatation.
- NS_T_MAX = 65536;
-}
-
-enum IpVersion {
- IV_UNKNOWN = 0;
- IV_IPV4 = 1;
- IV_IPV6 = 2;
-}
-
-enum TransportType {
- TT_UNKNOWN = 0;
- TT_UDP = 1;
- TT_TCP = 2;
- TT_DOT = 3;
-}
-
-enum PrivateDnsModes {
- PDM_UNKNOWN = 0;
- PDM_OFF = 1;
- PDM_OPPORTUNISTIC = 2;
- PDM_STRICT = 3;
-}
-
-enum Transport {
- // Indicates this network uses a Cellular transport.
- TRANSPORT_DEFAULT = 0; // TRANSPORT_CELLULAR
- // Indicates this network uses a Wi-Fi transport.
- TRANSPORT_WIFI = 1;
- // Indicates this network uses a Bluetooth transport.
- TRANSPORT_BLUETOOTH = 2;
- // Indicates this network uses an Ethernet transport.
- TRANSPORT_ETHERNET = 3;
- // Indicates this network uses a VPN transport.
- TRANSPORT_VPN = 4;
- // Indicates this network uses a Wi-Fi Aware transport.
- TRANSPORT_WIFI_AWARE = 5;
- // Indicates this network uses a LoWPAN transport.
- TRANSPORT_LOWPAN = 6;
-}
-
-enum CacheStatus{
- // the cache can't handle that kind of queries.
- // or the answer buffer is too small.
- CS_UNSUPPORTED = 0;
- // the cache doesn't know about this query.
- CS_NOTFOUND = 1;
- // the cache found the answer.
- CS_FOUND = 2;
- // Don't do anything on cache.
- CS_SKIP = 3;
-}
-
-message DnsQueryEvent {
- optional android.stats.dnsresolver.NsRcode rcode = 1;
-
- optional android.stats.dnsresolver.NsType type = 2;
-
- optional android.stats.dnsresolver.CacheStatus cache_hit = 3;
-
- optional android.stats.dnsresolver.IpVersion ip_version = 4;
-
- optional android.stats.dnsresolver.TransportType transport = 5;
-
- // Number of DNS query retry times
- optional int32 retry_times = 6;
-
- // Ordinal number of name server.
- optional int32 dns_server_count = 7;
-
- // Used only by TCP and DOT. True for new connections.
- optional bool connected = 8;
-
- optional int32 latency_micros = 9;
-}
-
-message DnsQueryEvents {
- repeated DnsQueryEvent dns_query_event = 1;
-}
+/* + * Copyright (C) 2019 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. + */ +syntax = "proto2"; +package android.stats.dnsresolver; + +enum EventType { + EVENT_UNKNOWN = 0; + EVENT_GETADDRINFO = 1; + EVENT_GETHOSTBYNAME = 2; + EVENT_GETHOSTBYADDR = 3; + EVENT_RES_NSEND = 4; +} + +// The return value of the DNS resolver for each DNS lookups. +// bionic/libc/include/netdb.h +// system/netd/resolv/include/netd_resolv/resolv.h +enum ReturnCode { + RC_EAI_NO_ERROR = 0; + RC_EAI_ADDRFAMILY = 1; + RC_EAI_AGAIN = 2; + RC_EAI_BADFLAGS = 3; + RC_EAI_FAIL = 4; + RC_EAI_FAMILY = 5; + RC_EAI_MEMORY = 6; + RC_EAI_NODATA = 7; + RC_EAI_NONAME = 8; + RC_EAI_SERVICE = 9; + RC_EAI_SOCKTYPE = 10; + RC_EAI_SYSTEM = 11; + RC_EAI_BADHINTS = 12; + RC_EAI_PROTOCOL = 13; + RC_EAI_OVERFLOW = 14; + RC_RESOLV_TIMEOUT = 255; + RC_EAI_MAX = 256; +} + +enum NsRcode { + NS_R_NO_ERROR = 0; // No error occurred. + NS_R_FORMERR = 1; // Format error. + NS_R_SERVFAIL = 2; // Server failure. + NS_R_NXDOMAIN = 3; // Name error. + NS_R_NOTIMPL = 4; // Unimplemented. + NS_R_REFUSED = 5; // Operation refused. + // these are for BIND_UPDATE + NS_R_YXDOMAIN = 6; // Name exists + NS_R_YXRRSET = 7; // RRset exists + NS_R_NXRRSET = 8; // RRset does not exist + NS_R_NOTAUTH = 9; // Not authoritative for zone + NS_R_NOTZONE = 10; // Zone of record different from zone section + NS_R_MAX = 11; + // The following are EDNS extended rcodes + NS_R_BADVERS = 16; + // The following are TSIG errors + // NS_R_BADSIG = 16, + NS_R_BADKEY = 17; + NS_R_BADTIME = 18; + NS_R_INTERNAL_ERROR = 254; + NS_R_TIMEOUT = 255; +} + +// Currently defined type values for resources and queries. +enum NsType { + NS_T_INVALID = 0; // Cookie. + NS_T_A = 1; // Host address. + NS_T_NS = 2; // Authoritative server. + NS_T_MD = 3; // Mail destination. + NS_T_MF = 4; // Mail forwarder. + NS_T_CNAME = 5; // Canonical name. + NS_T_SOA = 6; // Start of authority zone. + NS_T_MB = 7; // Mailbox domain name. + NS_T_MG = 8; // Mail group member. + NS_T_MR = 9; // Mail rename name. + NS_T_NULL = 10; // Null resource record. + NS_T_WKS = 11; // Well known service. + NS_T_PTR = 12; // Domain name pointer. + NS_T_HINFO = 13; // Host information. + NS_T_MINFO = 14; // Mailbox information. + NS_T_MX = 15; // Mail routing information. + NS_T_TXT = 16; // Text strings. + NS_T_RP = 17; // Responsible person. + NS_T_AFSDB = 18; // AFS cell database. + NS_T_X25 = 19; // X_25 calling address. + NS_T_ISDN = 20; // ISDN calling address. + NS_T_RT = 21; // Router. + NS_T_NSAP = 22; // NSAP address. + NS_T_NSAP_PTR = 23; // Reverse NSAP lookup (deprecated). + NS_T_SIG = 24; // Security signature. + NS_T_KEY = 25; // Security key. + NS_T_PX = 26; // X.400 mail mapping. + NS_T_GPOS = 27; // Geographical position (withdrawn). + NS_T_AAAA = 28; // IPv6 Address. + NS_T_LOC = 29; // Location Information. + NS_T_NXT = 30; // Next domain (security). + NS_T_EID = 31; // Endpoint identifier. + NS_T_NIMLOC = 32; // Nimrod Locator. + NS_T_SRV = 33; // Server Selection. + NS_T_ATMA = 34; // ATM Address + NS_T_NAPTR = 35; // Naming Authority PoinTeR + NS_T_KX = 36; // Key Exchange + NS_T_CERT = 37; // Certification record + NS_T_A6 = 38; // IPv6 address (experimental) + NS_T_DNAME = 39; // Non-terminal DNAME + NS_T_SINK = 40; // Kitchen sink (experimentatl) + NS_T_OPT = 41; // EDNS0 option (meta-RR) + NS_T_APL = 42; // Address prefix list (RFC 3123) + NS_T_DS = 43; // Delegation Signer + NS_T_SSHFP = 44; // SSH Fingerprint + NS_T_IPSECKEY = 45; // IPSEC Key + NS_T_RRSIG = 46; // RRset Signature + NS_T_NSEC = 47; // Negative security + NS_T_DNSKEY = 48; // DNS Key + NS_T_DHCID = 49; // Dynamic host configuratin identifier + NS_T_NSEC3 = 50; // Negative security type 3 + NS_T_NSEC3PARAM = 51; // Negative security type 3 parameters + NS_T_HIP = 55; // Host Identity Protocol + NS_T_SPF = 99; // Sender Policy Framework + NS_T_TKEY = 249; // Transaction key + NS_T_TSIG = 250; // Transaction signature. + NS_T_IXFR = 251; // Incremental zone transfer. + NS_T_AXFR = 252; // Transfer zone of authority. + NS_T_MAILB = 253; // Transfer mailbox records. + NS_T_MAILA = 254; // Transfer mail agent records. + NS_T_ANY = 255; // Wildcard match. + NS_T_ZXFR = 256; // BIND-specific, nonstandard. + NS_T_DLV = 32769; // DNSSEC look-aside validatation. + NS_T_MAX = 65536; +} + +enum IpVersion { + IV_UNKNOWN = 0; + IV_IPV4 = 1; + IV_IPV6 = 2; +} + +enum Protocol { + PROTO_UNKNOWN = 0; + PROTO_UDP = 1; + PROTO_TCP = 2; + PROTO_DOT = 3; +} + +enum PrivateDnsModes { + PDM_UNKNOWN = 0; + PDM_OFF = 1; + PDM_OPPORTUNISTIC = 2; + PDM_STRICT = 3; +} + +enum NetworkType { + NT_UNKNOWN = 0; + // Indicates this network uses a Cellular transport. + NT_CELLULAR = 1; + // Indicates this network uses a Wi-Fi transport. + NT_WIFI = 2; + // Indicates this network uses a Bluetooth transport. + NT_BLUETOOTH = 3; + // Indicates this network uses an Ethernet transport. + NT_ETHERNET = 4; + // Indicates this network uses a VPN transport. + NT_VPN = 5; + // Indicates this network uses a Wi-Fi Aware transport. + NT_WIFI_AWARE = 6; + // Indicates this network uses a LoWPAN transport. + NT_LOWPAN = 7; +} + +enum CacheStatus{ + // the cache can't handle that kind of queries. + // or the answer buffer is too small. + CS_UNSUPPORTED = 0; + // the cache doesn't know about this query. + CS_NOTFOUND = 1; + // the cache found the answer. + CS_FOUND = 2; + // Don't do anything on cache. + CS_SKIP = 3; +} + +message DnsQueryEvent { + optional android.stats.dnsresolver.NsRcode rcode = 1; + + optional android.stats.dnsresolver.NsType type = 2; + + optional android.stats.dnsresolver.CacheStatus cache_hit = 3; + + optional android.stats.dnsresolver.IpVersion ip_version = 4; + + optional android.stats.dnsresolver.Protocol protocol = 5; + + // Number of DNS query retry times + optional int32 retry_times = 6; + + // Ordinal number of name server. + optional int32 dns_server_index = 7; + + // Used only by TCP and DOT. True for new connections. + optional bool connected = 8; + + optional int32 latency_micros = 9; +} + +message DnsQueryEvents { + repeated DnsQueryEvent dns_query_event = 1; +} diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index a3fccd96f224..e7e20fc41eee 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -726,7 +726,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.SEND_SMS" @@ -740,7 +740,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_SMS" @@ -754,7 +754,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.READ_SMS" @@ -768,7 +768,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_WAP_PUSH" @@ -782,7 +782,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.RECEIVE_MMS" @@ -805,7 +805,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. @hide Pending API council approval --> @@ -851,7 +851,7 @@ targetSdkVersion}</a> is 4 or higher. <p> This is a soft restricted permission which cannot be held by an app it its - full form until the installer on record did not whitelist the permission. + full form until the installer on record whitelists the permission. Specifically, if the permission is whitelisted the holder app can access external storage and the visual and aural media collections while if the permission is not whitelisted the holder app can only access to the visual @@ -859,7 +859,7 @@ meaning that the whitelist state can be specified only at install time and cannot change until the app is installed. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. - --> + <p>Protection level: dangerous --> <permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:permissionGroup="android.permission-group.UNDEFINED" android:label="@string/permlab_sdcardRead" @@ -880,8 +880,9 @@ read/write files in your application-specific directories returned by {@link android.content.Context#getExternalFilesDir} and {@link android.content.Context#getExternalCacheDir}. - <p>Is this permission is not whitelisted for an app that targets an API level before + <p>If this permission is not whitelisted for an app that targets an API level before {@link android.os.Build.VERSION_CODES#Q} this permission cannot be granted to apps.</p> + <p>Protection level: dangerous</p> --> <permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:permissionGroup="android.permission-group.UNDEFINED" @@ -891,7 +892,8 @@ android:protectionLevel="dangerous" /> <!-- Allows an application to access any geographic locations persisted in the - user's shared collection. --> + user's shared collection. + <p>Protection level: dangerous --> <permission android:name="android.permission.ACCESS_MEDIA_LOCATION" android:permissionGroup="android.permission-group.UNDEFINED" android:label="@string/permlab_mediaLocation" @@ -948,7 +950,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" @@ -994,7 +996,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.READ_CALL_LOG" @@ -1018,7 +1020,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. --> <permission android:name="android.permission.WRITE_CALL_LOG" @@ -1034,7 +1036,7 @@ <p>Protection level: dangerous <p> This is a hard restricted permission which cannot be held by an app until - the installer on record did not whitelist the permission. For more details see + the installer on record whitelists the permission. For more details see {@link android.content.pm.PackageInstaller.SessionParams#setWhitelistedRestrictedPermissions(Set)}. @deprecated Applications should use {@link android.telecom.CallRedirectionService} instead @@ -1711,7 +1713,7 @@ <!-- Allows applications to pair bluetooth devices without user interaction, and to allow or disallow phonebook access or message access. - This is not available to third party applications. --> + <p>Not for use by third-party applications. --> <permission android:name="android.permission.BLUETOOTH_PRIVILEGED" android:protectionLevel="signature|privileged" /> @@ -2561,7 +2563,8 @@ android:protectionLevel="signature" /> <!-- Allows an application to modify the current configuration, such - as locale. --> + as locale. + <p>Protection level: signature|privileged|development --> <permission android:name="android.permission.CHANGE_CONFIGURATION" android:protectionLevel="signature|privileged|development" /> @@ -2860,7 +2863,8 @@ <!-- ==================================== --> <eat-comment /> - <!-- Allows access to the list of accounts in the Accounts Service. --> + <!-- Allows access to the list of accounts in the Accounts Service. + <p>Protection level: signature|privileged --> <permission android:name="android.permission.GET_ACCOUNTS_PRIVILEGED" android:protectionLevel="signature|privileged" /> @@ -3439,7 +3443,8 @@ android:protectionLevel="signature" /> <!-- Old permission for deleting an app's cache files, no longer used, - but signals for us to quietly ignore calls instead of throwing an exception. --> + but signals for us to quietly ignore calls instead of throwing an exception. + <p>Protection level: signature|privileged --> <permission android:name="android.permission.DELETE_CACHE_FILES" android:protectionLevel="signature|privileged" /> @@ -3797,7 +3802,8 @@ <!-- Allows an application to collect component usage statistics <p>Declaring the permission implies intention to use the API and the user of the - device can grant permission through the Settings application. --> + device can grant permission through the Settings application. + <p>Protection level: signature|privileged|development|appop --> <permission android:name="android.permission.PACKAGE_USAGE_STATS" android:protectionLevel="signature|privileged|development|appop" /> <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" /> @@ -3820,14 +3826,14 @@ <!-- Permission an application must hold in order to use {@link android.provider.Settings#ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS}. - This is a normal permission: an app requesting it will always be granted the - permission, without the user needing to approve or see it. --> + <p>Protection level: normal --> <permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" android:label="@string/permlab_requestIgnoreBatteryOptimizations" android:description="@string/permdesc_requestIgnoreBatteryOptimizations" android:protectionLevel="normal" /> - <!-- Allows an application to collect battery statistics --> + <!-- Allows an application to collect battery statistics + <p>Protection level: signature|privileged|development --> <permission android:name="android.permission.BATTERY_STATS" android:protectionLevel="signature|privileged|development" /> @@ -3857,7 +3863,8 @@ android:protectionLevel="signature" /> <!-- Must be required by a {@link android.widget.RemoteViewsService}, - to ensure that only the system can bind to it. --> + to ensure that only the system can bind to it. + <p>Protection level: signature|privileged --> <permission android:name="android.permission.BIND_REMOTEVIEWS" android:protectionLevel="signature|privileged" /> @@ -3899,7 +3906,8 @@ to the path in the provider where global search queries are performed. This permission can not be held by regular applications; it is used by applications to protect themselves from everyone else - besides global search. --> + besides global search. + <p>Protection level: signature|privileged --> <permission android:name="android.permission.GLOBAL_SEARCH" android:protectionLevel="signature|privileged" /> @@ -4438,7 +4446,8 @@ <permission android:name="android.permission.MODIFY_THEME_OVERLAY" android:protectionLevel="signature" /> - <!-- Allows an instant app to create foreground services. --> + <!-- Allows an instant app to create foreground services. + <p>Protection level: signature|development|instant|appop --> <permission android:name="android.permission.INSTANT_APP_FOREGROUND_SERVICE" android:protectionLevel="signature|development|instant|appop" /> @@ -4508,7 +4517,8 @@ <permission android:name="android.permission.MONITOR_DEFAULT_SMS_PACKAGE" android:protectionLevel="signature|privileged" /> - <!-- A subclass of {@link android.service.carrier.CarrierMessagingClientService} must be protected with this permission. --> + <!-- A subclass of {@link android.service.carrier.CarrierMessagingClientService} must be protected with this permission. + <p>Protection level: signature --> <permission android:name="android.permission.BIND_CARRIER_MESSAGING_CLIENT_SERVICE" android:protectionLevel="signature" /> @@ -4540,13 +4550,15 @@ <permission android:name="android.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS" android:protectionLevel="signature" /> - <!-- Allows financial apps to read filtered sms messages. --> + <!-- Allows financial apps to read filtered sms messages. + Protection level: signature|appop --> <permission android:name="android.permission.SMS_FINANCIAL_TRANSACTIONS" android:protectionLevel="signature|appop" /> <!-- Required for apps targeting {@link android.os.Build.VERSION_CODES#Q} that want to use {@link android.app.Notification.Builder#setFullScreenIntent notification full screen - intents}. --> + intents}. + <p>Protection level: normal --> <permission android:name="android.permission.USE_FULL_SCREEN_INTENT" android:protectionLevel="normal" /> diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml index 0816cc0cb594..10e851b3d630 100644 --- a/core/res/res/values-af/strings.xml +++ b/core/res/res/values-af/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Stemboodskappe"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-oproepe"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM-status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Hoëprioriteit-SIM-status"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Ander party het TTY-modus VOL versoek"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Ander party het TTY-modus GOD versoek"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Ander party het TTY-modus SOD versoek"</string> diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml index 9ab7a53e3ab8..06654c4590ea 100644 --- a/core/res/res/values-am/strings.xml +++ b/core/res/res/values-am/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"የድምጽ መልዕክቶች"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"የWi-Fi ጥሪ"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"የሲም ሁኔታ"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"ከፍተኛ ቅድሚያ ተሰጪ የሲም ኹናቴ"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"ቢጤ መልዕክት መጻጻፊያ ስልክ ሁነታ FULL ጠይቋል"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"ቢጤ መልዕክት መጻጻፊያ ስልክ ሁነታ HCO ጠይቋል"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"ቢጤ መልዕክት መጻጻፊያ ስልክ ሁነታ VCO ጠይቋል"</string> diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml index 375592a9f52f..deb815cf42ea 100644 --- a/core/res/res/values-ar/strings.xml +++ b/core/res/res/values-ar/strings.xml @@ -99,6 +99,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"رسائل البريد الصوتي"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"الاتصال عبر Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"حالة شريحة SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"حالة شريحة SIM ذات أولوية"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"طلب النظير وضع TTY الكامل"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"طلب النظير وضع TTY على HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"طلب النظير وضع TTY على VCO"</string> diff --git a/core/res/res/values-as/strings.xml b/core/res/res/values-as/strings.xml index 698921978c54..c53af2b3fa7e 100644 --- a/core/res/res/values-as/strings.xml +++ b/core/res/res/values-as/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ভইচমেইলৰ বাৰ্তাসমূহ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"ৱাই-ফাই কলিং"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"ছিমৰ স্থিতি"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"উচ্চ অগ্ৰাধিকাৰযুক্ত ছিমৰ স্থিতি"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"নেটৱৰ্ক পীয়েৰে TTY ম\'ড FULLলৈ সলনি কৰিবলৈ অনুৰোধ কৰিছে"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"নেটৱৰ্ক পীয়েৰে TTY ম\'ড HCOলৈ সলনি কৰিবলৈ অনুৰোধ কৰিছে"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"নেটৱৰ্ক পীয়েৰে TTY ম\'ড VCO লৈ সলনি কৰিবলৈ অনুৰোধ কৰিছে"</string> diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml index 7a3cc7aaef5b..a3a2f2a0ecff 100644 --- a/core/res/res/values-az/strings.xml +++ b/core/res/res/values-az/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Səsli e-poçt mesajları"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi zəngi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Yüksək Prioritetli SIM statusu"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Eskpert TTY Rejimi FULL-u sorğuladı"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Ekspert TTY Rejimi HCO-nu sorğuladı"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Ekspert TTY Rejimi VCO-nu sorğuladı"</string> diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml index 93d87fe2b303..61a2167b8860 100644 --- a/core/res/res/values-b+sr+Latn/strings.xml +++ b/core/res/res/values-b+sr+Latn/strings.xml @@ -96,6 +96,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Poruke govorne pošte"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Pozivanje preko Wi-Fi mreže"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status SIM-a"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Obaveštenja SIM kartice sa statusom „visok prioritet“"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Korisnik zahteva POTPUN režim TTY"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Korisnik zahteva PRENOS ZVUKA za režim TTY"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Korisnik zahteva PRENOS GLASA za režim TTY"</string> diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml index 6823c44b21f8..cb6b3707b355 100644 --- a/core/res/res/values-be/strings.xml +++ b/core/res/res/values-be/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Паведамленні галасавой пошты"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-тэлефанія"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Статус SIM-карты"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Стан SIM-карты з высокім прыярытэтам"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Аднарангавая прылада запытала рэжым TTY FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Аднарангавая прылада запытала рэжым TTY НСО"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Аднарангавая прылада запытала рэжым TTY VCO"</string> diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml index b41d69d3f32c..7c44bcaedd93 100644 --- a/core/res/res/values-bg/strings.xml +++ b/core/res/res/values-bg/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Съобщения в гласовата поща"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Обаждания през Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Състояние на SIM картата"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Състояние на SIM картата с висок приоритет"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Отсрещният потребител заяви пълен TTY режим (FULL)"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Отсрещният потребител заяви TTY режим с пренос на слух (HCO)"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Отсрещният потребител заяви TTY режим с пренос на глас (VCО)"</string> diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml index 1889519ecd85..3d834d5922a6 100644 --- a/core/res/res/values-bn/strings.xml +++ b/core/res/res/values-bn/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ভয়েসমেল মেসেজ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"ওয়াই-ফাই কলিং"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"সিম কার্ডের স্টাটাস"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"উচ্চ প্রায়রিটি সিম স্ট্যাটাস"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"পির TTY মোড FULL অনুরোধ করেছে"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"পির TTY মোড HCO অনুরোধ করেছে"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"পির TTY মোড VCO অনুরোধ করেছে"</string> diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml index cd0a1d5aaf7e..572b8eaec5eb 100644 --- a/core/res/res/values-bs/strings.xml +++ b/core/res/res/values-bs/strings.xml @@ -96,6 +96,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Poruke govorne pošte"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Pozivanje putem WiFi-ja"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status SIM-a"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Status visokog prioriteta SIM-a"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Ravnopravni uređaj zatražio načina rada TTY FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Ravnopravni uređaj zatražio načina rada TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Ravnopravni uređaj zatražio načina rada TTY VCO"</string> diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml index b13f506da65f..f4b341c2283d 100644 --- a/core/res/res/values-ca/strings.xml +++ b/core/res/res/values-ca/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Missatges de veu"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Trucades per Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Estat de la SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Estat de la SIM d\'alta prioritat"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"L\'altre dispositiu ha sol·licitat el mode TTY COMPLET."</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"L\'altre dispositiu ha sol·licitat el mode TTY HCO."</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"L\'altre dispositiu ha sol·licitat el mode TTY VCO."</string> @@ -572,9 +573,9 @@ <string name="face_acquired_recalibrate" msgid="8077949502893707539">"Torna a registrar la teva cara."</string> <string name="face_acquired_too_different" msgid="7663983770123789694">"Ja no es reconeix la teva cara. Torna-ho a provar."</string> <string name="face_acquired_too_similar" msgid="1508776858407646460">"És massa semblant; canvia de postura."</string> - <string name="face_acquired_pan_too_extreme" msgid="4581629343077288178">"Inclina el cap una mica menys."</string> - <string name="face_acquired_tilt_too_extreme" msgid="4019954263012496468">"Inclina el cap una mica menys."</string> - <string name="face_acquired_roll_too_extreme" msgid="6312973147689664409">"No inclinis tant el cap."</string> + <string name="face_acquired_pan_too_extreme" msgid="4581629343077288178">"No giris tant el cap."</string> + <string name="face_acquired_tilt_too_extreme" msgid="4019954263012496468">"No inclinis tant el cap."</string> + <string name="face_acquired_roll_too_extreme" msgid="6312973147689664409">"No giris tant el cap."</string> <string name="face_acquired_obscured" msgid="5357207702967893283">"Suprimeix qualsevol cosa que amagui la teva cara."</string> <string name="face_acquired_sensor_dirty" msgid="7905138627046865579">"Neteja la part superior de la pantalla, inclosa la barra negra"</string> <string-array name="face_acquired_vendor"> @@ -1482,7 +1483,7 @@ <string name="back_button_label" msgid="2300470004503343439">"Enrere"</string> <string name="next_button_label" msgid="1080555104677992408">"Següent"</string> <string name="skip_button_label" msgid="1275362299471631819">"Omet"</string> - <string name="no_matches" msgid="8129421908915840737">"Cap coincidència"</string> + <string name="no_matches" msgid="8129421908915840737">"No s\'ha trobat cap coincidència"</string> <string name="find_on_page" msgid="1946799233822820384">"Troba-ho a la pàgina"</string> <plurals name="matches_found" formatted="false" msgid="1210884353962081884"> <item quantity="other"><xliff:g id="INDEX">%d</xliff:g> de <xliff:g id="TOTAL">%d</xliff:g></item> diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml index a9413bdfaaba..d0d060723572 100644 --- a/core/res/res/values-cs/strings.xml +++ b/core/res/res/values-cs/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Hlasové zprávy"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Volání přes Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Stav SIM karty"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Stav SIM karty: vysoká priorita"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Partner požádal o přechod na režim TTY FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Partner požádal o přechod na režim TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Partner požádal o přechod na režim TTY VCO"</string> diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml index 76dea804a645..ee5597f289bc 100644 --- a/core/res/res/values-da/strings.xml +++ b/core/res/res/values-da/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Talebeskeder"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-opkald"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM-status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"SIM-kort med høj prioritet"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Den anden enhed har skiftet til FULD TTY-tilstand"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Den anden enhed har skiftet til TTY-tilstanden HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Den anden enhed har skiftet til TTY-tilstanden VCO"</string> diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml index 754b01965ed2..ebca5d4faf2e 100644 --- a/core/res/res/values-de/strings.xml +++ b/core/res/res/values-de/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mailboxnachrichten"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"WLAN-Telefonie"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status der SIM-Karte"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Benachrichtigungen mit hoher Priorität von der SIM-Karte"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer hat TTY-Modus \"Vollständig\" angefordert."</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer hat TTY-Modus \"HCO\" angefordert."</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer hat TTY-Modus \"VC\" angefordert."</string> diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml index 6d1306f4102f..d74bc5951d5e 100644 --- a/core/res/res/values-el/strings.xml +++ b/core/res/res/values-el/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Μηνύματα αυτόματου τηλεφωνητή"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Κλήση Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Κατάσταση SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Κατάσταση SIM υψηλής προτεραιότητας"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Αίτημα peer για TTY ΠΛΗΡΗΣ Λειτουργία"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Αίτημα peer για TTY Λειτουργία HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Αίτημα peer για TTY Λειτουργία VCO"</string> diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml index c2a22ad2c466..f5a5698b5b61 100644 --- a/core/res/res/values-en-rAU/strings.xml +++ b/core/res/res/values-en-rAU/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Voicemail messages"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi Calling"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"High priority SIM status"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer requested TTY Mode FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer requested TTY Mode HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer requested TTY Mode VCO"</string> diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml index 6cf284320cdb..47318862c76f 100644 --- a/core/res/res/values-en-rCA/strings.xml +++ b/core/res/res/values-en-rCA/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Voicemail messages"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi Calling"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"High priority SIM status"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer requested TTY Mode FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer requested TTY Mode HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer requested TTY Mode VCO"</string> diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml index c2a22ad2c466..f5a5698b5b61 100644 --- a/core/res/res/values-en-rGB/strings.xml +++ b/core/res/res/values-en-rGB/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Voicemail messages"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi Calling"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"High priority SIM status"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer requested TTY Mode FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer requested TTY Mode HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer requested TTY Mode VCO"</string> diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml index c2a22ad2c466..f5a5698b5b61 100644 --- a/core/res/res/values-en-rIN/strings.xml +++ b/core/res/res/values-en-rIN/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Voicemail messages"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi Calling"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"High priority SIM status"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer requested TTY Mode FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer requested TTY Mode HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer requested TTY Mode VCO"</string> diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml index f62b3857b930..95ebcdc8c603 100644 --- a/core/res/res/values-en-rXC/strings.xml +++ b/core/res/res/values-en-rXC/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Voicemail messages"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi calling"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"High priority SIM status"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer requested TTY Mode FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer requested TTY Mode HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer requested TTY Mode VCO"</string> diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml index 5128f67bfb2c..7a22a8e454a1 100644 --- a/core/res/res/values-es-rUS/strings.xml +++ b/core/res/res/values-es-rUS/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensajes del buzón de voz"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Llamada con Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Estado de SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Notificaciones de prioridad alta sobre el estado de la SIM"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"El dispositivo del mismo nivel solicitó el modo TTY FULL."</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"El dispositivo del mismo nivel solicitó el modo TTY HCO."</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"El dispositivo del mismo nivel solicitó el modo TTY VCO."</string> diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml index 608a8515bcc3..ae7f38a18986 100644 --- a/core/res/res/values-es/strings.xml +++ b/core/res/res/values-es/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensajes de voz"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Llamada por Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Estado de la tarjeta SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Estado de SIM de alta prioridad"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Un dispositivo ha solicitado el modo TTY FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Un dispositivo ha solicitado el modo TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Un dispositivo ha solicitado el modo TTY VCO"</string> diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml index a78178c8fbf6..d3404a646301 100644 --- a/core/res/res/values-et/strings.xml +++ b/core/res/res/values-et/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Kõnepostisõnumid"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"WiFi-kõned"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM-kaardi olek"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Kõrge prioriteediga SIM-i olek"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Partner taotles TTY-režiimi TÄIELIK"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Partner taotles TTY-režiimi HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Partner taotles TTY-režiimi VCO"</string> diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml index fb79545da1ce..a2a1b37118ec 100644 --- a/core/res/res/values-eu/strings.xml +++ b/core/res/res/values-eu/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Erantzungailuko mezuak"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi bidezko deiak"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIMaren egoera"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"SIM txartelaren lehentasun handiko jakinarazpenak"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Beste gailuak TTY osagarria FULL moduan erabiltzea eskatu du"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Beste gailuak TTY osagarria HCO moduan erabiltzea eskatu du"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Beste gailuak TTY osagarria VCO moduan erabiltzea eskatu du"</string> diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml index f79628756a02..7d86be9a8ecd 100644 --- a/core/res/res/values-fa/strings.xml +++ b/core/res/res/values-fa/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"پیامهای پست صوتی"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"تماس ازطریق Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"وضعیت سیمکارت"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"وضعیت سیم با اولویت بالا"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"دستگاه مرتبط درخواست TTY حالت FULL کرد"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"دستگاه مرتبط درخواست TTY حالت HCO کرد"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"دستگاه مرتبط درخواست TTY حالت VCO کرد"</string> diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml index 0b86b22ccb1e..0a6132d10a85 100644 --- a/core/res/res/values-fi/strings.xml +++ b/core/res/res/values-fi/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Vastaajaviestit"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-puhelut"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM-kortin tila"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Tärkeät SIM-ilmoitukset"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Toinen käyttäjä vaihtoi TTY-tilaksi TÄYSI"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Toinen käyttäjä vaihtoi TTY-tilaksi HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Toinen käyttäjä vaihtoi TTY-tilaksi VCO"</string> diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml index ca9121d470d3..8d12675b833d 100644 --- a/core/res/res/values-fr-rCA/strings.xml +++ b/core/res/res/values-fr-rCA/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Messages vocaux"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Appels Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"État de la carte SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"État SIM de priorité élevée"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Mode TTY COMPLET demandé par un pair"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Mode TTY HCO demandé par un pair"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Mode TTY VCO demandé par un pair"</string> diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml index ab1a928c15ad..c1cac17bbb74 100644 --- a/core/res/res/values-fr/strings.xml +++ b/core/res/res/values-fr/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Messages vocaux"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Appels Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"État de la carte SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Notifications prioritaires de la carte SIM"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Mode TTY demandé par l\'interlocuteur : COMPLET"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Mode TTY demandé par l\'interlocuteur : HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Mode TTY demandé par l\'interlocuteur : VCO"</string> diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml index 7a1b2659f4a2..6bdf045de2b6 100644 --- a/core/res/res/values-gl/strings.xml +++ b/core/res/res/values-gl/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensaxes de correo de voz"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Chamadas por wifi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Estado da SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Estado da SIM con prioridade alta"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Outro dispositivo solicitou o modo TTY COMPLETO"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Outro dispositivo solicitou o modo TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Outro dispositivo solicitou o modo TTY VCO"</string> diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml index 880454a9cd5b..b2a9e781e2aa 100644 --- a/core/res/res/values-gu/strings.xml +++ b/core/res/res/values-gu/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"વૉઇસમેઇલ સંદેશા"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"વાઇ-ફાઇ કૉલિંગ"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"સિમનું સ્ટેટસ"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"સિમ કાર્ડનું ઉચ્ચ પ્રાધાન્યતાનું સ્ટેટસ"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"પીઅરે TTY મોડ પૂર્ણની વિનંતી કરી"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"પીઅરે TTY મોડ HCO ની વિનંતી કરી"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"પીઅરે TTY મોડ VCO ની વિનંતી કરી"</string> diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml index 7dc0b92437e2..e1bfe5eb2721 100644 --- a/core/res/res/values-hi/strings.xml +++ b/core/res/res/values-hi/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"वॉइसमेल संदेश"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"वाई-फ़ाई कॉलिंग"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"सिम की स्थिति"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"सिम की ज़रूरी सूचनाओं की स्थिति"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"पीयर ने टेलीटाइपराइटर (TTY) मोड फ़ुल का अनुरोध किया"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"पीयर ने टेलीटाइपराइटर (TTY) मोड एचसीओ (HCO) का अनुरोध किया"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"पीयर ने टेलीटाइपराइटर (TTY) मोड वीसीओ (VCO) का अनुरोध किया"</string> @@ -281,9 +282,9 @@ <string name="permgrouprequest_contacts" msgid="6032805601881764300">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को अपने संपर्क देखने की अनुमति देना चाहते हैं?"</string> <string name="permgrouplab_location" msgid="7275582855722310164">"जगह"</string> <string name="permgroupdesc_location" msgid="1346617465127855033">"इस डिवाइस की जगह तक पहुंचने दें"</string> - <string name="permgrouprequest_location" msgid="3788275734953323491">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को इस डिवाइस की \'जगह की जानकारी\' एक्सेस करने की अनुमति देना चाहते हैं?"</string> + <string name="permgrouprequest_location" msgid="3788275734953323491">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को इस डिवाइस की \'जगह की जानकारी\' ऐक्सेस करने की अनुमति देना चाहते हैं?"</string> <string name="permgrouprequestdetail_location" msgid="1347189607421252902">"ऐप्लिकेशन, डिवाइस की जगह की जानकारी सिर्फ़ तभी देख पाएगा जब आप इसका इस्तेमाल कर रहे हों"</string> - <string name="permgroupbackgroundrequest_location" msgid="5039063878675613235">"क्या आप <xliff:g id="APP_NAME">%1$s</xliff:g> को हमेशा के लिए जगह की जानकारी एक्सेस करने की अनुमति देना चाहते हैं?"</string> + <string name="permgroupbackgroundrequest_location" msgid="5039063878675613235">"क्या आप <xliff:g id="APP_NAME">%1$s</xliff:g> को हमेशा के लिए जगह की जानकारी ऐक्सेस करने की अनुमति देना चाहते हैं?"</string> <string name="permgroupbackgroundrequestdetail_location" msgid="4597006851453417387">"इस समय ऐप्लिकेशन, डिवाइस की \'जगह की जानकारी\' सिर्फ़ तभी देख पाएगा जब आप इसका इस्तेमाल कर रहे हों"</string> <string name="permgrouplab_calendar" msgid="5863508437783683902">"कैलेंडर"</string> <string name="permgroupdesc_calendar" msgid="3889615280211184106">"अपने कैलेंडर को ऐक्सेस करने"</string> @@ -293,7 +294,7 @@ <string name="permgrouprequest_sms" msgid="7168124215838204719">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को एसएमएस (मैसेज) भेजने और देखने की अनुमति देना चाहते हैं?"</string> <string name="permgrouplab_storage" msgid="1971118770546336966">"मेमोरी"</string> <string name="permgroupdesc_storage" msgid="637758554581589203">"अपने डिवाइस पर मौजूद फ़ोटो, मीडिया और फ़ाइलें ऐक्सेस करने की"</string> - <string name="permgrouprequest_storage" msgid="7885942926944299560">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को डिवाइस पर मौजूद फ़ोटो, ऑडियो-वीडियो और फ़ाइलें एक्सेस करने की अनुमति दें?"</string> + <string name="permgrouprequest_storage" msgid="7885942926944299560">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को डिवाइस पर मौजूद फ़ोटो, ऑडियो-वीडियो और फ़ाइलें ऐक्सेस करने की अनुमति दें?"</string> <string name="permgrouplab_microphone" msgid="171539900250043464">"माइक्रोफ़ोन"</string> <string name="permgroupdesc_microphone" msgid="4988812113943554584">"ऑडियो रिकॉर्ड करें"</string> <string name="permgrouprequest_microphone" msgid="9167492350681916038">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को ऑडियो रिकॉर्ड करने की अनुमति देना चाहते हैं?"</string> @@ -305,7 +306,7 @@ <string name="permgrouprequest_camera" msgid="1299833592069671756">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को फ़ोटो खींचने और वीडियो रिकॉर्ड करने की अनुमति देना चाहते हैं?"</string> <string name="permgrouplab_calllog" msgid="8798646184930388160">"कॉल लॉग"</string> <string name="permgroupdesc_calllog" msgid="3006237336748283775">"कॉल लॉग की जानकारी देखना और उसमें बदलाव करना"</string> - <string name="permgrouprequest_calllog" msgid="8487355309583773267">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को अपने काॅल लाॅग एक्सेस करने की मंज़ूरी देना चाहते हैं?"</string> + <string name="permgrouprequest_calllog" msgid="8487355309583773267">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को अपने काॅल लाॅग ऐक्सेस करने की मंज़ूरी देना चाहते हैं?"</string> <string name="permgrouplab_phone" msgid="5229115638567440675">"फ़ोन"</string> <string name="permgroupdesc_phone" msgid="6234224354060641055">"फ़ोन कॉल करने और उन्हें प्रबंधित करने की अनुमति दें"</string> <string name="permgrouprequest_phone" msgid="9166979577750581037">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> को फ़ोन कॉल करने और उन्हें प्रबंधित करने की अनुमति दें?"</string> @@ -339,22 +340,22 @@ <string name="permlab_answerPhoneCalls" msgid="4077162841226223337">"फ़ोन कॉल का जवाब दें"</string> <string name="permdesc_answerPhoneCalls" msgid="2901889867993572266">"ऐप्लिकेशन को किसी इनकमिंग फ़ोन कॉल का जवाब देने देती है."</string> <string name="permlab_receiveSms" msgid="8673471768947895082">"मैसेज (एसएमएस) पाएं"</string> - <string name="permdesc_receiveSms" msgid="6424387754228766939">"ऐप को मैसेज (एसएमएस) को प्राप्त और संसाधित करने देता है. इसका अर्थ है कि ऐप आपके डिवाइस पर भेजे गए संदेशों की निगरानी आपको दिखाए बिना कर सकता है और उन्हें हटा सकता है."</string> + <string name="permdesc_receiveSms" msgid="6424387754228766939">"एप्लिकेशन को मैसेज (एसएमएस) पाने और प्रोसेस करने देता है. इसका मतलब है कि एप्लिकेशन आपके डिवाइस पर भेजे गए मैसेज की निगरानी आपको दिखाए बिना कर सकता है और उन्हें हटा सकता है."</string> <string name="permlab_receiveMms" msgid="1821317344668257098">"मैसेज (एमएमएस) पाएं"</string> <string name="permdesc_receiveMms" msgid="533019437263212260">"ऐप को मल्टीमीडिया मैसेज (एमएमएस) को पाने और उन पर कार्रवाई करने देता है. इसका मतलब है कि ऐप आपके डिवाइस पर भेजे गए मैसेज की निगरानी आपको दिखाए बिना कर सकता है और उन्हें हटा सकता है."</string> <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"सेल ब्रॉडकास्ट (CBC) मैसेज पढ़ें"</string> <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"ऐप को, वो सेल ब्रॉडकास्ट (CBC) मैसेज पढ़ने देता है जो आपके डिवाइस को मिले हैं. सेल ब्रॉडकास्ट (CBC) अलर्ट कुछ स्थानों (लोकेशन) पर आपको आपातकालीन स्थितियों की चेतावनी देने के लिए दिए जाते हैं. आपातकालीन सेल ब्रॉडकास्ट (CBC) मिलने पर, धोखा देने वाले ऐप आपके डिवाइस के परफ़ॉर्मेंस या कार्यवाही में दखल दे सकते हैं."</string> - <string name="permlab_subscribedFeedsRead" msgid="4756609637053353318">"सदस्यता-प्राप्त फ़ीड पढ़ें"</string> - <string name="permdesc_subscribedFeedsRead" msgid="5557058907906144505">"ऐप्स को वर्तमान में समन्वयित फ़ीड के बारे में विवरण प्राप्त करने देता है."</string> + <string name="permlab_subscribedFeedsRead" msgid="4756609637053353318">"सदस्यता वाली फ़ीड पढ़ें"</string> + <string name="permdesc_subscribedFeedsRead" msgid="5557058907906144505">"एप्लिकेशन को मौजूदा समय में सिंक फ़ीड के बारे में जानकारी देता है."</string> <string name="permlab_sendSms" msgid="7544599214260982981">"मैसेज (एमएमएस) भेजें और देखें"</string> <string name="permdesc_sendSms" msgid="7094729298204937667">"ऐप को मैसेज (एसएमएस) भेजने देता है. इसकी वजह से उम्मीद से ज़्यादा शुल्क लग सकते हैं. धोखा देने वाले ऐप आपकी पुष्टि के बिना मैसेज भेजकर आपका पैसा खर्च करवा सकते हैं."</string> <string name="permlab_readSms" msgid="8745086572213270480">"अपने मैसेज (एसएमएस या एमएमएस) पढ़ें"</string> <string name="permdesc_readSms" product="tablet" msgid="4741697454888074891">"यह ऐप आपके टैबलेट पर सहेजे गए सभी मैसेज (एसएमएस) पढ़ सकता है."</string> <string name="permdesc_readSms" product="tv" msgid="5796670395641116592">"यह ऐप आपके टीवी पर सहेजे गए सभी मैसेज (एसएमएस) पढ़ सकता है."</string> <string name="permdesc_readSms" product="default" msgid="6826832415656437652">"यह ऐप आपके फ़ोन पर सहेजे गए सभी मैसेज (एसएमएस) पढ़ सकता है."</string> - <string name="permlab_receiveWapPush" msgid="5991398711936590410">"लेख संदेश (WAP) प्राप्त करें"</string> - <string name="permdesc_receiveWapPush" msgid="748232190220583385">"ऐप्स को WAP संदेशों को प्राप्त और संसाधित करने देता है. इस अनुमति में आपको भेजे गए संदेशों की निगरानी आपको दिखाए बिना करने और हटाने की क्षमता शामिल है."</string> - <string name="permlab_getTasks" msgid="6466095396623933906">"चल रहे ऐप्स पुनर्प्राप्त करें"</string> + <string name="permlab_receiveWapPush" msgid="5991398711936590410">"टेक्सट मैसेज (WAP) पाएं"</string> + <string name="permdesc_receiveWapPush" msgid="748232190220583385">"एप्लिकेशन को WAP मैसेज पाने और प्रोसेस करने देता है. इस अनुमति में आपको भेजे गए मैसेज की निगरानी आपको दिए एप्लिकेशन को दिखाए बिना करने और हटाने की क्षमता शामिल है."</string> + <string name="permlab_getTasks" msgid="6466095396623933906">"चल रहे ऐप्स फिर से पाएं"</string> <string name="permdesc_getTasks" msgid="7454215995847658102">"ऐप को माजूदा समय में और हाल ही में चल रही कार्रवाइयों के बारे में जानकारी निकालने देता है. इससे ऐप डिवाइस पर इस्तेमाल किए गए ऐप के बारे में जानकारी खोज सकता है."</string> <string name="permlab_manageProfileAndDeviceOwners" msgid="7918181259098220004">"प्रोफ़ाइल और डिवाइस स्वामियों को प्रबंधित करें"</string> <string name="permdesc_manageProfileAndDeviceOwners" msgid="106894851498657169">"ऐप्स को प्रोफ़ाइल स्वामी और डिवाइस स्वामी सेट करने दें."</string> @@ -402,7 +403,7 @@ <string name="permdesc_writeCallLog" product="tablet" msgid="6661806062274119245">"ऐप को आने वाला कॉल (इनकमिंग) और किया जाने वाला कॉल (आउटगोइंग) डेटा सहित, आपके टैबलेट के कॉल लॉग को बदलने की अनुमति देता है. धोखा देने वाले ऐप, इसका इस्तेमाल करके आपके कॉल लॉग को मिटा या बदल सकते हैं."</string> <string name="permdesc_writeCallLog" product="tv" msgid="4225034892248398019">"ऐप को आने वाला कॉल (इनकमिंग) और किया जाने वाला कॉल (आउटगोइंग) डेटा सहित, आपके टीवी के कॉल लॉग को बदलने की अनुमति देता है. धोखा देने वाले ऐप, इसका इस्तेमाल करके आपके कॉल लॉग को मिटा या बदल सकते हैं."</string> <string name="permdesc_writeCallLog" product="default" msgid="683941736352787842">"ऐप को आने वाला कॉल (इनकमिंग) और किया जाने वाला कॉल (आउटगोइंग) डेटा सहित, आपके फ़ोन के कॉल लॉग को बदलने की अनुमति देता है. धोखा देने वाले ऐप, इसका इस्तेमाल करके आपके कॉल लॉग को मिटा या बदल सकते हैं."</string> - <string name="permlab_bodySensors" msgid="4683341291818520277">"शरीर के लिए बने सेंसर (जैसे हृदय गति मॉनीटर) को एक्सेस करें"</string> + <string name="permlab_bodySensors" msgid="4683341291818520277">"शरीर के लिए बने सेंसर (जैसे हृदय गति मॉनीटर) को ऐक्सेस करें"</string> <string name="permdesc_bodySensors" product="default" msgid="4380015021754180431">"ऐप को आपकी शारीरिक स्थिति, जैसे आपकी हृदय गति पर नज़र रखने वाले सेंसर के डेटा तक पहुंचने देती है."</string> <string name="permlab_readCalendar" msgid="6716116972752441641">"कैलेंडर इवेंट और विवरण पढ़ें"</string> <string name="permdesc_readCalendar" product="tablet" msgid="4993979255403945892">"यह ऐप्लिकेशन आपके टैबलेट पर संग्रहित सभी कैलेंडर इवेंट पढ़ सकता है और आपका कैलेंडर डेटा शेयर कर सकता है या सहेज सकता है."</string> @@ -414,14 +415,14 @@ <string name="permdesc_writeCalendar" product="default" msgid="7592791790516943173">"यह ऐप्लिकेशन आपके फ़ोन पर मौजूद कैलेंडर इवेंट जोड़, निकाल या बदल सकता है. यह ऐप्लिकेशन ऐसे संदेश भेज सकता है जो कैलेंडर स्वामियों से आए हुए लग सकते हैं या यह स्वामियों को सूचित किए बिना इवेंट में बदलाव कर सकता है."</string> <string name="permlab_accessLocationExtraCommands" msgid="2836308076720553837">"कुछ और जगह बताने वाले आदेशों तक पहुंच"</string> <string name="permdesc_accessLocationExtraCommands" msgid="6078307221056649927">"ऐप को कुछ और जगह की जानकारी देने वाले आदेशों की पहुंच पाने देता है. इससे ऐप जीपीएस या जगह की जानकारी देने वाले दूसरे स्रोतों के काम में रोक-टोक कर सकता है."</string> - <string name="permlab_accessFineLocation" msgid="6265109654698562427">"ऐप्लिकेशन \'जगह की सटीक जानकारी\' सिर्फ़ सामने खुली होने पर एक्सेस करे"</string> + <string name="permlab_accessFineLocation" msgid="6265109654698562427">"ऐप्लिकेशन \'जगह की सटीक जानकारी\' सिर्फ़ सामने खुली होने पर ऐक्सेस करे"</string> <string name="permdesc_accessFineLocation" msgid="3520508381065331098">"यह ऐप्लिकेशन सिर्फ़ तब आपकी \'जगह की सटीक जानकारी\' का इस्तेमाल कर सकता है जब यह स्क्रीन पर दिखाई दे रहा हो. यह ज़रूरी है कि \'जगह की जानकारी\' वाली ये सेवाएं आपके फ़ोन में मौजूद हों और चालू की गई हों ताकि ऐप्लिकेशन उनका इस्तेमाल कर पाए. ऐसा करने से ज़्यादा बैटरी खर्च हो सकती है."</string> - <string name="permlab_accessCoarseLocation" msgid="3707180371693213469">"स्क्रीन पर दिखाई देते समय \'जगह की अनुमानित जानकारी\' (नेटवर्क-आधारित) एक्सेस करें"</string> + <string name="permlab_accessCoarseLocation" msgid="3707180371693213469">"स्क्रीन पर दिखाई देते समय \'जगह की अनुमानित जानकारी\' (नेटवर्क-आधारित) ऐक्सेस करें"</string> <string name="permdesc_accessCoarseLocation" product="tablet" msgid="8594719010575779120">"यह ऐप्लिकेशन सेल टावर और वाई-फ़ाई नेटवर्क जैसे नेटवर्क स्रोतों के आधार पर आपकी जगह का पता लगा सकता है, लेकिन सिर्फ़ तब, जब ऐप्लिकेशन स्क्रीन पर दिखाई दे रहा हो. यह ज़रूरी है कि \'जगह की जानकारी\' वाली ये सेवाएं आपके टैबलेट में मौजूद हों और चालू की गई हों ताकि ऐप्लिकेशन उनका इस्तेमाल कर पाए."</string> <string name="permdesc_accessCoarseLocation" product="tv" msgid="3027871910200890806">"यह ऐप्लिकेशन सेल टावर और वाई-फ़ाई नेटवर्क जैसे नेटवर्क स्रोतों के आधार पर आपकी जगह का पता लगा सकता है, लेकिन सिर्फ़ तब, जब ऐप्लिकेशन स्क्रीन पर दिखाई दे रहा हो. यह ज़रूरी है कि \'जगह की जानकारी\' वाली ये सेवाएं आपके टीवी पर मौजूद हों और चालू की गई हों ताकि ऐप्लिकेशन उनका इस्तेमाल कर पाए."</string> <string name="permdesc_accessCoarseLocation" product="default" msgid="854896049371048754">"यह ऐप्लिकेशन सेल टावर और वाई-फ़ाई नेटवर्क जैसे नेटवर्क स्रोतों के आधार पर आपकी जगह का पता लगा सकता है, लेकिन सिर्फ़ तब, जब ऐप्लिकेशन स्क्रीन पर दिखाई दे रहा हो. यह ज़रूरी है कि \'जगह की जानकारी\' वाली ये सेवाएं आपके फ़ोन में मौजूद हों और चालू की गई हों ताकि ऐप्लिकेशन उनका इस्तेमाल कर पाए."</string> - <string name="permlab_accessBackgroundLocation" msgid="3965397804300661062">"बैकग्राउंड में जगह की जानकारी एक्सेस करना"</string> - <string name="permdesc_accessBackgroundLocation" msgid="1096394429579210251">"अनुमानित या बिल्कुल सही जगह की जानकारी का एक्सेस करने की अनुमति अलग से दिए जाने पर, बैकग्राउंड में चलने के दौरान ऐप्लिकेशन आपकी जगह की जानकारी एक्सेस कर सकता है."</string> + <string name="permlab_accessBackgroundLocation" msgid="3965397804300661062">"बैकग्राउंड में जगह की जानकारी ऐक्सेस करना"</string> + <string name="permdesc_accessBackgroundLocation" msgid="1096394429579210251">"अनुमानित या बिल्कुल सही जगह की जानकारी का ऐक्सेस करने की अनुमति अलग से दिए जाने पर, बैकग्राउंड में चलने के दौरान ऐप्लिकेशन आपकी जगह की जानकारी ऐक्सेस कर सकता है."</string> <string name="permlab_modifyAudioSettings" msgid="6095859937069146086">"अपनी ऑडियो सेटिंग बदलें"</string> <string name="permdesc_modifyAudioSettings" msgid="3522565366806248517">"ऐप्स को वैश्विक ऑडियो सेटिंग, जैसे वॉल्यूम और कौन-सा स्पीकर आउटपुट के लिए उपयोग किया गया, संशोधित करने देता है."</string> <string name="permlab_recordAudio" msgid="3876049771427466323">"ऑडियो रिकॉर्ड करने"</string> @@ -450,7 +451,7 @@ <string name="permdesc_readPhoneNumbers" msgid="8559488833662272354">"ऐप को डिवाइस के फ़ोन नंबर का इस्तेमाल करने देती है."</string> <string name="permlab_wakeLock" product="tablet" msgid="1531731435011495015">"टैबलेट को सोने (कम बैटरी मोड) से रोकें"</string> <string name="permlab_wakeLock" product="tv" msgid="2601193288949154131">"टीवी को सोने (कम बैटरी मोड) से रोकें"</string> - <string name="permlab_wakeLock" product="default" msgid="573480187941496130">"टीवी को सोने (कम बैटरी मोड) से रोकें"</string> + <string name="permlab_wakeLock" product="default" msgid="573480187941496130">"फ़ोन को सोने (कम बैटरी मोड) से रोकें"</string> <string name="permdesc_wakeLock" product="tablet" msgid="7311319824400447868">"ऐप्स को टैबलेट को प्रयोग में नहीं हो जाने से रोकता है."</string> <string name="permdesc_wakeLock" product="tv" msgid="3208534859208996974">"ऐप को टीवी को सोने (कम बैटरी मोड) से रोकने की अनुमति देता है."</string> <string name="permdesc_wakeLock" product="default" msgid="8559100677372928754">"ऐप्स को फ़ोन को प्रयोग में नहीं होने से रोकता है."</string> @@ -467,9 +468,9 @@ <string name="permdesc_setTimeZone" product="tv" msgid="888864653946175955">"ऐप को टीवी का समय क्षेत्र बदलने देती है."</string> <string name="permdesc_setTimeZone" product="default" msgid="4499943488436633398">"ऐप्स को टैबलेट का समय क्षेत्र बदलने देता है."</string> <string name="permlab_getAccounts" msgid="1086795467760122114">"डिवाइस पर खाते ढूंढें"</string> - <string name="permdesc_getAccounts" product="tablet" msgid="2741496534769660027">"ऐप्स को टैबलेट द्वारा ज्ञात खातों की सूची प्राप्त करने देता है. इसमें वे खाते शामिल हो सकते हैं जिन्हें इंस्टॉल किए गए ऐप्स ने बनाया है."</string> - <string name="permdesc_getAccounts" product="tv" msgid="4190633395633907543">"ऐप को टीवी द्वारा ज्ञात खातों की सूची प्राप्त करने देती है. इसमें इंस्टॉल किए गए ऐप्लिकेशन के द्वारा बनाए गए खाते शामिल हो सकते हैं."</string> - <string name="permdesc_getAccounts" product="default" msgid="3448316822451807382">"ऐप्स को फ़ोन द्वारा ज्ञात खातों की सूची प्राप्त करने देता है. इसमें वे खाते शामिल हो सकते हैं जिन्हें इंस्टॉल किए गए ऐप्स ने बनाया है."</string> + <string name="permdesc_getAccounts" product="tablet" msgid="2741496534769660027">"एप्लिकेशन को टैबलेट से ज्ञात खातों की सूची पाने देता है. इसमें वे खाते शामिल हो सकते हैं जिन्हें इंस्टॉल किए गए एप्लिकेशन ने बनाया है."</string> + <string name="permdesc_getAccounts" product="tv" msgid="4190633395633907543">"ऐप्लिकेशन को टीवी से ज्ञात खातों की सूची पाने देती है. इसमें इंस्टॉल किए गए ऐप्लिकेशन से बनाए गए खाते शामिल हो सकते हैं."</string> + <string name="permdesc_getAccounts" product="default" msgid="3448316822451807382">"एप्लिकेशन को फ़ोन से ज्ञात खातों की सूची पाने देता है. इसमें वे खाते शामिल हो सकते हैं जिन्हें इंस्टॉल किए गए एप्लिकेशन ने बनाया है."</string> <string name="permlab_accessNetworkState" msgid="4951027964348974773">"नेटवर्क कनेक्शन देखें"</string> <string name="permdesc_accessNetworkState" msgid="8318964424675960975">"ऐप को नेटवर्क कनेक्शन के बारे में जानकारी देखने देता है, जैसे कौन से नेटवर्क मौजूद हैं और कनेक्ट हैं."</string> <string name="permlab_createNetworkSockets" msgid="7934516631384168107">"नेटवर्क को पूरी तरह इस्तेमाल करें"</string> @@ -483,9 +484,9 @@ <string name="permlab_changeWifiState" msgid="6550641188749128035">"वाई-फ़ाई से कनेक्ट और डिस्कनेक्ट करें"</string> <string name="permdesc_changeWifiState" msgid="7137950297386127533">"ऐप्स को वाई-फ़ाई पहुंच बिंदुओं से कनेक्ट और डिसकनेक्ट करने और वाई-फ़ाई नेटवर्क के लिए डिवाइस कॉन्फ़िगरेशन में परिवर्तन करने देता है."</string> <string name="permlab_changeWifiMulticastState" msgid="1368253871483254784">"वाई-फ़ाई मल्टीकास्ट पाने को अनुमति दें"</string> - <string name="permdesc_changeWifiMulticastState" product="tablet" msgid="7969774021256336548">"ऐप्स को वाई-फ़ाई नेटवर्क पर मल्टीकास्ट पते के उपयोग से केवल आपके टैबलेट पर ही नहीं, बल्कि सभी डिवाइस पर भेजे गए पैकेट प्राप्त करने देता है. यह गैर-मल्टीकास्ट मोड से ज़्यादा पावर का उपयोग करता है."</string> - <string name="permdesc_changeWifiMulticastState" product="tv" msgid="9031975661145014160">"ऐप को मल्टीकास्ट पतों का उपयोग करके ना केवल आपके टीवी को, बल्कि वाई-फ़ाई पर मौजूद सभी डिवाइसों को पैकेट भेजने और प्राप्त करने देती है. इसमें गैर-मल्टीकास्ट मोड की अपेक्षा ज़्यादा पावर का उपयोग होता है."</string> - <string name="permdesc_changeWifiMulticastState" product="default" msgid="6851949706025349926">"ऐप्स को वाई-फ़ाई नेटवर्क पर मल्टीकास्ट पते के उपयोग से केवल आपके फ़ोन पर ही नहीं, बल्कि सभी डिवाइस पर भेजे गए पैकेट प्राप्त करने देता है. यह गैर-मल्टीकास्ट मोड से ज़्यादा पावर का उपयोग करता है."</string> + <string name="permdesc_changeWifiMulticastState" product="tablet" msgid="7969774021256336548">"एप्लिकेशन को वाई-फ़ाई नेटवर्क पर मल्टीकास्ट पते के इस्तेमाल से सिर्फ़ आपके टैबलेट पर ही नहीं, बल्कि सभी डिवाइस पर भेजे गए पैकेट पाने देता है. यह गैर-मल्टीकास्ट मोड से ज़्यादा पावर का इस्तेमाल करता है."</string> + <string name="permdesc_changeWifiMulticastState" product="tv" msgid="9031975661145014160">"ऐप्लिकेशन को मल्टीकास्ट पतों का उपयोग करके न सिर्फ़ आपके टीवी को, बल्कि वाई-फ़ाई पर मौजूद सभी डिवाइसों को पैकेट भेजने और पाने देती है. इसमें गैर-मल्टीकास्ट मोड की अपेक्षा ज़्यादा पावर का उपयोग होता है."</string> + <string name="permdesc_changeWifiMulticastState" product="default" msgid="6851949706025349926">"एप्लिकेशन को वाई-फ़ाई नेटवर्क पर मल्टीकास्ट पते के इस्तेमाल से सिर्फ़ आपके फ़ोन पर ही नहीं, बल्कि सभी डिवाइस पर भेजे गए पैकेट पाने देता है. यह गैर-मल्टीकास्ट मोड से ज़्यादा पावर का इस्तेमाल करता है."</string> <string name="permlab_bluetoothAdmin" msgid="6006967373935926659">"ब्लूटूथ सेटिंग पर पहुंचें"</string> <string name="permdesc_bluetoothAdmin" product="tablet" msgid="6921177471748882137">"किसी ऐप्स को स्थानीय ब्लूटूथ टैबलेट कॉन्फ़िगर करने की और रिमोट डिवाइस के साथ खोजने और युग्मित करने देता है."</string> <string name="permdesc_bluetoothAdmin" product="tv" msgid="3373125682645601429">"ऐप को स्थानीय ब्लूटूथ टीवी कॉन्फ़िगर करने देती है और दूरस्थ डिवाइसों को खोजने और उनसे युग्मित करने देती है."</string> @@ -503,7 +504,7 @@ <string name="permlab_nfc" msgid="4423351274757876953">"नियर फ़ील्ड कम्यूनिकेशन नियंत्रित करें"</string> <string name="permdesc_nfc" msgid="7120611819401789907">"ऐप्स को नियर फ़ील्ड कम्यूनिकेशन (NFC) टैग, कार्ड, और रीडर के साथ संचार करने देता है."</string> <string name="permlab_disableKeyguard" msgid="3598496301486439258">"अपना स्क्रीन लॉक अक्षम करें"</string> - <string name="permdesc_disableKeyguard" msgid="6034203065077122992">"ऐप्स को कीलॉक और कोई भी संबद्ध पासवर्ड सुरक्षा अक्षम करने देता है. उदाहरण के लिए, इनकमिंग फ़ोन कॉल प्राप्त करते समय फ़ोन, कीलॉक को अक्षम कर देता है, फिर कॉल खत्म होने पर कीलॉक को फिर से सक्षम कर देता है."</string> + <string name="permdesc_disableKeyguard" msgid="6034203065077122992">"ऐप्स को कीलॉक और कोई भी संबद्ध पासवर्ड सुरक्षा बंद करने देता है. उदाहरण के लिए, इनकमिंग फ़ोन कॉल पाते समय फ़ोन, कीलॉक को बंद कर देता है, फिर कॉल खत्म होने पर कीलॉक को फिर से चालू कर देता है."</string> <string name="permlab_requestPasswordComplexity" msgid="202650535669249674">"जानें कि स्क्रीन लॉक कितना मुश्किल बनाया गया है"</string> <string name="permdesc_requestPasswordComplexity" msgid="4730994229754212347">"यह मंज़ूरी मिलने के बाद ऐप्लिकेशन जान पाता है कि स्क्रीन लॉक कितना मुश्किल (बहुत ज़्यादा, मध्यम, कम या बिल्कुल नहीं) है. इस स्तर से यह पता चलता है कि स्क्रीन लॉक कितना लंबा या किस तरह का है. ऐप्लिकेशन उपयोगकर्ताओं को यह सुझाव भी दे सकता है कि वे स्क्रीन लॉक को एक तय लेवल तक अपडेट करें. लेकिन उपयोगकर्ता इसे बेझिझक अनदेखा करके छोड़ सकते हैं. ध्यान दें कि स्क्रीन लॉक को सादे टेक्स्ट में सेव नहीं किया जाता है इसलिए ऐप्लिकेशन को सटीक पासवर्ड पता नहीं होता है."</string> <string name="permlab_useBiometric" msgid="8837753668509919318">"बायोमीट्रिक हार्डवेयर इस्तेमाल करने दें"</string> @@ -518,8 +519,8 @@ <string name="permdesc_videoWrite" msgid="5448565757490640841">"इससे ऐप्लिकेशन को आपके वीडियो संग्रह में बदलाव करने की मंज़ूरी दी जाती है."</string> <string name="permlab_imagesWrite" msgid="3391306186247235510">"अपने फ़ोटो संग्रह में बदलाव करने की अनुमति दें"</string> <string name="permdesc_imagesWrite" msgid="7073662756617474375">"इससे ऐप्लिकेशन को आपके फ़ोटो संग्रह में बदलाव करने की मंज़ूरी दी जाती है."</string> - <string name="permlab_mediaLocation" msgid="8675148183726247864">"अपने मीडिया संग्रह से जगह की जानकारी एक्सेस करने की अनुमति दें"</string> - <string name="permdesc_mediaLocation" msgid="2237023389178865130">"इससे ऐप्लिकेशन को आपके मीडिया संग्रह से जगह की जानकारी एक्सेस करने की अनुमति दी जाती है."</string> + <string name="permlab_mediaLocation" msgid="8675148183726247864">"अपने मीडिया संग्रह से जगह की जानकारी ऐक्सेस करने की अनुमति दें"</string> + <string name="permdesc_mediaLocation" msgid="2237023389178865130">"इससे ऐप्लिकेशन को आपके मीडिया संग्रह से जगह की जानकारी ऐक्सेस करने की अनुमति दी जाती है."</string> <string name="biometric_dialog_default_title" msgid="881952973720613213">"अपनी पहचान की पुष्टि करें"</string> <string name="biometric_error_hw_unavailable" msgid="645781226537551036">"बायोमेट्रिक हार्डवेयर उपलब्ध नहीं है"</string> <string name="biometric_error_user_canceled" msgid="2260175018114348727">"प्रमाणीकरण रद्द किया गया"</string> @@ -603,8 +604,8 @@ <string name="permdesc_sdcardRead" msgid="1804941689051236391">"ऐप्लिकेशन को आपकी शेयर की गई मेमोरी की सामग्री पढ़ने देती है."</string> <string name="permlab_sdcardWrite" msgid="9220937740184960897">"आपकी शेयर की गई मेमोरी की सामग्री में बदलाव करना या उसे मिटाना"</string> <string name="permdesc_sdcardWrite" msgid="2834431057338203959">"ऐप्लिकेशन को आपकी शेयर की गई मेमोरी की सामग्री लिखने देती है."</string> - <string name="permlab_use_sip" msgid="2052499390128979920">"SIP कॉल करें/प्राप्त करें"</string> - <string name="permdesc_use_sip" msgid="2297804849860225257">"ऐप्स को SIP कॉल करने और प्राप्त करने देती है."</string> + <string name="permlab_use_sip" msgid="2052499390128979920">"SIP कॉल करें/पाएं"</string> + <string name="permdesc_use_sip" msgid="2297804849860225257">"ऐप्लिकेशन को SIP कॉल करने और पाने देता है."</string> <string name="permlab_register_sim_subscription" msgid="3166535485877549177">"नए टेलिकॉम सिम कनेक्शन रजिस्टर करें"</string> <string name="permdesc_register_sim_subscription" msgid="2138909035926222911">"ऐप को नए टेलिकॉम सिम कनेक्शन पंजीकृत करने देती है."</string> <string name="permlab_register_call_provider" msgid="108102120289029841">"नए टेलिकॉम कनेक्शन रजिस्टर करें"</string> @@ -614,7 +615,7 @@ <string name="permlab_bind_incall_service" msgid="6773648341975287125">"इन-कॉल स्क्रीन से सहभागिता करें"</string> <string name="permdesc_bind_incall_service" msgid="8343471381323215005">"ऐप को यह नियंत्रित करने देती है कि उपयोगकर्ता को इन-कॉल स्क्रीन कब और कैसी दिखाई देती है."</string> <string name="permlab_bind_connection_service" msgid="3557341439297014940">"टेलीफ़ोनी सेवाओं के साथ सहभागिता करें"</string> - <string name="permdesc_bind_connection_service" msgid="4008754499822478114">"कॉल करने/प्राप्त करने के लिए ऐप्स को टेलीफ़ोनी सेवा के साथ सहभागिता करने दें."</string> + <string name="permdesc_bind_connection_service" msgid="4008754499822478114">"कॉल करने/पाने के लिए ऐप्स को टेलीफ़ोनी सेवा के साथ सहभागिता करने दें."</string> <string name="permlab_control_incall_experience" msgid="9061024437607777619">"इन कॉल उपयोगकर्ता अनुभव लें"</string> <string name="permdesc_control_incall_experience" msgid="915159066039828124">"ऐप को इन कॉल उपयोगकर्ता अनुभव लेने देती है."</string> <string name="permlab_readNetworkUsageHistory" msgid="7862593283611493232">"ऐतिहासिक नेटवर्क उपयोग पढें"</string> @@ -637,7 +638,7 @@ <string name="permdesc_accessNetworkConditions" msgid="6899102075825272211">"ऐप्स को नेटवर्क स्थितियों के अवलोकनों को सुनने देता है. सामान्य ऐप्स के लिए कभी भी आवश्यक नहीं होना चाहिए."</string> <string name="permlab_setInputCalibration" msgid="4902620118878467615">"इनपुट डिवाइस कैलिब्रेशन बदलें"</string> <string name="permdesc_setInputCalibration" msgid="4527511047549456929">"ऐप्स को टच स्क्रीन के कैलिब्रेशन पैरामीटर को बदलने देती है. सामान्य ऐप्स के लिए कभी भी आवश्यक नहीं होना चाहिए."</string> - <string name="permlab_accessDrmCertificates" msgid="7436886640723203615">"DRM प्रमाणपत्र एक्सेस करें"</string> + <string name="permlab_accessDrmCertificates" msgid="7436886640723203615">"DRM प्रमाणपत्र ऐक्सेस करें"</string> <string name="permdesc_accessDrmCertificates" msgid="8073288354426159089">"ऐप्लिकेशन को DRM प्रमाणपत्रों का प्रावधान और उपयोग करने देती है. सामान्य ऐप्स के लिए कभी भी आवश्यकता नहीं होना चाहिए."</string> <string name="permlab_handoverStatus" msgid="7820353257219300883">"Android बीम ट्रांसफ़र की स्थिति पाएं"</string> <string name="permdesc_handoverStatus" msgid="4788144087245714948">"इस ऐप को मौजूदा Android बीम ट्रांसफ़र के बारे में जानकारी पाने की अनुमति दें."</string> @@ -1134,7 +1135,7 @@ <string name="whichOpenLinksWith" msgid="6392123355599572804">"इसे इस्तेमाल करके लिंक खोलें"</string> <string name="whichOpenLinksWithApp" msgid="8225991685366651614">"<xliff:g id="APPLICATION">%1$s</xliff:g> इस्तेमाल करके लिंक खोलें"</string> <string name="whichOpenHostLinksWithApp" msgid="3464470639011045589">"<xliff:g id="APPLICATION">%2$s</xliff:g> इस्तेमाल करके <xliff:g id="HOST">%1$s</xliff:g> लिंक खोलें"</string> - <string name="whichGiveAccessToApplicationLabel" msgid="6142688895536868827">"एक्सेस दें"</string> + <string name="whichGiveAccessToApplicationLabel" msgid="6142688895536868827">"ऐक्सेस दें"</string> <string name="whichEditApplication" msgid="144727838241402655">"इसके ज़रिये बदलाव करें"</string> <string name="whichEditApplicationNamed" msgid="1775815530156447790">"%1$s की मदद से बदलाव करें"</string> <string name="whichEditApplicationLabel" msgid="7183524181625290300">"बदलाव करें"</string> @@ -1213,9 +1214,9 @@ <string name="dump_heap_ready_notification" msgid="1162196579925048701">"<xliff:g id="PROC">%1$s</xliff:g> हीप डंप तैयार है"</string> <string name="dump_heap_notification_detail" msgid="3993078784053054141">"हीप डंप (Java™ प्रोसेस मेमोरी का स्नैपशॉट) ले लिया गया है. शेयर करने के लिए टैप करें."</string> <string name="dump_heap_title" msgid="5864292264307651673">"हीप डंप शेयर करें?"</string> - <string name="dump_heap_text" msgid="8546022920319781701">"<xliff:g id="PROC">%1$s</xliff:g> प्रक्रिया अपनी <xliff:g id="SIZE">%2$s</xliff:g> की मेमोरी सीमा पार कर चुकी है. एक हीप डंप इसके डेवलपर के साथ शेयर किए जाने के लिए तैयार है. सावधान रहें: इस हीप डंप में कोई ऐसी निजी जानकारी भी शामिल हो सकती है जिसका एक्सेस ऐप्लिकेशन के पास हो."</string> - <string name="dump_heap_system_text" msgid="3236094872980706024">"<xliff:g id="PROC">%1$s</xliff:g> प्रक्रिया अपनी <xliff:g id="SIZE">%2$s</xliff:g> की मेमोरी सीमा पार कर चुकी है. एक हीप डंप शेयर किए जाने के लिए तैयार है. सावधान रहें: इस हीप डंप में कोई ऐसी संवेदनशील निजी जानकारी भी शामिल हो सकती है जिसका एक्सेस प्रोसेस के पास हो. इसमें आपके टाइप किए गए शब्दों का डेटा भी शामिल है."</string> - <string name="dump_heap_ready_text" msgid="1778041771455343067">"<xliff:g id="PROC">%1$s</xliff:g> प्रक्रिया का हीप डंप शेयर किए जाने के लिए तैयार है. सावधान रहें: इस हीप डंप में कोई ऐसी संवेदनशील निजी जानकारी शामिल हो सकती है जिसका एक्सेस प्रोसेस के पास हो. इसमें आपके टाइप किए गए शब्दों का डेटा भी शामिल है."</string> + <string name="dump_heap_text" msgid="8546022920319781701">"<xliff:g id="PROC">%1$s</xliff:g> प्रक्रिया अपनी <xliff:g id="SIZE">%2$s</xliff:g> की मेमोरी सीमा पार कर चुकी है. एक हीप डंप इसके डेवलपर के साथ शेयर किए जाने के लिए तैयार है. सावधान रहें: इस हीप डंप में कोई ऐसी निजी जानकारी भी शामिल हो सकती है जिसका ऐक्सेस ऐप्लिकेशन के पास हो."</string> + <string name="dump_heap_system_text" msgid="3236094872980706024">"<xliff:g id="PROC">%1$s</xliff:g> प्रक्रिया अपनी <xliff:g id="SIZE">%2$s</xliff:g> की मेमोरी सीमा पार कर चुकी है. एक हीप डंप शेयर किए जाने के लिए तैयार है. सावधान रहें: इस हीप डंप में कोई ऐसी संवेदनशील निजी जानकारी भी शामिल हो सकती है जिसका ऐक्सेस प्रोसेस के पास हो. इसमें आपके टाइप किए गए शब्दों का डेटा भी शामिल है."</string> + <string name="dump_heap_ready_text" msgid="1778041771455343067">"<xliff:g id="PROC">%1$s</xliff:g> प्रक्रिया का हीप डंप शेयर किए जाने के लिए तैयार है. सावधान रहें: इस हीप डंप में कोई ऐसी संवेदनशील निजी जानकारी शामिल हो सकती है जिसका ऐक्सेस प्रोसेस के पास हो. इसमें आपके टाइप किए गए शब्दों का डेटा भी शामिल है."</string> <string name="sendText" msgid="5209874571959469142">"मैसेज करने के लिए कोई कार्रवाई चुनें"</string> <string name="volume_ringtone" msgid="6885421406845734650">"रिंगर वॉल्यूम"</string> <string name="volume_music" msgid="5421651157138628171">"मीडिया वॉल्यूम"</string> @@ -1375,7 +1376,7 @@ <string name="select_keyboard_layout_notification_message" msgid="8084622969903004900">"भाषा और लेआउट चुनने के लिए टैप करें"</string> <string name="fast_scroll_alphabet" msgid="5433275485499039199">" ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string> <string name="fast_scroll_numeric_alphabet" msgid="4030170524595123610">" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"</string> - <string name="alert_windows_notification_channel_group_name" msgid="1463953341148606396">"दूसरे ऐप्लिकेशन के ऊपर दिखाए जाने का एक्सेस"</string> + <string name="alert_windows_notification_channel_group_name" msgid="1463953341148606396">"दूसरे ऐप्लिकेशन के ऊपर दिखाए जाने का ऐक्सेस"</string> <string name="alert_windows_notification_channel_name" msgid="3116610965549449803">"<xliff:g id="NAME">%s</xliff:g> अन्य ऐप्लिकेशन के ऊपर दिखाई दे रहा है"</string> <string name="alert_windows_notification_title" msgid="3697657294867638947">"<xliff:g id="NAME">%s</xliff:g> अन्य ऐप पर दिखाई दे रहा है"</string> <string name="alert_windows_notification_message" msgid="8917232109522912560">"अगर आप नहीं चाहते कि <xliff:g id="NAME">%s</xliff:g> इस सुविधा का उपयोग करे, तो सेटिंग खोलने और उसे बंद करने के लिए टैप करें."</string> diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml index 35853d6ecbea..aca3b2d8098e 100644 --- a/core/res/res/values-hr/strings.xml +++ b/core/res/res/values-hr/strings.xml @@ -96,6 +96,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Poruke govorne pošte"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi pozivi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status SIM-a"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Status SIM-a visokog prioriteta"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Način TTY FULL koji zahtijeva paralelni uređaj"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Način TTY HCO koji zahtijeva paralelni uređaj"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Način TTY VCO koji zahtijeva paralelni uređaj"</string> diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml index 1fbc3fe02105..ff91dcf7a466 100644 --- a/core/res/res/values-hu/strings.xml +++ b/core/res/res/values-hu/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Hangpostaüzenetek"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-hívás"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM-kártya állapota"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Elsődleges SIM-kártya állapota"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Partner által kért TTY-mód: FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Partner által kért TTY-mód: HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Partner által kért TTY-mód: VCO"</string> diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml index 3377d3b48785..7ee4fb609b47 100644 --- a/core/res/res/values-hy/strings.xml +++ b/core/res/res/values-hy/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Ձայնային փոստի հաղորդագրություններ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Զանգեր Wi-Fi-ի միջոցով"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM քարտի կարգավիճակը"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"SIM քարտի բարձր առաջնահերթության ծանուցումներ"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Բաժանորդի սարքում ընտրված է հեռատիպի ԲՈԼՈՐԸ ռեժիմը"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Բաժանորդի սարքում ընտրված է հեռատիպի HCO ռեժիմը"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Բաժանորդի սարքում ընտրված է հեռատիպի VCO ռեժիմը"</string> diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml index 07671b2c758a..48bd1751a13d 100644 --- a/core/res/res/values-in/strings.xml +++ b/core/res/res/values-in/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Notifikasi pesan suara"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Panggilan Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Status SIM prioritas tinggi"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Rekan meminta Mode TTY PENUH"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Rekan meminta Mode TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Rekan meminta Mode TTY VCO"</string> diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml index c796dbffe527..b06a7f0714c6 100644 --- a/core/res/res/values-is/strings.xml +++ b/core/res/res/values-is/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Talhólfsskilaboð"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi símtöl"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Staða SIM-korts"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Áríðandi staða SIM-korts"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Jafningi bað um FULLA stillingu fjarrita"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Jafningi bað um HCO-stillingu fjarrita"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Jafningi bað um VCO-stillingu fjarrita"</string> diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml index 45efc5ddf60b..98f5fb2a2cd3 100644 --- a/core/res/res/values-it/strings.xml +++ b/core/res/res/values-it/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Messaggi vocali"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Chiamate Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Stato SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Stato SIM con priorità elevata"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer ha richiesto la modalità TTY FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer ha richiesto la modalità TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer ha richiesto la modalità TTY VCO"</string> diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml index d792b5c6cede..00a37ebd6208 100644 --- a/core/res/res/values-iw/strings.xml +++ b/core/res/res/values-iw/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"הודעות קוליות"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"שיחות Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"סטטוס SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"סטטוס התראות SIM בעדיפות גבוהה"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"העמית ביקש TTY במצב FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"העמית ביקש TTY במצב HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"העמית ביקש TTY במצב VCO"</string> diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml index ebe2fc478395..effa90293383 100644 --- a/core/res/res/values-ja/strings.xml +++ b/core/res/res/values-ja/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ボイスメール メッセージ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi 通話"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM のステータス"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"高優先度: SIM のステータス"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"ピアから、TTY モードを FULL にするようリクエストされました"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"ピアから、TTYモードをHCOにするようリクエストされました"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"ピアから、TTYモードをVCOにするようリクエストされました"</string> @@ -297,9 +298,9 @@ <string name="permgrouplab_microphone" msgid="171539900250043464">"マイク"</string> <string name="permgroupdesc_microphone" msgid="4988812113943554584">"音声の録音"</string> <string name="permgrouprequest_microphone" msgid="9167492350681916038">"音声の録音を「<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>」に許可しますか?"</string> - <string name="permgrouplab_activityRecognition" msgid="1565108047054378642">"運動データ"</string> - <string name="permgroupdesc_activityRecognition" msgid="6949472038320473478">"運動データにアクセス"</string> - <string name="permgrouprequest_activityRecognition" msgid="7626438016904799383">"運動データへのアクセスを「<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>」に許可しますか?"</string> + <string name="permgrouplab_activityRecognition" msgid="1565108047054378642">"身体活動"</string> + <string name="permgroupdesc_activityRecognition" msgid="6949472038320473478">"身体活動にアクセス"</string> + <string name="permgrouprequest_activityRecognition" msgid="7626438016904799383">"身体活動へのアクセスを「<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>」に許可しますか?"</string> <string name="permgrouplab_camera" msgid="4820372495894586615">"カメラ"</string> <string name="permgroupdesc_camera" msgid="3250611594678347720">"写真と動画の撮影"</string> <string name="permgrouprequest_camera" msgid="1299833592069671756">"写真と動画の撮影を「<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>」に許可しますか?"</string> @@ -428,8 +429,8 @@ <string name="permdesc_recordAudio" msgid="4245930455135321433">"このアプリは、いつでもマイクを使用して録音できます。"</string> <string name="permlab_sim_communication" msgid="2935852302216852065">"SIMへのコマンド送信"</string> <string name="permdesc_sim_communication" msgid="5725159654279639498">"SIMにコマンドを送信することをアプリに許可します。この許可は非常に危険です。"</string> - <string name="permlab_activityRecognition" msgid="3634590230567608356">"運動の認識"</string> - <string name="permdesc_activityRecognition" msgid="3143453925156552894">"このアプリで運動が認識されるようにします。"</string> + <string name="permlab_activityRecognition" msgid="3634590230567608356">"身体活動の認識"</string> + <string name="permdesc_activityRecognition" msgid="3143453925156552894">"このアプリで身体活動が認識されるようにします。"</string> <string name="permlab_camera" msgid="3616391919559751192">"写真と動画の撮影"</string> <string name="permdesc_camera" msgid="5392231870049240670">"このアプリは、いつでもカメラを使用して写真や動画を撮影できます。"</string> <string name="permlab_vibrate" msgid="7696427026057705834">"バイブレーションの制御"</string> @@ -550,11 +551,11 @@ <string-array name="fingerprint_error_vendor"> </string-array> <string name="fingerprint_icon_content_description" msgid="2340202869968465936">"指紋アイコン"</string> - <string name="permlab_manageFace" msgid="7262837876352591553">"フェイスアンロック ハードウェアの管理"</string> + <string name="permlab_manageFace" msgid="7262837876352591553">"顔認証ハードウェアの管理"</string> <string name="permdesc_manageFace" msgid="8919637120670185330">"使用する顔テンプレートの追加や削除を行うメソッドの呼び出しをアプリに許可します。"</string> - <string name="permlab_useFaceAuthentication" msgid="2565716575739037572">"フェイスアンロック ハードウェアの使用"</string> - <string name="permdesc_useFaceAuthentication" msgid="4712947955047607722">"フェイスアンロック ハードウェアを認証に使用することをアプリに許可します"</string> - <string name="face_recalibrate_notification_name" msgid="1913676850645544352">"フェイスアンロック"</string> + <string name="permlab_useFaceAuthentication" msgid="2565716575739037572">"顔認証ハードウェアの使用"</string> + <string name="permdesc_useFaceAuthentication" msgid="4712947955047607722">"顔認証ハードウェアを認証に使用することをアプリに許可します"</string> + <string name="face_recalibrate_notification_name" msgid="1913676850645544352">"顔認証"</string> <string name="face_recalibrate_notification_title" msgid="4087620069451499365">"顔の再登録"</string> <string name="face_recalibrate_notification_content" msgid="5530308842361499835">"認識を改善するには、顔を再登録してください"</string> <string name="face_acquired_insufficient" msgid="2767330364802375742">"顔を認識できませんでした。もう一度お試しください。"</string> @@ -580,15 +581,15 @@ <string-array name="face_acquired_vendor"> </string-array> <string name="face_error_hw_not_available" msgid="396883585636963908">"顔を確認できません。ハードウェアを利用できません。"</string> - <string name="face_error_timeout" msgid="981512090365729465">"フェイスアンロックをもう一度お試しください。"</string> + <string name="face_error_timeout" msgid="981512090365729465">"顔認証をもう一度お試しください。"</string> <string name="face_error_no_space" msgid="2712120617457553825">"新しい顔データを保存できません。古いデータを削除してください。"</string> <string name="face_error_canceled" msgid="283945501061931023">"顔の操作をキャンセルしました。"</string> - <string name="face_error_user_canceled" msgid="5317030072349668946">"フェイスアンロックはユーザーによりキャンセルされました。"</string> + <string name="face_error_user_canceled" msgid="5317030072349668946">"顔認証はユーザーによりキャンセルされました。"</string> <string name="face_error_lockout" msgid="3407426963155388504">"試行回数の上限です。後でもう一度お試しください。"</string> - <string name="face_error_lockout_permanent" msgid="4723594314443097159">"試行回数が上限を超えました。フェイスアンロックを無効にしました。"</string> + <string name="face_error_lockout_permanent" msgid="4723594314443097159">"試行回数が上限を超えたため、顔認証を無効にしました。"</string> <string name="face_error_unable_to_process" msgid="4940944939691171539">"顔を確認できません。もう一度お試しください。"</string> - <string name="face_error_not_enrolled" msgid="4016937174832839540">"フェイスアンロックを設定していません。"</string> - <string name="face_error_hw_not_present" msgid="8302690289757559738">"このデバイスでは、フェイスアンロックはご利用いただけません。"</string> + <string name="face_error_not_enrolled" msgid="4016937174832839540">"顔認証を設定していません。"</string> + <string name="face_error_hw_not_present" msgid="8302690289757559738">"このデバイスでは、顔認証はご利用いただけません。"</string> <string name="face_name_template" msgid="7004562145809595384">"顔 <xliff:g id="FACEID">%d</xliff:g>"</string> <string-array name="face_error_vendor"> </string-array> @@ -817,7 +818,7 @@ <string name="lockscreen_pattern_wrong" msgid="4317955014948108794">"もう一度お試しください"</string> <string name="lockscreen_password_wrong" msgid="5737815393253165301">"もう一度お試しください"</string> <string name="lockscreen_storage_locked" msgid="9167551160010625200">"すべての機能とデータを利用するにはロック解除"</string> - <string name="faceunlock_multiple_failures" msgid="754137583022792429">"フェイスアンロックの最大試行回数を超えました"</string> + <string name="faceunlock_multiple_failures" msgid="754137583022792429">"顔認証の最大試行回数を超えました"</string> <string name="lockscreen_missing_sim_message_short" msgid="5099439277819215399">"SIMカードが挿入されていません"</string> <string name="lockscreen_missing_sim_message" product="tablet" msgid="151659196095791474">"タブレット内にSIMカードがありません。"</string> <string name="lockscreen_missing_sim_message" product="tv" msgid="1943633865476989599">"テレビにSIMカードが挿入されていません。"</string> @@ -887,7 +888,7 @@ <string name="keyguard_accessibility_expand_lock_area" msgid="519859720934178024">"ロック解除エリアを拡大します。"</string> <string name="keyguard_accessibility_slide_unlock" msgid="2959928478764697254">"スライドロックを解除します。"</string> <string name="keyguard_accessibility_pattern_unlock" msgid="1490840706075246612">"パターンロックを解除します。"</string> - <string name="keyguard_accessibility_face_unlock" msgid="4817282543351718535">"フェイスアンロックを行います。"</string> + <string name="keyguard_accessibility_face_unlock" msgid="4817282543351718535">"顔認証を行います。"</string> <string name="keyguard_accessibility_pin_unlock" msgid="2469687111784035046">"PINロックを解除します。"</string> <string name="keyguard_accessibility_sim_pin_unlock" msgid="9149698847116962307">"SIM PIN のロックを解除します。"</string> <string name="keyguard_accessibility_sim_puk_unlock" msgid="9106899279724723341">"SIM PUK のロックを解除します。"</string> diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml index 9404f49f4fc6..896ad137dec9 100644 --- a/core/res/res/values-ka/strings.xml +++ b/core/res/res/values-ka/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ხმოვანი ფოსტის შეტყობინებები"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"დარეკვა Wi-Fi-ს მეშვეობით"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM სტატუსი"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"მაღალპრიორიტეტული SIM სტატუსი"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"მოთხოვნილია კვანძი TTY რეჟიმი FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"მოთხოვნილია კვანძი TTY რეჟიმი HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"მოთხოვნილია კვანძი TTY რეჟიმი VCO"</string> diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml index c3ea2a909d14..801e3777e24c 100644 --- a/core/res/res/values-kk/strings.xml +++ b/core/res/res/values-kk/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Дауыстық пошта хабарлары"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi қоңыраулары"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM күйі"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"SIM картасы туралы маңызды хабарландырулар"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Пир TTY режимі ТОЛЫҚ сұрады"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Пир TTY режимінің HCO сұрады"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Пир TTY режимінің VCO сұрады"</string> diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml index 28c097049b41..8bb03e061e7e 100644 --- a/core/res/res/values-km/strings.xml +++ b/core/res/res/values-km/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"សារជាសំឡេង"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"ការហៅទូរសព្ទតាម Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"ស្ថានភាពស៊ីម"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"ស្ថានភាពស៊ីមដែលមានអាទិភាពខ្ពស់"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"ម៉ាស៊ីនកូនបានស្នើ TTY Mode FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"ម៉ាស៊ីនកូនបានស្នើ TTY Mode HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"ម៉ាស៊ីនកូនបានស្នើ TTY Mode VCO"</string> diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml index 0331f863cb63..8e5ea6af10d0 100644 --- a/core/res/res/values-kn/strings.xml +++ b/core/res/res/values-kn/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ಧ್ವನಿಮೇಲ್ ಸಂದೇಶಗಳು"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"ವೈ-ಫೈ ಕರೆ ಮಾಡುವಿಕೆ"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"ಸಿಮ್ ಸ್ಥಿತಿ"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"ಹೆಚ್ಚಿನ ಆದ್ಯತೆಯ ಸಿಮ್ ಸ್ಥಿತಿ"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"ಪೀರ್ ವಿನಂತಿಸಿಕೊಂಡ TTY ಮೋಡ್ ಪೂರ್ಣಗೊಂಡಿದೆ"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"ಪೀರ್ ವಿನಂತಿಸಿಕೊಂಡ TTY ಮೋಡ್ HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"ಪೀರ್ ವಿನಂತಿಸಿಕೊಂಡ TTY ಮೋಡ್ VCO"</string> diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml index c97f740c9da2..9d547ca682f3 100644 --- a/core/res/res/values-ko/strings.xml +++ b/core/res/res/values-ko/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"음성사서함 메시지"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi 통화"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM 상태"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"우선순위가 높은 SIM 상태"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"피어가 TTY 모드 FULL을 요청했습니다."</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"피어가 TTY 모드 HCO를 요청했습니다."</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"피어가 TTY 모드 VCO를 요청했습니다."</string> diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml index e86ceb13f3d7..d3d1cd0f2953 100644 --- a/core/res/res/values-ky/strings.xml +++ b/core/res/res/values-ky/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Үн почтасынын билдирүүлөрү"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi аркылуу чалуу"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM-картанын абалы"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"SIM картадагы өтө маанилүү билдирмелер"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer TTY режимин FULL кылууну суранды"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer TTY режимин HCO кылууну суранды"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer TTY режимин VCO кылууну суранды"</string> diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml index 17b015486e62..55747d0556f4 100644 --- a/core/res/res/values-lo/strings.xml +++ b/core/res/res/values-lo/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ຂໍ້ຄວາມສຽງ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"ການໂທ Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"ສະຖານະ SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"ສະຖານະ SIM ຄວາມສຳຄັນສູງ"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"ໂໝດ TTY ທີ່ເພື່ອນຂໍນັ້ນເຕັມແລ້ວ"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"ໂໝດ TTY ທີ່ເພື່ອນຂໍ HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"ໂໝດ TTY ທີ່ເພື່ອນຂໍ VCO"</string> diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml index caf8e4fce3b3..f0ce8621142c 100644 --- a/core/res/res/values-lt/strings.xml +++ b/core/res/res/values-lt/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Balso pašto pranešimai"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"„Wi-Fi“ skambinimas"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM būsena"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Didelio prioriteto SIM kortelės būsena"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Lygiavertis naudotojas pateikė užklausą dėl TTY režimo FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Lygiavertis naudotojas pateikė užklausą dėl TTY režimo HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Lygiavertis naudotojas pateikė užklausą dėl TTY režimo VCO"</string> diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml index d71234ce1b66..bed07f26da80 100644 --- a/core/res/res/values-lv/strings.xml +++ b/core/res/res/values-lv/strings.xml @@ -96,6 +96,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Balss pasta ziņojumi"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi zvani"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM kartes statuss"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Augstas prioritātes SIM kartes statuss"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Vienādranga ierīce pieprasīja teksta tālruņa režīmu FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Vienādranga ierīce pieprasīja teksta tālruņa režīmu HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Vienādranga ierīce pieprasīja teksta tālruņa režīmu VCO"</string> diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml index d89fa9c03de0..530b0237e822 100644 --- a/core/res/res/values-mk/strings.xml +++ b/core/res/res/values-mk/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Пораки од говорна пошта"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Повикување преку Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Статус на SIM-картичка"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Статус на SIM-известувања со висок приоритет"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Рамноправен уред го побара режимот на TTY „FULL“"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Рамноправен уред го побара режимот на TTY „HCO“"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Рамноправен уред го побара режимот на TTY „VCO“"</string> diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml index 819d3f7e93ea..9ad8b1341567 100644 --- a/core/res/res/values-ml/strings.xml +++ b/core/res/res/values-ml/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"വോയ്സ്മെയിൽ സന്ദേശങ്ങൾ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"വൈഫൈ കോളിംഗ്"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"സിം നില"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"ഉയർന്ന മുൻഗണനയുള്ള സിം നില"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"പിയർ അഭ്യർത്ഥിച്ച TTY മോഡ് \'ഫുൾ\'"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"പിയർ അഭ്യർത്ഥിച്ച TTY മോഡ് HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"പിയർ അഭ്യർത്ഥിച്ച TTY മോഡ് VCO"</string> diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml index dd5dc11118b9..d5f358b20997 100644 --- a/core/res/res/values-mn/strings.xml +++ b/core/res/res/values-mn/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Дуут шуудангийн мессеж"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi дуудлага"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM статус"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Өндөр ач холбогдолтой SIM-н статус"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Хандлагын цэгт хүсэлт тавьсан TTY Mode FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Хандлагын цэгт хүсэлт тавьсан TTY Mode HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Хандлагын цэгт хүсэлт тавьсан TTY Mode VCO"</string> diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml index f5cf1f576bab..faafeb70df32 100644 --- a/core/res/res/values-mr/strings.xml +++ b/core/res/res/values-mr/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"व्हॉइसमेल मेसेज"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"वाय-फाय कॉलिंग"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"सिम स्थिती"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"उच्च प्राधान्य सिम स्थिती"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"समवयस्क व्यक्तीने TTY मोड पूर्ण ची विनंती केली"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"समवयस्क व्यक्तीने TTY मोड HCO ची विनंती केली"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"समवयस्क व्यक्तीने TTY मोड VCO ची विनंती केली"</string> @@ -301,8 +302,8 @@ <string name="permgroupdesc_activityRecognition" msgid="6949472038320473478">"शारीरिक अॅक्टिव्हिटी अॅक्सेस करा"</string> <string name="permgrouprequest_activityRecognition" msgid="7626438016904799383">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> ला तुमची शारीरिक अॅक्टिव्हिटी अॅक्सेस करण्याची अनुमती द्यायची का?"</string> <string name="permgrouplab_camera" msgid="4820372495894586615">"कॅमेरा"</string> - <string name="permgroupdesc_camera" msgid="3250611594678347720">"चित्रे घेण्याची आणि व्हिडिओ रेकॉर्ड"</string> - <string name="permgrouprequest_camera" msgid="1299833592069671756">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> ला फोटो घेऊ आणि व्हिडिओ रेकॉर्ड करू द्यायचे?"</string> + <string name="permgroupdesc_camera" msgid="3250611594678347720">"चित्रे काढण्याची आणि व्हिडिओ रेकॉर्ड करण्याची"</string> + <string name="permgrouprequest_camera" msgid="1299833592069671756">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> ला फोटो काढू आणि व्हिडिओ रेकॉर्ड करू द्यायचे?"</string> <string name="permgrouplab_calllog" msgid="8798646184930388160">"कॉल लॉग"</string> <string name="permgroupdesc_calllog" msgid="3006237336748283775">"फोन कॉल लॉग वाचा आणि लिहा"</string> <string name="permgrouprequest_calllog" msgid="8487355309583773267">"<b><xliff:g id="APP_NAME">%1$s</xliff:g></b> ला तुमचे फोन कॉल लॉग अॅक्सेस करण्याची अनुमती द्यायची का?"</string> diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml index b5f0ef58c634..b6743f4b257a 100644 --- a/core/res/res/values-ms/strings.xml +++ b/core/res/res/values-ms/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mesej mel suara"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Panggilan Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Status SIM keutamaan tinggi"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Rakan meminta Mod TTY PENUH"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Rakan meminta Mod TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Rakan meminta Mod TTY VCO"</string> diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml index 1387725c50c6..ad5aaca1a2b9 100644 --- a/core/res/res/values-my/strings.xml +++ b/core/res/res/values-my/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"အသံမေးလ် မက်ဆေ့ဂျ်များ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi ခေါ်ဆိုမှု"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"ဆင်းမ်ကဒ် အခြေအနေ"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"အထူးဦးစားပေး ဆင်းမ်ကတ်အခြေအနေ"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"အခြားစက်မှ TTY မုဒ် FULL ပြုရန် တောင်းဆို၏"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"အခြားစက်မှ TTY မုဒ် HCO ပြုရန် တောင်းဆို၏"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"TTY မုဒ် VCO ပြုရန် အခြားစက်မှ တောင်းဆို၏"</string> diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml index 3a3a999b7bc2..c6d16987c005 100644 --- a/core/res/res/values-nb/strings.xml +++ b/core/res/res/values-nb/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Talepostmeldinger"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-anrop"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM-status"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"SIM-status er satt til høy prioritet"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Motpart ba om TTY-modus FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Motpart ba om TTY-modus HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Motpart ba om TTY-modus VCO"</string> diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml index 7b0fbfc890d9..47392328f27f 100644 --- a/core/res/res/values-ne/strings.xml +++ b/core/res/res/values-ne/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"भ्वाइस मेल सन्देशहरू"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi कल"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM को स्थिति"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"उच्च प्राथमिकता रहेको SIM को स्थिति"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"सहकर्मी अनुरोध गरियो। TTY मोड पूर्ण"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"सहकर्मी अनुरोध गरियो। TTY मोड HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"सहकर्मी अनुरोध गरियो। TTY मोड VCO"</string> diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml index cadbbfecbec0..fe53b2387f8c 100644 --- a/core/res/res/values-nl/strings.xml +++ b/core/res/res/values-nl/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Voicemailberichten"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Bellen via wifi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Simkaartstatus"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Meldingen met hoge prioriteit voor de simkaartstatus"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Door peer aangevraagde TTY-modus VOL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Door peer aangevraagde TTY-modus HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Door peer aangevraagde TTY-modus VCO"</string> diff --git a/core/res/res/values-or/strings.xml b/core/res/res/values-or/strings.xml index 176d01c0273a..ce40db3e71a8 100644 --- a/core/res/res/values-or/strings.xml +++ b/core/res/res/values-or/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ଭଏସମେଲ୍ ମେସେଜ୍"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"ୱାଇ-ଫାଇ କଲିଙ୍ଗ"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM ଷ୍ଟାଟସ୍"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"ଉଚ୍ଚ ପ୍ରାଥମିକତା SIM ସ୍ଥିତି"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"ପୀଆର୍ ଅନୁରୋଧ କରିଥିବା TTY ମୋଡ୍ FULL ଅଟେ"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"ପୀଅର୍ ଅନୁରୋଧ କରିଥିବା TTY ମୋଡ୍ HCO ଅଟେ"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"ପୀଅର୍ ଅନୁରୋଧ କରିଥିବା TTY ମୋଡ୍ VCO ଅଟେ"</string> @@ -1658,7 +1659,7 @@ <string name="kg_failed_attempts_almost_at_login" product="default" msgid="1437638152015574839">"ଆପଣଙ୍କ ଅନଲକ୍ ପାଟର୍ନକୁ ଆପଣ <xliff:g id="NUMBER_0">%1$d</xliff:g> ଥର ଭୁଲ ଭାବେ ଅଙ୍କନ କରିଛନ୍ତି। ଆଉ <xliff:g id="NUMBER_1">%2$d</xliff:g>ଟି ଭୁଲ ପ୍ରୟାସ ପରେ ଏକ ଇମେଲ୍ ଆକାଉଣ୍ଟ ବ୍ୟବହାର କରି ନିଜ ଫୋନ୍କୁ ଅନଲକ୍ କରିବା ପାଇଁ କୁହାଯିବ।\n\n<xliff:g id="NUMBER_2">%3$d</xliff:g> ସେକେଣ୍ଡ ପରେ ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ।"</string> <string name="kg_text_message_separator" product="default" msgid="4160700433287233771">" — "</string> <string name="kg_reordering_delete_drop_target_text" msgid="7899202978204438708">"ବାହାର କରନ୍ତୁ"</string> - <string name="safe_media_volume_warning" product="default" msgid="2276318909314492312">"ମାତ୍ରା ବଢ଼ାଇ ସୁପାରିସ ସ୍ତର ବଢ଼ାଉଛନ୍ତି? \n\n ଲମ୍ବା ସମୟ ପର୍ଯ୍ୟନ୍ତ ଉଚ୍ଚ ଶବ୍ଦରେ ଶୁଣିଲେ ଆପଣଙ୍କ ଶ୍ରବଣ ଶକ୍ତି ଖରାପ ହୋଇପାରେ।"</string> + <string name="safe_media_volume_warning" product="default" msgid="2276318909314492312">"ମାତ୍ରା ବଢ଼ାଇ ସୁପାରିଶ ସ୍ତର ବଢ଼ାଉଛନ୍ତି? \n\n ଲମ୍ବା ସମୟ ପର୍ଯ୍ୟନ୍ତ ଉଚ୍ଚ ଶବ୍ଦରେ ଶୁଣିଲେ ଆପଣଙ୍କ ଶ୍ରବଣ ଶକ୍ତି ଖରାପ ହୋଇପାରେ।"</string> <string name="accessibility_shortcut_warning_dialog_title" msgid="8404780875025725199">"ଆକ୍ସେସବିଲିଟି ଶର୍ଟକଟ୍ ବ୍ୟବହାର କରିବେ?"</string> <string name="accessibility_shortcut_toogle_warning" msgid="7256507885737444807">"ସର୍ଟକଟ୍ ଅନ୍ ଥିବା ବେଳେ, ଉଭୟ ଭଲ୍ୟୁମ୍ ବଟନ୍ 3 ସେକେଣ୍ଡ ପାଇଁ ଦବାଇବା ଦ୍ୱାରା ଆକ୍ସେସବିଲିଟି ବୈଶିଷ୍ଟ ଆରମ୍ଭ ହେବ।\n\n ସମ୍ପ୍ରତି ଆକ୍ସେସବିଲିଟି ବୈଶିଷ୍ଟ୍ୟ:\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n ସେଟିଙ୍ଗ ଓ ଆକ୍ସେସବିଲିଟିରେ ଆପଣ ବୈଶିଷ୍ଟ୍ୟ ବଦଳାଇ ପାରିବେ।"</string> <string name="disable_accessibility_shortcut" msgid="627625354248453445">"ଶର୍ଟକଟ୍ ବନ୍ଦ କରନ୍ତୁ"</string> diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml index 7262dddbc92b..591ba0a9fcc3 100644 --- a/core/res/res/values-pa/strings.xml +++ b/core/res/res/values-pa/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ਵੌਇਸਮੇਲ ਸੁਨੇਹੇ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"ਵਾਈ-ਫਾਈ ਕਾਲਿੰਗ"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"ਸਿਮ ਅਵਸਥਾ"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"ਉੱਚ ਤਰਜੀਹੀ ਸਿਮ ਸਥਿਤੀ"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"ਪੀਅਰ ਨੇ TTY Mode FULL ਦੀ ਬੇਨਤੀ ਕੀਤੀ"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"ਪੀਅਰ ਨੇ TTY Mode HCO ਦੀ ਬੇਨਤੀ ਕੀਤੀ"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"ਪੀਅਰ ਨੇ TTY Mode VCO ਦੀ ਬੇਨਤੀ ਕੀਤੀ"</string> diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml index 4937ced8a16b..302f541e3f55 100644 --- a/core/res/res/values-pl/strings.xml +++ b/core/res/res/values-pl/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Wiadomości poczty głosowej"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Połączenia przez Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Stan karty SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Stan karty SIM – wysoki priorytet"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Drugie urządzenie zażądało trybu „TTY pełny”"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Drugie urządzenie zażądało trybu „TTY HCO”"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Drugie urządzenie zażądało trybu „TTY VCO”"</string> diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml index a5068390066e..d0e1bc95e048 100644 --- a/core/res/res/values-pt-rBR/strings.xml +++ b/core/res/res/values-pt-rBR/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensagens do correio de voz"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Chamadas por Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status do chip"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Status de prioridade alta do chip"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"TTD modo COMPLETO solicitado"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"TTD modo HCO solicitado"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"TTD modo VCO solicitado"</string> diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml index 26f92c98f0d0..a4cbc3e13fed 100644 --- a/core/res/res/values-pt-rPT/strings.xml +++ b/core/res/res/values-pt-rPT/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensagens de correio de voz"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Chamadas Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Estado do SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Estado do SIM de elevada prioridade"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"O par solicitou o modo COMPLETO de teletipo"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"O par solicitou o modo HCO de teletipo"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"O par solicitou o modo VCO de teletipo"</string> diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml index a5068390066e..d0e1bc95e048 100644 --- a/core/res/res/values-pt/strings.xml +++ b/core/res/res/values-pt/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensagens do correio de voz"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Chamadas por Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status do chip"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Status de prioridade alta do chip"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"TTD modo COMPLETO solicitado"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"TTD modo HCO solicitado"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"TTD modo VCO solicitado"</string> diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml index b29367f100f6..245864cb4cb5 100644 --- a/core/res/res/values-ro/strings.xml +++ b/core/res/res/values-ro/strings.xml @@ -96,6 +96,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mesaje din mesageria vocală"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Apelare prin Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Starea cardului SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Notificări de la SIM cu prioritate ridicată"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Cealaltă persoană a solicitat modul TTY cu setarea COMPLET"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Cealaltă persoană a solicitat modul TTY cu setarea HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Cealaltă persoană a solicitat modul TTY cu setarea VCO"</string> diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml index b363b33f59a9..29c2e124f4b8 100644 --- a/core/res/res/values-ru/strings.xml +++ b/core/res/res/values-ru/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Голосовые сообщения"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Звонки по Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Статус SIM-карты"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Важные уведомления SIM-карты"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"На устройстве абонента выбран режим телетайпа \"ВСЕ\""</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"На устройстве абонента выбран режим телетайпа HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"На устройстве абонента выбран режим телетайпа VCO"</string> diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml index 18a3158815ec..65b899c10754 100644 --- a/core/res/res/values-si/strings.xml +++ b/core/res/res/values-si/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"හඬ තැපැල් පණිවිඩ"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi ඇමතීම"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM තත්ත්වය"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"ඉහළ ප්රමුඛතා SIM තත්ත්වය"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"සම ඉල්ලීම් කළ TTY ප්රකාරය පූර්ණයි"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"සම ඉල්ලීම් කළ TTY ප්රකාරය HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"සම ඉල්ලීම් කළ TTY ප්රකාරය VCO"</string> diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml index 50b591aa1385..ee04effced2b 100644 --- a/core/res/res/values-sk/strings.xml +++ b/core/res/res/values-sk/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Správy hlasovej schránky"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Volanie cez Wi‑Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Stav SIM karty"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Stav SIM karty: vysoká priorita"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Používateľ, s ktorým komunikujete, požiadal o režim FULL textového telefónu"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Používateľ, s ktorým komunikujete, požiadal o režim HCO textového telefónu"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Používateľ, s ktorým komunikujete, požiadal o režim VCO textového telefónu"</string> diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml index af26aae6404c..bf5e88b1b2be 100644 --- a/core/res/res/values-sl/strings.xml +++ b/core/res/res/values-sl/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Sporočila v odzivniku"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Klicanje prek Wi-Fi-ja"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Stanje kartice SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Stanje kartice SIM z visoko stopnjo prednosti"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Enakovredna naprava je zahtevala način TTY FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Enakovredna naprava je zahtevala način TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Enakovredna naprava je zahtevala način TTY VCO"</string> diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml index fc4fd4fa13b3..77a83abb2bc8 100644 --- a/core/res/res/values-sq/strings.xml +++ b/core/res/res/values-sq/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mesazhet e postës zanore"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Telefonata me Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Statusi i kartës SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Statusi i kartës SIM me përparësi të lartë"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Homologu yt kërkoi modalitet \"TTY\" të plotë"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Homologu kërkoi modalitet \"TTY\" të llojit \"HCO\""</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Homologu yt kërkoi modalitet \"TTY\" të llojit \"VCO\""</string> diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml index a8dc15e40856..a8a4c5c13d5e 100644 --- a/core/res/res/values-sr/strings.xml +++ b/core/res/res/values-sr/strings.xml @@ -96,6 +96,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Поруке говорне поште"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Позивање преко Wi-Fi мреже"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Статус SIM-а"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Обавештења SIM картице са статусом „висок приоритет“"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Корисник захтева ПОТПУН режим TTY"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Корисник захтева ПРЕНОС ЗВУКА за режим TTY"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Корисник захтева ПРЕНОС ГЛАСА за режим TTY"</string> diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml index c728bcc580f2..12143f490cd0 100644 --- a/core/res/res/values-sv/strings.xml +++ b/core/res/res/values-sv/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Röstmeddelanden"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-samtal"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status för SIM-kort"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"SIM-aviseringar med hög prioritet"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Peer-enheten begärde texttelefonläget FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Peer-enheten begärde texttelefonläget HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Peer-enheten begärde texttelefonläget VCO"</string> diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml index 9f18c45a3b2c..cded9f1097af 100644 --- a/core/res/res/values-sw/strings.xml +++ b/core/res/res/values-sw/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Ujumbe wa sauti"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Kupiga simu kupitia Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Hali ya SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Hali ya SIM ya kipaumbele cha juu"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Hali ya TTY iliyoombwa na mtandao mwenza KAMILI"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Hali ya TTY iliyoombwa na mtandao mwenza HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Hali ya TTY iliyoombwa na mtandao mwenza VCO"</string> @@ -363,7 +364,7 @@ <string name="permlab_enableCarMode" msgid="5684504058192921098">"Wezesha mtindo wa gari"</string> <string name="permdesc_enableCarMode" msgid="4853187425751419467">"Inaruhusu programu kuwawezesha mtindo wa gari."</string> <string name="permlab_killBackgroundProcesses" msgid="3914026687420177202">"funga programu zingine"</string> - <string name="permdesc_killBackgroundProcesses" msgid="4593353235959733119">"Inaruhusu programu kukamilisha michakato ya usuli ya programu nyingine. Hii inaweza kusababisha programu nyingine kukoma kufanyakazi."</string> + <string name="permdesc_killBackgroundProcesses" msgid="4593353235959733119">"Huruhusu programu kukamilisha michakato ya chinichini ya programu nyingine. Hii inaweza kusababisha programu nyingine kuacha kufanya kazi."</string> <string name="permlab_systemAlertWindow" msgid="7238805243128138690">"Programu hii inaweza kuonekana juu ya programu zingine"</string> <string name="permdesc_systemAlertWindow" msgid="2393776099672266188">"Programu hii inaweza kuonekana juu ya programu zingine au sehemu zingine za skrini. Hii huenda ikaathiri matumizi ya kawaida ya programu na kubadilisha jinsi ambavyo programu zingine zinavyoonekana."</string> <string name="permlab_runInBackground" msgid="7365290743781858803">"tumia chini chini"</string> diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml index 5c0156e33291..fb815de04adf 100644 --- a/core/res/res/values-ta/strings.xml +++ b/core/res/res/values-ta/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"குரலஞ்சல் செய்திகள்"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"வைஃபை அழைப்பு"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"சிம் நிலை"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"அதிக முன்னுரிமையுடைய சிம்மின் நிலை"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"TTY Mode FULLஐ இணைச் செயல்பாடு கோரியது"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"TTY Mode HCOஐ இணைச் செயல்பாடு கோரியது"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"TTY Mode VCOஐ இணைச் செயல்பாடு கோரியது"</string> @@ -365,7 +366,7 @@ <string name="permlab_killBackgroundProcesses" msgid="3914026687420177202">"பிற பயன்பாடுகளை மூடுதல்"</string> <string name="permdesc_killBackgroundProcesses" msgid="4593353235959733119">"பிற பயன்பாடுகளின் பின்புலச் செயல்முறைகளை நிறுத்த ஆப்ஸை அனுமதிக்கிறது. இதனால் பிற பயன்பாடுகள் இயங்குவதை நிறுத்தலாம்."</string> <string name="permlab_systemAlertWindow" msgid="7238805243128138690">"இந்த ஆப்ஸ் பிற பயன்பாடுகளின் மேலே தோன்றலாம்"</string> - <string name="permdesc_systemAlertWindow" msgid="2393776099672266188">"இந்த ஆப்ஸ் பிற பயன்பாடுகளின் மேலே அல்லது திரையின் பிற பகுதிகளில் தோன்றலாம். இது வழக்கமான பயன்பாட்டு உபயோகத்தில் குறுக்கிட்டு, பிற பயன்பாடுகள் தோன்றும் விதத்தை மாற்றக்கூடும்."</string> + <string name="permdesc_systemAlertWindow" msgid="2393776099672266188">"இந்த ஆப்ஸ் பிற பயன்பாடுகளின் மேலே அல்லது திரையின் பிற பகுதிகளில் தோன்றலாம். இது வழக்கமான ஆப்ஸ் உபயோகத்தில் குறுக்கிட்டு, பிற பயன்பாடுகள் தோன்றும் விதத்தை மாற்றக்கூடும்."</string> <string name="permlab_runInBackground" msgid="7365290743781858803">"பின்னணியில் இயக்கு"</string> <string name="permdesc_runInBackground" msgid="7370142232209999824">"இந்த ஆப்ஸ், பின்னணியில் இயங்கலாம். இதனால் பேட்டரி விரைவாகத் தீர்ந்துவிடக்கூடும்."</string> <string name="permlab_useDataInBackground" msgid="8694951340794341809">"பின்னணியில் தரவைப் பயன்படுத்து"</string> diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml index 6a1f34c95fcb..776d39e1156e 100644 --- a/core/res/res/values-te/strings.xml +++ b/core/res/res/values-te/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"వాయిస్ మెయిల్ సందేశాలు"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi కాలింగ్"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM స్థితి"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"అధిక ప్రాధాన్యత గల SIM స్థితి"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"అవతలి వారు FULL TTY మోడ్ని అభ్యర్థించారు"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"అవతలి వారు HCO TTY మోడ్ని అభ్యర్థించారు"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"అవతలి వారు VCO TTY మోడ్ని అభ్యర్థించారు"</string> diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml index 3132529bea42..fdedffaea9a9 100644 --- a/core/res/res/values-th/strings.xml +++ b/core/res/res/values-th/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"ข้อความเสียง"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"การโทรผ่าน Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"สถานะซิม"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"สถานะซิมลำดับความสำคัญสูง"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"อีกฝั่งหนึ่งขอโหมด TTY เป็น \"เต็ม\""</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"อีกฝั่งหนึ่งขอโหมด TTY เป็น \"HCO\""</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"อีกฝั่งหนึ่งขอโหมด TTY เป็น \"VCO\""</string> diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml index a56a12282505..c33e5611ce7a 100644 --- a/core/res/res/values-tl/strings.xml +++ b/core/res/res/values-tl/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mga mensahe sa voicemail"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Pagtawag gamit ang Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Status ng SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"High priority na status ng SIM"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Hiniling ng peer ang TTY Mode FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Hiniling ng peer ang TTY Mode HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Hiniling ng peer ang TTY Mode VCO"</string> diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml index 34b6e5a011d2..7d69213ebe0c 100644 --- a/core/res/res/values-tr/strings.xml +++ b/core/res/res/values-tr/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Sesli mesajlar"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Kablosuz çağrı"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM durumu"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Yüksek öncelikli SIM durumu"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Karşı taraf TTY Modunu TAM yaptı"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Karşı taraf TTY Modunu HCO yaptı"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Karşı taraf TTY Modunu VCO yaptı"</string> diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml index 44058f51663c..13c89296c4bc 100644 --- a/core/res/res/values-uk/strings.xml +++ b/core/res/res/values-uk/strings.xml @@ -97,6 +97,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Повідомлення голосової пошти"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Дзвінки через Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Статус SIM-карти"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Високопріоритетні сповіщення із SIM-карти"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Пристрій змінив режим TTY на FULL"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Пристрій змінив режим TTY на HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Пристрій змінив режим TTY на VCO"</string> diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml index 7766c76f3443..dba7f8f06f67 100644 --- a/core/res/res/values-ur/strings.xml +++ b/core/res/res/values-ur/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"صوتی میل پیغامات"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi کالنگ"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM کا اسٹیٹس"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"اعلی ترجیحی SIM کی صورتحال"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"ہمسر نے TTY وضع مکمل کی درخواست کی"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"ہمسر نے TTY وضع HCO کی درخواست کی"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"ہمسر نے TTY وضع VCO کی درخواست کی"</string> diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml index ac2c83740b7b..f06a0a029b98 100644 --- a/core/res/res/values-uz/strings.xml +++ b/core/res/res/values-uz/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Ovozli xabarlar"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi chaqiruv"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM karta holati"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"SIM kartadagi muhim bildirishnomalar"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Teng huquqli ishtirokchi teletayp rejimini FULL (to‘liq) qilib o‘zgartirdi"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Teng huquqli ishtirokchi teletayp rejimini HCO (eshitadi, gapirolmaydi) qilib o‘zgartirdi"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Teng huquqli ishtirokchi teletayp rejimini VCO (gapiradi, eshitolmaydi) qilib o‘zgartirdi"</string> diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml index 429861b07100..c5bd7cc026c0 100644 --- a/core/res/res/values-vi/strings.xml +++ b/core/res/res/values-vi/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Thư thoại"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Gọi qua Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Trạng thái SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Trạng thái SIM có mức ưu tiên cao"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"TTY theo yêu cầu của thiết bị ngang hàng ở chế độ ĐẦY ĐỦ"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"TTY theo yêu cầu của thiết bị ngang hàng ở chế độ HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"TTY theo yêu cầu của thiết bị ngang hàng ở chế độ VCO"</string> diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml index 85d5cf9c7f95..487e4a020f2c 100644 --- a/core/res/res/values-zh-rCN/strings.xml +++ b/core/res/res/values-zh-rCN/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"语音邮件"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"WLAN 通话"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM 卡状态"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"高优先顺序 SIM 卡状态"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"对方请求使用“TTY 完整”模式"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"对方请求使用“TTY HCO”模式"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"对方请求使用“TTY VCO”模式"</string> @@ -297,9 +298,9 @@ <string name="permgrouplab_microphone" msgid="171539900250043464">"麦克风"</string> <string name="permgroupdesc_microphone" msgid="4988812113943554584">"录制音频"</string> <string name="permgrouprequest_microphone" msgid="9167492350681916038">"允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>录音吗?"</string> - <string name="permgrouplab_activityRecognition" msgid="1565108047054378642">"健身运动"</string> - <string name="permgroupdesc_activityRecognition" msgid="6949472038320473478">"访问您的健身运动"</string> - <string name="permgrouprequest_activityRecognition" msgid="7626438016904799383">"允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>访问您的健身运动吗?"</string> + <string name="permgrouplab_activityRecognition" msgid="1565108047054378642">"身体活动"</string> + <string name="permgroupdesc_activityRecognition" msgid="6949472038320473478">"获取您的身体活动数据"</string> + <string name="permgrouprequest_activityRecognition" msgid="7626438016904799383">"允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>获取您的身体活动数据吗?"</string> <string name="permgrouplab_camera" msgid="4820372495894586615">"相机"</string> <string name="permgroupdesc_camera" msgid="3250611594678347720">"拍摄照片和录制视频"</string> <string name="permgrouprequest_camera" msgid="1299833592069671756">"允许<b><xliff:g id="APP_NAME">%1$s</xliff:g></b>拍摄照片和录制视频吗?"</string> @@ -428,8 +429,8 @@ <string name="permdesc_recordAudio" msgid="4245930455135321433">"此应用可随时使用麦克风进行录音。"</string> <string name="permlab_sim_communication" msgid="2935852302216852065">"向 SIM 卡发送命令"</string> <string name="permdesc_sim_communication" msgid="5725159654279639498">"允许应用向SIM卡发送命令(此权限具有很高的危险性)。"</string> - <string name="permlab_activityRecognition" msgid="3634590230567608356">"识别健身运动"</string> - <string name="permdesc_activityRecognition" msgid="3143453925156552894">"此应用可以识别您的健身运动。"</string> + <string name="permlab_activityRecognition" msgid="3634590230567608356">"识别身体活动"</string> + <string name="permdesc_activityRecognition" msgid="3143453925156552894">"此应用可以识别您的身体活动。"</string> <string name="permlab_camera" msgid="3616391919559751192">"拍摄照片和视频"</string> <string name="permdesc_camera" msgid="5392231870049240670">"此应用可随时使用相机拍摄照片和录制视频。"</string> <string name="permlab_vibrate" msgid="7696427026057705834">"控制振动"</string> diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml index cce909a4e031..c634c68ba954 100644 --- a/core/res/res/values-zh-rHK/strings.xml +++ b/core/res/res/values-zh-rHK/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"留言訊息"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi 通話"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM 卡狀態"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"重要 SIM 卡狀態"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"對方曾要求 TTY 完整模式"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"對方曾要求 TTY 模式 (HCO)"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"對方曾要求 TTY 模式 (VCO)"</string> diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml index da7bc7fc2347..483d42fb4327 100644 --- a/core/res/res/values-zh-rTW/strings.xml +++ b/core/res/res/values-zh-rTW/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"語音留言"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi 通話"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"SIM 卡狀態"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"高優先順序 SIM 卡狀態"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"通訊對象要求使用 TTY 的 FULL 模式"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"通訊對象要求使用 TTY 的 HCO 模式"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"通訊對象要求使用 TTY 的 VCO 模式"</string> diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml index 2af33203bb62..9d19775f9af6 100644 --- a/core/res/res/values-zu/strings.xml +++ b/core/res/res/values-zu/strings.xml @@ -95,6 +95,7 @@ <string name="notification_channel_voice_mail" msgid="3954099424160511919">"Imilayezo yevoyisimeyili"</string> <string name="notification_channel_wfc" msgid="2130802501654254801">"Ukushaya kwe-Wi-Fi"</string> <string name="notification_channel_sim" msgid="4052095493875188564">"Isimo se-SIM"</string> + <string name="notification_channel_sim_high_prio" msgid="1787666807724243207">"Isimo se-SIM esiphezulu kakhulu"</string> <string name="peerTtyModeFull" msgid="6165351790010341421">"Umngani ucele imodi ye-TTY ephelele"</string> <string name="peerTtyModeHco" msgid="5728602160669216784">"Umngani ucele imodi ye-TTY HCO"</string> <string name="peerTtyModeVco" msgid="1742404978686538049">"Umngani ucele imodi ye-TTY VCO"</string> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 665387943bbd..609659b62948 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -748,6 +748,8 @@ <!-- Line spacing modifier for the message field of the harmful app dialog --> <item name="harmful_app_message_line_spacing_modifier" type="dimen">1.22</item> + <dimen name="seekbar_thumb_exclusion_max_size">48dp</dimen> + <!-- chooser (sharesheet) spacing --> <dimen name="chooser_corner_radius">8dp</dimen> <dimen name="chooser_row_text_option_translate">25dp</dimen> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index e265162cc116..b4edc4d88c3e 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -187,6 +187,9 @@ <string name="notification_channel_wfc">Wi-Fi calling</string> <!-- Telephony notification channel name for a channel containing SIM notifications --> <string name="notification_channel_sim">SIM status</string> + <!-- Telephony notification channel name for a channel containing high priority SIM notifications --> + <string name="notification_channel_sim_high_prio">High priority SIM status</string> + <!-- Displayed to tell the user that peer changed TTY mode --> <string name="peerTtyModeFull">Peer requested TTY Mode FULL</string> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 1f5a0100a0a7..a28bec9ce622 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -648,6 +648,7 @@ <java-symbol type="string" name="notification_channel_voice_mail" /> <java-symbol type="string" name="notification_channel_wfc" /> <java-symbol type="string" name="notification_channel_sim" /> + <java-symbol type="string" name="notification_channel_sim_high_prio" /> <java-symbol type="string" name="SetupCallDefault" /> <java-symbol type="string" name="accept" /> <java-symbol type="string" name="activity_chooser_view_see_all" /> @@ -3816,6 +3817,7 @@ <java-symbol type="color" name="chooser_gradient_highlight" /> <java-symbol type="drawable" name="chooser_direct_share_label_placeholder" /> <java-symbol type="dimen" name="chooser_direct_share_label_placeholder_max_width" /> + <java-symbol type="dimen" name="seekbar_thumb_exclusion_max_size" /> <java-symbol type="layout" name="chooser_az_label_row" /> <java-symbol type="string" name="chooser_all_apps_button_label" /> <java-symbol type="anim" name="resolver_launch_anim" /> diff --git a/core/tests/coretests/src/android/widget/AbsSeekBarTest.java b/core/tests/coretests/src/android/widget/AbsSeekBarTest.java new file mode 100644 index 000000000000..aec60963c389 --- /dev/null +++ b/core/tests/coretests/src/android/widget/AbsSeekBarTest.java @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2019 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 android.widget; + +import static android.view.View.MeasureSpec.EXACTLY; +import static android.view.View.MeasureSpec.makeMeasureSpec; + +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasSize; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import android.content.Context; +import android.graphics.Point; +import android.graphics.Rect; +import android.graphics.drawable.ShapeDrawable; +import android.graphics.drawable.shapes.RectShape; +import android.platform.test.annotations.Presubmit; +import android.view.View; + +import androidx.test.filters.SmallTest; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.util.Arrays; +import java.util.List; + +@RunWith(AndroidJUnit4.class) +@SmallTest +@Presubmit +public class AbsSeekBarTest { + + private Context mContext; + private AbsSeekBar mBar; + + @Before + public void setUp() throws Exception { + mContext = InstrumentationRegistry.getInstrumentation().getContext(); + mBar = new SeekBar(mContext); + } + + @Test + public void testExclusionForThumb_limitedTo48dp() { + mBar.setPadding(10, 10, 10, 10); + mBar.setThumb(newThumb(dpToPx(20))); + mBar.setMin(0); + mBar.setMax(100); + mBar.setProgress(50); + measureAndLayout(dpToPx(200), dpToPx(100)); + List<Rect> exclusions = mBar.getSystemGestureExclusionRects(); + + assertEquals("exclusions should be size 1, but was " + exclusions, 1, exclusions.size()); + assertEquals("exclusion should be centered on thumb", + center(mBar), center(exclusions.get(0))); + assertEquals("exclusion should be 48dp high", dpToPx(48), exclusions.get(0).height()); + assertEquals("exclusion should be 48dp wide", dpToPx(48), exclusions.get(0).width()); + } + + @Test + public void testExclusionForThumb_limitedToHeight() { + mBar.setPadding(10, 10, 10, 10); + mBar.setThumb(newThumb(dpToPx(20))); + mBar.setMin(0); + mBar.setMax(100); + mBar.setProgress(50); + measureAndLayout(dpToPx(200), dpToPx(32)); + List<Rect> exclusions = mBar.getSystemGestureExclusionRects(); + + assertEquals("exclusions should be size 1, but was " + exclusions, 1, exclusions.size()); + assertEquals("exclusion should be centered on thumb", + center(mBar), center(exclusions.get(0))); + assertEquals("exclusion should be 32dp high", dpToPx(32), exclusions.get(0).height()); + assertEquals("exclusion should be 32dp wide", dpToPx(32), exclusions.get(0).width()); + } + + @Test + public void testExclusionForThumb_passesThroughUserExclusions() { + mBar.setSystemGestureExclusionRects(Arrays.asList(new Rect(1, 2, 3, 4))); + + mBar.setPadding(10, 10, 10, 10); + mBar.setThumb(newThumb(dpToPx(20))); + mBar.setMin(0); + mBar.setMax(100); + mBar.setProgress(50); + measureAndLayout(dpToPx(200), dpToPx(32)); + + assertThat(mBar.getSystemGestureExclusionRects(), hasItem(new Rect(1, 2, 3, 4))); + assertThat(mBar.getSystemGestureExclusionRects(), hasSize(2)); + + mBar.setSystemGestureExclusionRects(Arrays.asList(new Rect(3, 4, 5, 6))); + assertThat(mBar.getSystemGestureExclusionRects(), hasItem(new Rect(3, 4, 5, 6))); + assertThat(mBar.getSystemGestureExclusionRects(), hasSize(2)); + } + + private Point center(Rect rect) { + return new Point(rect.centerX(), rect.centerY()); + } + + private Point center(View view) { + return center(new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom())); + } + + private ShapeDrawable newThumb(int size) { + final ShapeDrawable thumb = new ShapeDrawable(new RectShape()); + thumb.setIntrinsicWidth(size); + thumb.setIntrinsicHeight(size); + return thumb; + } + + private void measureAndLayout(int wPx, int hPx) { + mBar.measure(makeMeasureSpec(wPx, EXACTLY), makeMeasureSpec(hPx, EXACTLY)); + mBar.layout(0, 0, wPx, hPx); + } + + private int dpToPx(int dp) { + return (int) (mContext.getResources().getDisplayMetrics().density * dp); + } +} diff --git a/graphics/java/android/graphics/RectF.java b/graphics/java/android/graphics/RectF.java index 3361fa21e44b..1d294d51a235 100644 --- a/graphics/java/android/graphics/RectF.java +++ b/graphics/java/android/graphics/RectF.java @@ -27,7 +27,7 @@ import java.io.PrintWriter; /** * RectF holds four float coordinates for a rectangle. The rectangle is - * represented by the coordinates of its 4 edges (left, top, right bottom). + * represented by the coordinates of its 4 edges (left, top, right, bottom). * These fields can be accessed directly. Use width() and height() to retrieve * the rectangle's width and height. Note: most methods do not check to see that * the coordinates are sorted correctly (i.e. left <= right and top <= bottom). diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index f326ce8d23e9..9898a1c30856 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -148,7 +148,8 @@ void CanvasContext::setSurface(sp<Surface>&& surface) { if (surface) { mNativeSurface = new ReliableSurface{std::move(surface)}; - mNativeSurface->setDequeueTimeout(500_ms); + // TODO: Fix error handling & re-shorten timeout + mNativeSurface->setDequeueTimeout(4000_ms); } else { mNativeSurface = nullptr; } diff --git a/packages/MtpDocumentsProvider/res/values-hi/strings.xml b/packages/MtpDocumentsProvider/res/values-hi/strings.xml index bbd0ae711faf..e469fc0ee1a6 100644 --- a/packages/MtpDocumentsProvider/res/values-hi/strings.xml +++ b/packages/MtpDocumentsProvider/res/values-hi/strings.xml @@ -19,7 +19,7 @@ <string name="app_label" msgid="6271216747302322594">"MTP होस्ट"</string> <string name="downloads_app_label" msgid="7120690641874849726">"डाउनलोड"</string> <string name="root_name" msgid="5819495383921089536">"<xliff:g id="DEVICE_MODEL">%1$s</xliff:g> <xliff:g id="STORAGE_NAME">%2$s</xliff:g>"</string> - <string name="accessing_notification_title" msgid="3030133609230917944">"<xliff:g id="DEVICE_MODEL">%1$s</xliff:g> से फ़ाइलें एक्सेस कर रहा है"</string> + <string name="accessing_notification_title" msgid="3030133609230917944">"<xliff:g id="DEVICE_MODEL">%1$s</xliff:g> से फ़ाइलें ऐक्सेस कर रहा है"</string> <string name="error_busy_device" msgid="3997316850357386589">"दूसरा डिवाइस व्यस्त है. आप उसके उपलब्ध हो जाने तक फ़ाइलें ट्रांसफ़र नहीं कर सकते."</string> <string name="error_locked_device" msgid="7557872102188356147">"कोई फ़ाइल नहीं मिली. हो सकता है कि दूसरा डिवाइस लॉक हो. अगर ऐसा है, तो उसे अनलॉक करें और दोबारा कोशिश करें."</string> </resources> diff --git a/packages/PrintSpooler/res/values-or/strings.xml b/packages/PrintSpooler/res/values-or/strings.xml index 7eeac8771032..f385391c8d78 100644 --- a/packages/PrintSpooler/res/values-or/strings.xml +++ b/packages/PrintSpooler/res/values-or/strings.xml @@ -72,7 +72,7 @@ <string name="select_to_add_printers" msgid="3800709038689830974">"ପ୍ରିଣ୍ଟର ଯୋଡ଼ିବାକୁ ଚୟନ କରନ୍ତୁ"</string> <string name="enable_print_service" msgid="3482815747043533842">"ସକ୍ଷମ କରିବା ପାଇଁ ଚୟନ କରନ୍ତୁ"</string> <string name="enabled_services_title" msgid="7036986099096582296">"ସକ୍ଷମ କରାଯାଇଥିବା ସର୍ଭିସ୍"</string> - <string name="recommended_services_title" msgid="3799434882937956924">"ସୁପାରିସ କରାଯାଇଥିବା ସର୍ଭିସ୍"</string> + <string name="recommended_services_title" msgid="3799434882937956924">"ସୁପାରିଶ କରାଯାଇଥିବା ସର୍ଭିସ୍"</string> <string name="disabled_services_title" msgid="7313253167968363211">"ଅକ୍ଷମ କରାଯାଇଥିବା ସର୍ଭିସ୍"</string> <string name="all_services_title" msgid="5578662754874906455">"ସମସ୍ତ ସର୍ଭିସ୍"</string> <plurals name="print_services_recommendation_subtitle" formatted="false" msgid="5678487708807185138"> diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml index 238eba58e0a5..3a20d04d7ab2 100644 --- a/packages/SettingsLib/res/values-hi/strings.xml +++ b/packages/SettingsLib/res/values-hi/strings.xml @@ -46,7 +46,7 @@ <string name="wifi_limited_connection" msgid="7717855024753201527">"सीमित कनेक्शन"</string> <string name="wifi_status_no_internet" msgid="5784710974669608361">"इंटरनेट कनेक्शन नहीं है"</string> <string name="wifi_status_sign_in_required" msgid="123517180404752756">"साइन इन करना ज़रूरी है"</string> - <string name="wifi_ap_unable_to_handle_new_sta" msgid="5348824313514404541">"एक्सेस पॉइंट फ़िलहाल भरा हुआ है"</string> + <string name="wifi_ap_unable_to_handle_new_sta" msgid="5348824313514404541">"ऐक्सेस पॉइंट फ़िलहाल भरा हुआ है"</string> <string name="connected_via_carrier" msgid="7583780074526041912">"%1$s के ज़रिए कनेक्ट"</string> <string name="available_via_carrier" msgid="1469036129740799053">"%1$s के ज़रिए उपलब्ध"</string> <string name="osu_opening_provider" msgid="5488997661548640424">"<xliff:g id="PASSPOINTPROVIDER">%1$s</xliff:g> खोला जा रहा है"</string> @@ -68,7 +68,7 @@ <string name="bluetooth_pairing" msgid="1426882272690346242">"युग्मित कर रहा है…"</string> <string name="bluetooth_connected_no_headset" msgid="616068069034994802">"जुड़ गया (फ़ोन के ऑडियो को छोड़कर)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string> <string name="bluetooth_connected_no_a2dp" msgid="3736431800395923868">"जुड़ गया (मीडिया ऑडियो को छोड़कर)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string> - <string name="bluetooth_connected_no_map" msgid="3200033913678466453">"जुड़ गया (मैसेज का एक्सेस नहीं)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string> + <string name="bluetooth_connected_no_map" msgid="3200033913678466453">"जुड़ गया (मैसेज का ऐक्सेस नहीं)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string> <string name="bluetooth_connected_no_headset_no_a2dp" msgid="2047403011284187056">"जुड़ गया (फ़ोन या मीडिया ऑडियो को छोड़कर)<xliff:g id="ACTIVE_DEVICE">%1$s</xliff:g>"</string> <string name="bluetooth_connected_battery_level" msgid="5162924691231307748">"जुड़ गया, बैटरी का लेवल <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g><xliff:g id="ACTIVE_DEVICE">%2$s</xliff:g>"</string> <string name="bluetooth_connected_no_headset_battery_level" msgid="1610296229139400266">"जुड़ गया (फ़ोन के ऑडियो को छोड़कर), बैटरी का लेवल <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g><xliff:g id="ACTIVE_DEVICE">%2$s</xliff:g>"</string> @@ -88,7 +88,7 @@ <string name="bluetooth_profile_pbap_summary" msgid="6605229608108852198">"संपर्क साझाकरण के लिए उपयोग करें"</string> <string name="bluetooth_profile_pan_nap" msgid="8429049285027482959">"इंटरनेट कनेक्शन साझाकरण"</string> <string name="bluetooth_profile_map" msgid="1019763341565580450">"लेख संदेश"</string> - <string name="bluetooth_profile_sap" msgid="5764222021851283125">"सिम एक्सेस"</string> + <string name="bluetooth_profile_sap" msgid="5764222021851283125">"सिम ऐक्सेस"</string> <string name="bluetooth_profile_a2dp_high_quality" msgid="5444517801472820055">"HD ऑडियो: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string> <string name="bluetooth_profile_a2dp_high_quality_unknown_codec" msgid="8510588052415438887">"HD ऑडियो"</string> <string name="bluetooth_profile_hearing_aid" msgid="6680721080542444257">"सुनने में मदद करने वाले डिवाइस"</string> @@ -200,7 +200,7 @@ <string name="development_settings_not_available" msgid="4308569041701535607">"यह उपयोगकर्ता, डेवलपर के लिए सेटिंग और टूल का इस्तेमाल नहीं कर सकता"</string> <string name="vpn_settings_not_available" msgid="956841430176985598">"VPN सेटिंग इस उपयोगकर्ता के लिए उपलब्ध नहीं हैं"</string> <string name="tethering_settings_not_available" msgid="6765770438438291012">"टेदरिंग सेटिंग इस उपयोगकर्ता के लिए उपलब्ध नहीं हैं"</string> - <string name="apn_settings_not_available" msgid="7873729032165324000">"एक्सेस पॉइंट के नाम की सेटिंग इस उपयोगकर्ता के लिए मौजूद नहीं हैं"</string> + <string name="apn_settings_not_available" msgid="7873729032165324000">"ऐक्सेस पॉइंट के नाम की सेटिंग इस उपयोगकर्ता के लिए मौजूद नहीं हैं"</string> <string name="enable_adb" msgid="7982306934419797485">"USB डीबग करना"</string> <string name="enable_adb_summary" msgid="4881186971746056635">"डीबग मोड जब USB कनेक्ट किया गया हो"</string> <string name="clear_adb_keys" msgid="4038889221503122743">"USB डीबग करने की मंज़ूरी रद्द करें"</string> @@ -414,7 +414,7 @@ <string name="disabled" msgid="9206776641295849915">"बंद किया गया"</string> <string name="external_source_trusted" msgid="2707996266575928037">"अनुमति है"</string> <string name="external_source_untrusted" msgid="2677442511837596726">"अनुमति नहीं है"</string> - <string name="install_other_apps" msgid="6986686991775883017">"अनजान ऐप्लिकेशन इंस्टॉल करने का एक्सेस"</string> + <string name="install_other_apps" msgid="6986686991775883017">"अनजान ऐप्लिकेशन इंस्टॉल करने का ऐक्सेस"</string> <string name="home" msgid="3256884684164448244">"सेटिंग का होम पेज"</string> <string-array name="battery_labels"> <item msgid="8494684293649631252">"0%"</item> diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java index f16fb1c91b7c..6b1ceae4bed8 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java @@ -1435,7 +1435,7 @@ public class AccessPoint implements Comparable<AccessPoint> { void update(@Nullable WifiConfiguration config) { mConfig = config; - if (mConfig != null) { + if (mConfig != null && !isPasspoint()) { ssid = removeDoubleQuotes(mConfig.SSID); } networkId = config != null ? config.networkId : WifiConfiguration.INVALID_NETWORK_ID; diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java index 9d398b5b69a1..d884fab518ce 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java @@ -56,6 +56,7 @@ import java.time.DateTimeException; import java.util.Arrays; import java.util.HashSet; import java.util.Map; +import java.util.Set; import java.util.zip.CRC32; /** @@ -241,6 +242,8 @@ public class SettingsBackupAgent extends BackupAgentHelper { HashSet<String> movedToGlobal = new HashSet<String>(); Settings.System.getMovedToGlobalSettings(movedToGlobal); Settings.Secure.getMovedToGlobalSettings(movedToGlobal); + Set<String> movedToSecure = getMovedToSecureSettings(); + byte[] restoredWifiSupplicantData = null; byte[] restoredWifiIpConfigData = null; @@ -259,16 +262,17 @@ public class SettingsBackupAgent extends BackupAgentHelper { switch (key) { case KEY_SYSTEM : - restoreSettings(data, Settings.System.CONTENT_URI, movedToGlobal); + restoreSettings(data, Settings.System.CONTENT_URI, movedToGlobal, + movedToSecure); mSettingsHelper.applyAudioSettings(); break; case KEY_SECURE : - restoreSettings(data, Settings.Secure.CONTENT_URI, movedToGlobal); + restoreSettings(data, Settings.Secure.CONTENT_URI, movedToGlobal, null); break; case KEY_GLOBAL : - restoreSettings(data, Settings.Global.CONTENT_URI, null); + restoreSettings(data, Settings.Global.CONTENT_URI, null, movedToSecure); break; case KEY_WIFI_SUPPLICANT : @@ -347,20 +351,22 @@ public class SettingsBackupAgent extends BackupAgentHelper { HashSet<String> movedToGlobal = new HashSet<String>(); Settings.System.getMovedToGlobalSettings(movedToGlobal); Settings.Secure.getMovedToGlobalSettings(movedToGlobal); + Set<String> movedToSecure = getMovedToSecureSettings(); // system settings data first int nBytes = in.readInt(); if (DEBUG_BACKUP) Log.d(TAG, nBytes + " bytes of settings data"); byte[] buffer = new byte[nBytes]; in.readFully(buffer, 0, nBytes); - restoreSettings(buffer, nBytes, Settings.System.CONTENT_URI, movedToGlobal); + restoreSettings(buffer, nBytes, Settings.System.CONTENT_URI, movedToGlobal, + movedToSecure); // secure settings nBytes = in.readInt(); if (DEBUG_BACKUP) Log.d(TAG, nBytes + " bytes of secure settings data"); if (nBytes > buffer.length) buffer = new byte[nBytes]; in.readFully(buffer, 0, nBytes); - restoreSettings(buffer, nBytes, Settings.Secure.CONTENT_URI, movedToGlobal); + restoreSettings(buffer, nBytes, Settings.Secure.CONTENT_URI, movedToGlobal, null); // Global only if sufficiently new if (version >= FULL_BACKUP_ADDED_GLOBAL) { @@ -369,7 +375,8 @@ public class SettingsBackupAgent extends BackupAgentHelper { if (nBytes > buffer.length) buffer = new byte[nBytes]; in.readFully(buffer, 0, nBytes); movedToGlobal.clear(); // no redirection; this *is* the global namespace - restoreSettings(buffer, nBytes, Settings.Global.CONTENT_URI, movedToGlobal); + restoreSettings(buffer, nBytes, Settings.Global.CONTENT_URI, movedToGlobal, + movedToSecure); } // locale @@ -440,6 +447,13 @@ public class SettingsBackupAgent extends BackupAgentHelper { } } + private Set<String> getMovedToSecureSettings() { + Set<String> movedToSecureSettings = new HashSet<>(); + Settings.Global.getMovedToSecureSettings(movedToSecureSettings); + Settings.System.getMovedToSecureSettings(movedToSecureSettings); + return movedToSecureSettings; + } + private long[] readOldChecksums(ParcelFileDescriptor oldState) throws IOException { long[] stateChecksums = new long[STATE_SIZE]; @@ -564,7 +578,7 @@ public class SettingsBackupAgent extends BackupAgentHelper { } private void restoreSettings(BackupDataInput data, Uri contentUri, - HashSet<String> movedToGlobal) { + HashSet<String> movedToGlobal, Set<String> movedToSecure) { byte[] settings = new byte[data.getDataSize()]; try { data.readEntityData(settings, 0, settings.length); @@ -572,11 +586,11 @@ public class SettingsBackupAgent extends BackupAgentHelper { Log.e(TAG, "Couldn't read entity data"); return; } - restoreSettings(settings, settings.length, contentUri, movedToGlobal); + restoreSettings(settings, settings.length, contentUri, movedToGlobal, movedToSecure); } private void restoreSettings(byte[] settings, int bytes, Uri contentUri, - HashSet<String> movedToGlobal) { + HashSet<String> movedToGlobal, Set<String> movedToSecure) { if (DEBUG) { Log.i(TAG, "restoreSettings: " + contentUri); } @@ -651,9 +665,14 @@ public class SettingsBackupAgent extends BackupAgentHelper { continue; } - final Uri destination = (movedToGlobal != null && movedToGlobal.contains(key)) - ? Settings.Global.CONTENT_URI - : contentUri; + final Uri destination; + if (movedToGlobal != null && movedToGlobal.contains(key)) { + destination = Settings.Global.CONTENT_URI; + } else if (movedToSecure != null && movedToSecure.contains(key)) { + destination = Settings.Secure.CONTENT_URI; + } else { + destination = contentUri; + } settingsHelper.restoreValue(this, cr, contentValues, destination, key, value, mRestoredFromSdkInt); diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml index 08fb0b38c770..90ead3514b1d 100644 --- a/packages/SystemUI/res/values-da/strings.xml +++ b/packages/SystemUI/res/values-da/strings.xml @@ -255,8 +255,8 @@ <string name="accessibility_quick_settings_flashlight_on" msgid="2003479320007841077">"Lommelygten er tændt."</string> <string name="accessibility_quick_settings_flashlight_changed_off" msgid="3303701786768224304">"Lommelygten er slukket."</string> <string name="accessibility_quick_settings_flashlight_changed_on" msgid="6531793301533894686">"Lommelygten er tændt."</string> - <string name="accessibility_quick_settings_color_inversion_changed_off" msgid="4406577213290173911">"Invertering af farver er slået fra."</string> - <string name="accessibility_quick_settings_color_inversion_changed_on" msgid="6897462320184911126">"Invertering af farver er slået til."</string> + <string name="accessibility_quick_settings_color_inversion_changed_off" msgid="4406577213290173911">"Ombytning af farver er slået fra."</string> + <string name="accessibility_quick_settings_color_inversion_changed_on" msgid="6897462320184911126">"Ombytning af farver er slået til."</string> <string name="accessibility_quick_settings_hotspot_changed_off" msgid="5004708003447561394">"Mobilhotspot er slået fra."</string> <string name="accessibility_quick_settings_hotspot_changed_on" msgid="2890951609226476206">"Mobilhotspot er slået til."</string> <string name="accessibility_casting_turned_off" msgid="1430668982271976172">"Casting af din skærm er stoppet."</string> diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml index a3069a1e174f..552d12ee6390 100644 --- a/packages/SystemUI/res/values-fr-rCA/strings.xml +++ b/packages/SystemUI/res/values-fr-rCA/strings.xml @@ -886,7 +886,7 @@ <string name="qs_dnd_prompt_app" msgid="7978037419334156034">"Le mode Ne pas déranger a été activé par une application (<xliff:g id="ID_1">%s</xliff:g>)."</string> <string name="qs_dnd_prompt_auto_rule_app" msgid="2599343675391111951">"Le mode Ne pas déranger a été activé par une règle automatique ou une application."</string> <string name="qs_dnd_until" msgid="3469471136280079874">"Jusqu\'à <xliff:g id="ID_1">%s</xliff:g>"</string> - <string name="qs_dnd_keep" msgid="1825009164681928736">"Garder"</string> + <string name="qs_dnd_keep" msgid="1825009164681928736">"Conserver"</string> <string name="qs_dnd_replace" msgid="8019520786644276623">"Remplacer"</string> <string name="running_foreground_services_title" msgid="381024150898615683">"Applications qui fonctionnent en arrière-plan"</string> <string name="running_foreground_services_msg" msgid="6326247670075574355">"Touchez pour afficher des détails sur l\'utilisation de la pile et des données"</string> diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml index 263fe8a31a9a..3fa2a48188c9 100644 --- a/packages/SystemUI/res/values-hi/strings.xml +++ b/packages/SystemUI/res/values-hi/strings.xml @@ -46,8 +46,8 @@ <string name="bluetooth_tethered" msgid="7094101612161133267">"ब्लूटूथ टीदर किया गया"</string> <string name="status_bar_input_method_settings_configure_input_methods" msgid="3504292471512317827">"इनपुट का तरीका सेट करें"</string> <string name="status_bar_use_physical_keyboard" msgid="7551903084416057810">"सामान्य कीबोर्ड"</string> - <string name="usb_device_permission_prompt" msgid="1825685909587559679">"<xliff:g id="APPLICATION">%1$s</xliff:g> को <xliff:g id="USB_DEVICE">%2$s</xliff:g> के एक्सेस की अनुमति दें?"</string> - <string name="usb_accessory_permission_prompt" msgid="2465531696941369047">"<xliff:g id="APPLICATION">%1$s</xliff:g> को <xliff:g id="USB_ACCESSORY">%2$s</xliff:g> के एक्सेस की अनुमति दें?"</string> + <string name="usb_device_permission_prompt" msgid="1825685909587559679">"<xliff:g id="APPLICATION">%1$s</xliff:g> को <xliff:g id="USB_DEVICE">%2$s</xliff:g> के ऐक्सेस की अनुमति दें?"</string> + <string name="usb_accessory_permission_prompt" msgid="2465531696941369047">"<xliff:g id="APPLICATION">%1$s</xliff:g> को <xliff:g id="USB_ACCESSORY">%2$s</xliff:g> के ऐक्सेस की अनुमति दें?"</string> <string name="usb_device_confirm_prompt" msgid="7440562274256843905">"<xliff:g id="USB_DEVICE">%2$s</xliff:g> के लिए <xliff:g id="APPLICATION">%1$s</xliff:g> खोलें?"</string> <string name="usb_accessory_confirm_prompt" msgid="4333670517539993561">"<xliff:g id="USB_ACCESSORY">%2$s</xliff:g> के लिए <xliff:g id="APPLICATION">%1$s</xliff:g> खोलें?"</string> <string name="usb_accessory_uri_prompt" msgid="513450621413733343">"इस USB सहायक डिवाइस के साथ कोई भी इंस्टॉल ऐप्स काम नहीं करता. इस सहायक डिवाइस के बारे में यहां ज़्यादा जानें: <xliff:g id="URL">%1$s</xliff:g>"</string> @@ -205,7 +205,7 @@ <string name="accessibility_overflow_action" msgid="5681882033274783311">"पूरी सूचनाएं देखें"</string> <string name="accessibility_remove_notification" msgid="3603099514902182350">"सूचना साफ़ करें"</string> <string name="accessibility_gps_enabled" msgid="3511469499240123019">"GPS सक्षम."</string> - <string name="accessibility_gps_acquiring" msgid="8959333351058967158">"GPS प्राप्त करना."</string> + <string name="accessibility_gps_acquiring" msgid="8959333351058967158">"GPS पाना."</string> <string name="accessibility_tty_enabled" msgid="4613200365379426561">"टेलीटाइपराइटर सक्षम."</string> <string name="accessibility_ringer_vibrate" msgid="666585363364155055">"रिंगर कंपन (वाइब्रेशन)."</string> <string name="accessibility_ringer_silent" msgid="9061243307939135383">"रिंगर मौन."</string> @@ -452,8 +452,8 @@ <string name="battery_saver_notification_title" msgid="8614079794522291840">"बैटरी सेवर चालू है"</string> <string name="battery_saver_notification_text" msgid="820318788126672692">"निष्पादन और पृष्ठभूमि डेटा को कम करता है"</string> <string name="battery_saver_notification_action_text" msgid="132118784269455533">"बैटरी सेवर बंद करें"</string> - <string name="media_projection_dialog_text" msgid="8585357687598538511">"रिकॉर्ड या कास्ट करते समय, <xliff:g id="APP_SEEKING_PERMISSION">%s</xliff:g> आपकी स्क्रीन पर दिखाई जा रही या आपके डिवाइस पर चलाई जा रही संवेदनशील जानकारी एक्सेस कर सकता है. इस जानकारी में ऑडियो, पासवर्ड, भुगतान की जानकारी, फ़ोटो और मैसेज शामिल हैं."</string> - <string name="media_projection_dialog_service_text" msgid="3075544489835858258">"रिकॉर्ड या कास्ट करते समय, यह सेवा देने वाला ऐप्लिकेशन आपकी स्क्रीन पर दिखाई जा रही या आपके डिवाइस पर चलाई जा रही संवेदनशील जानकारी एक्सेस कर सकता है. इस जानकारी में ऑडियो, पासवर्ड, भुगतान की जानकारी, फ़ोटो और मैसेज शामिल हैं."</string> + <string name="media_projection_dialog_text" msgid="8585357687598538511">"रिकॉर्ड या कास्ट करते समय, <xliff:g id="APP_SEEKING_PERMISSION">%s</xliff:g> आपकी स्क्रीन पर दिखाई जा रही या आपके डिवाइस पर चलाई जा रही संवेदनशील जानकारी ऐक्सेस कर सकता है. इस जानकारी में ऑडियो, पासवर्ड, भुगतान की जानकारी, फ़ोटो और मैसेज शामिल हैं."</string> + <string name="media_projection_dialog_service_text" msgid="3075544489835858258">"रिकॉर्ड या कास्ट करते समय, यह सेवा देने वाला ऐप्लिकेशन आपकी स्क्रीन पर दिखाई जा रही या आपके डिवाइस पर चलाई जा रही संवेदनशील जानकारी ऐक्सेस कर सकता है. इस जानकारी में ऑडियो, पासवर्ड, भुगतान की जानकारी, फ़ोटो और मैसेज शामिल हैं."</string> <string name="media_projection_dialog_title" msgid="8124184308671641248">"कास्ट करने/रिकॉर्ड करने के दौरान संवेदनशील जानकारी का सबके सामने आ जाना"</string> <string name="media_projection_remember_text" msgid="3103510882172746752">"फिर से न दिखाएं"</string> <string name="clear_all_notifications_text" msgid="814192889771462828">"सभी को हटाएं"</string> diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml index 20f638d04077..676208bb02f7 100644 --- a/packages/SystemUI/res/values-mr/strings.xml +++ b/packages/SystemUI/res/values-mr/strings.xml @@ -747,7 +747,7 @@ <string name="data_saver" msgid="5037565123367048522">"डेटा सेव्हर"</string> <string name="accessibility_data_saver_on" msgid="8454111686783887148">"डेटा सेव्हर चालू आहे"</string> <string name="accessibility_data_saver_off" msgid="8841582529453005337">"डेटा सेव्हर बंद आहे"</string> - <string name="switch_bar_on" msgid="1142437840752794229">"चालू"</string> + <string name="switch_bar_on" msgid="1142437840752794229">"सुरू"</string> <string name="switch_bar_off" msgid="8803270596930432874">"बंद"</string> <string name="nav_bar" msgid="1993221402773877607">"नॅव्हिगेशन बार"</string> <string name="nav_bar_layout" msgid="3664072994198772020">"लेआउट"</string> diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml index f124d89070bf..6becd21984b9 100644 --- a/packages/SystemUI/res/values/attrs.xml +++ b/packages/SystemUI/res/values/attrs.xml @@ -75,14 +75,15 @@ <attr name="horizontalSpacing" format="dimension" /> </declare-styleable> - <!-- Theme for icons in the status bar (light/dark). background/fillColor is used for dual tone - icons like wifi and signal, and singleToneColor is used for icons with only one tone. + <!-- Theme for icons in the status/nav bar (light/dark). background/fillColor is used for dual + tone icons like wifi and signal, and singleToneColor is used for icons with only one tone. Contract: Pixel with fillColor blended over backgroundColor blended over translucent should equal to singleToneColor blended over translucent. --> <declare-styleable name="TonedIcon"> <attr name="backgroundColor" format="integer" /> <attr name="fillColor" format="integer" /> <attr name="singleToneColor" format="integer" /> + <attr name="homeHandleColor" format="integer" /> </declare-styleable> <declare-styleable name="StatusBarWindowView_Layout"> diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index e7a1a660abc2..61816f60d0ba 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -116,6 +116,9 @@ <!-- The color of the navigation bar icons. Need to be in sync with ic_sysbar_* --> <color name="navigation_bar_icon_color">#E5FFFFFF</color> + <color name="navigation_bar_home_handle_light_color">#EBffffff</color> + <color name="navigation_bar_home_handle_dark_color">#99000000</color> + <!-- The shadow color for light navigation bar icons. --> <color name="nav_key_button_shadow_color">#30000000</color> diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 861187fded15..340cb3ad7358 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -482,4 +482,7 @@ --> <string name="config_rounded_mask" translatable="false">"M8,0C3.6,0,0,3.6,0,8"</string> + <!-- Preferred refresh rate at keyguard, if supported by the display --> + <integer name="config_keyguardRefreshRate">-1</integer> + </resources> diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 2f1770a39f02..6374191c4d7b 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -366,11 +366,13 @@ <item name="backgroundColor">@color/light_mode_icon_color_dual_tone_background</item> <item name="fillColor">@color/light_mode_icon_color_dual_tone_fill</item> <item name="singleToneColor">@color/light_mode_icon_color_single_tone</item> + <item name="homeHandleColor">@color/navigation_bar_home_handle_light_color</item> </style> <style name="DualToneDarkTheme"> <item name="backgroundColor">@color/dark_mode_icon_color_dual_tone_background</item> <item name="fillColor">@color/dark_mode_icon_color_dual_tone_fill</item> <item name="singleToneColor">@color/dark_mode_icon_color_single_tone</item> + <item name="homeHandleColor">@color/navigation_bar_home_handle_dark_color</item> </style> <style name="QSHeaderDarkTheme"> <item name="backgroundColor">@color/dark_mode_qs_icon_color_dual_tone_background</item> diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/TaskKeyLruCache.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/TaskKeyLruCache.java index b2c79a4c0a32..e106c657109d 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/TaskKeyLruCache.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/model/TaskKeyLruCache.java @@ -52,7 +52,11 @@ public class TaskKeyLruCache<V> extends TaskKeyCache<V> { if (mEvictionCallback != null) { mEvictionCallback.onEntryEvicted(mKeys.get(taskId)); } - mKeys.remove(taskId); + + // Only remove from mKeys on cache remove, not a cache update. + if (newV == null) { + mKeys.remove(taskId); + } } }; } diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java index cc7863c0113b..c732584eddfc 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java @@ -80,18 +80,25 @@ public class QuickStepContract { public static final int SYSUI_STATE_HOME_DISABLED = 1 << 8; // The keyguard is showing, but occluded public static final int SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED = 1 << 9; + // The search feature is disabled (either by SUW/SysUI/device policy) + public static final int SYSUI_STATE_SEARCH_DISABLED = 1 << 10; + // The notification panel is expanded and interactive (either locked or unlocked), and the + // quick settings is not expanded + public static final int SYSUI_STATE_QUICK_SETTINGS_EXPANDED = 1 << 11; @Retention(RetentionPolicy.SOURCE) @IntDef({SYSUI_STATE_SCREEN_PINNING, SYSUI_STATE_NAV_BAR_HIDDEN, SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED, + SYSUI_STATE_QUICK_SETTINGS_EXPANDED, SYSUI_STATE_BOUNCER_SHOWING, SYSUI_STATE_A11Y_BUTTON_CLICKABLE, SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE, SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING, SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED, SYSUI_STATE_OVERVIEW_DISABLED, - SYSUI_STATE_HOME_DISABLED + SYSUI_STATE_HOME_DISABLED, + SYSUI_STATE_SEARCH_DISABLED }) public @interface SystemUiStateFlags {} @@ -100,8 +107,10 @@ public class QuickStepContract { str.add((flags & SYSUI_STATE_SCREEN_PINNING) != 0 ? "screen_pinned" : ""); str.add((flags & SYSUI_STATE_OVERVIEW_DISABLED) != 0 ? "overview_disabled" : ""); str.add((flags & SYSUI_STATE_HOME_DISABLED) != 0 ? "home_disabled" : ""); + str.add((flags & SYSUI_STATE_SEARCH_DISABLED) != 0 ? "search_disabled" : ""); str.add((flags & SYSUI_STATE_NAV_BAR_HIDDEN) != 0 ? "navbar_hidden" : ""); str.add((flags & SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED) != 0 ? "notif_visible" : ""); + str.add((flags & SYSUI_STATE_QUICK_SETTINGS_EXPANDED) != 0 ? "qs_visible" : ""); str.add((flags & SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING) != 0 ? "keygrd_visible" : ""); str.add((flags & SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED) != 0 ? "keygrd_occluded" : ""); @@ -150,10 +159,13 @@ public class QuickStepContract { * disabled. */ public static boolean isAssistantGestureDisabled(int sysuiStateFlags) { - // Disable when in screen pinning, immersive, the bouncer is showing + // Disable when in quick settings, screen pinning, immersive, the bouncer is showing, + // or search is disabled int disableFlags = SYSUI_STATE_SCREEN_PINNING | SYSUI_STATE_NAV_BAR_HIDDEN - | SYSUI_STATE_BOUNCER_SHOWING; + | SYSUI_STATE_BOUNCER_SHOWING + | SYSUI_STATE_SEARCH_DISABLED + | SYSUI_STATE_QUICK_SETTINGS_EXPANDED; if ((sysuiStateFlags & disableFlags) != 0) { return true; } diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java index d2fe5cd9ef64..2ef042210e67 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java @@ -91,6 +91,7 @@ public class RecentsAnimationControllerCompat { } } + @Deprecated public void setCancelWithDeferredScreenshot(boolean screenshot) { try { mAnimationController.setCancelWithDeferredScreenshot(screenshot); @@ -99,6 +100,14 @@ public class RecentsAnimationControllerCompat { } } + public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) { + try { + mAnimationController.setDeferCancelUntilNextTransition(defer, screenshot); + } catch (RemoteException e) { + Log.e(TAG, "Failed to set deferred cancel with screenshot", e); + } + } + public void cleanupScreenshot() { try { mAnimationController.cleanupScreenshot(); diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/SystemGestureExclusionListenerCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/SystemGestureExclusionListenerCompat.java index 9fdecfbd44a0..aeb0415c8c4c 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/SystemGestureExclusionListenerCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/SystemGestureExclusionListenerCompat.java @@ -34,9 +34,11 @@ public abstract class SystemGestureExclusionListenerCompat { new ISystemGestureExclusionListener.Stub() { @Override public void onSystemGestureExclusionChanged(int displayId, - Region systemGestureExclusion) { + Region systemGestureExclusion, Region unrestrictedOrNull) { if (displayId == mDisplayId) { - onExclusionChanged(systemGestureExclusion); + Region unrestricted = (unrestrictedOrNull == null) + ? systemGestureExclusion : unrestrictedOrNull; + onExclusionChanged(systemGestureExclusion, unrestricted); } } }; @@ -47,11 +49,29 @@ public abstract class SystemGestureExclusionListenerCompat { } /** - * Called when the exclusion region has changed + * Called when the exclusion region has changed. + * + * TODO: remove, once all subclasses have migrated to + * {@link #onExclusionChanged(Region, Region)}. */ public abstract void onExclusionChanged(Region systemGestureExclusion); /** + * Called when the exclusion region has changed. + * + * @param systemGestureExclusion the system gesture exclusion to be applied + * @param systemGestureExclusionUnrestricted what would be the system gesture exclusion, if + * there were no restrictions being applied. For logging purposes only. + * + */ + public void onExclusionChanged(Region systemGestureExclusion, + Region systemGestureExclusionUnrestricted) { + // TODO: make abstract, once all subclasses have migrated away from + // onExclusionChanged(Region) + onExclusionChanged(systemGestureExclusion); + } + + /** * Registers the listener for getting exclusion rect changes. */ public void register() { diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentTaskInfoCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/TaskInfoCompat.java index a5299038d3a9..326c2aa37175 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentTaskInfoCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/TaskInfoCompat.java @@ -17,29 +17,32 @@ package com.android.systemui.shared.system; import android.app.ActivityManager; +import android.app.TaskInfo; import android.content.ComponentName; -public class RecentTaskInfoCompat { +public class TaskInfoCompat { - private ActivityManager.RecentTaskInfo mInfo; + public static int getUserId(TaskInfo info) { + return info.userId; + } - public RecentTaskInfoCompat(ActivityManager.RecentTaskInfo info) { - mInfo = info; + public static int getActivityType(TaskInfo info) { + return info.configuration.windowConfiguration.getActivityType(); } - public int getUserId() { - return mInfo.userId; + public static int getWindowingMode(TaskInfo info) { + return info.configuration.windowConfiguration.getWindowingMode(); } - public boolean supportsSplitScreenMultiWindow() { - return mInfo.supportsSplitScreenMultiWindow; + public static boolean supportsSplitScreenMultiWindow(TaskInfo info) { + return info.supportsSplitScreenMultiWindow; } - public ComponentName getTopActivity() { - return mInfo.topActivity; + public static ComponentName getTopActivity(TaskInfo info) { + return info.topActivity; } - public ActivityManager.TaskDescription getTaskDescription() { - return mInfo.taskDescription; + public static ActivityManager.TaskDescription getTaskDescription(TaskInfo info) { + return info.taskDescription; } } diff --git a/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java b/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java index 11d093f22840..10d132ad2763 100644 --- a/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java +++ b/packages/SystemUI/src/com/android/keyguard/CarrierTextController.java @@ -400,8 +400,11 @@ public class CarrierTextController { } } + if (TextUtils.isEmpty(displayText)) displayText = joinNotEmpty(mSeparator, carrierNames); + displayText = updateCarrierTextWithSimIoError(displayText, carrierNames, subOrderBySlot, allSimsMissing); + boolean airplaneMode = false; // APM (airplane mode) != no carrier state. There are carrier services // (e.g. WFC = Wi-Fi calling) which may operate in APM. @@ -410,9 +413,6 @@ public class CarrierTextController { airplaneMode = true; } - if (TextUtils.isEmpty(displayText) && !airplaneMode) { - displayText = joinNotEmpty(mSeparator, carrierNames); - } final CarrierTextCallbackInfo info = new CarrierTextCallbackInfo( displayText, carrierNames, diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java index 2483192eb04e..5097216a7405 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java @@ -584,6 +584,9 @@ public class KeyguardClockSwitch extends RelativeLayout { @Override public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) { + if (!sceneRoot.isShown()) { + return null; + } final float cutoff = mCutoff; final int startVisibility = View.INVISIBLE; final int endVisibility = (int) endValues.values.get(PROPNAME_VISIBILITY); @@ -596,6 +599,9 @@ public class KeyguardClockSwitch extends RelativeLayout { @Override public Animator onDisappear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) { + if (!sceneRoot.isShown()) { + return null; + } final float cutoff = 1f - mCutoff; final int startVisibility = View.VISIBLE; final int endVisibility = (int) endValues.values.get(PROPNAME_VISIBILITY); diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java index 4ad262fee520..8059dcf33df7 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java @@ -269,7 +269,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe */ private void updateBiometricRetry() { SecurityMode securityMode = getSecurityMode(); - mSwipeUpToRetry = mUnlockMethodCache.isUnlockingWithFacePossible() + mSwipeUpToRetry = mUnlockMethodCache.isFaceAuthEnabled() && securityMode != SecurityMode.SimPin && securityMode != SecurityMode.SimPuk && securityMode != SecurityMode.None; diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java index fb3a586677aa..69da990a0a73 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java @@ -123,7 +123,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView { msg = rez.getString(R.string.kg_sim_lock_esim_instructions, msg); } - if (mSecurityMessageDisplay != null) { + if (mSecurityMessageDisplay != null && getVisibility() == VISIBLE) { mSecurityMessageDisplay.setMessage(msg); } mSimImageView.setImageTintList(ColorStateList.valueOf(color)); diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java index e219e24a8944..af4e61b3f6bc 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java @@ -89,6 +89,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe private final HashMap<View, PendingIntent> mClickActions; private final ActivityStarter mActivityStarter; private final ConfigurationController mConfigurationController; + private final LayoutTransition mLayoutTransition; private Uri mKeyguardSliceUri; @VisibleForTesting TextView mTitle; @@ -126,16 +127,16 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe mActivityStarter = activityStarter; mConfigurationController = configurationController; - LayoutTransition transition = new LayoutTransition(); - transition.setStagger(LayoutTransition.CHANGE_APPEARING, DEFAULT_ANIM_DURATION / 2); - transition.setDuration(LayoutTransition.APPEARING, DEFAULT_ANIM_DURATION); - transition.setDuration(LayoutTransition.DISAPPEARING, DEFAULT_ANIM_DURATION / 2); - transition.disableTransitionType(LayoutTransition.CHANGE_APPEARING); - transition.disableTransitionType(LayoutTransition.CHANGE_DISAPPEARING); - transition.setInterpolator(LayoutTransition.APPEARING, Interpolators.FAST_OUT_SLOW_IN); - transition.setInterpolator(LayoutTransition.DISAPPEARING, Interpolators.ALPHA_OUT); - transition.setAnimateParentHierarchy(false); - setLayoutTransition(transition); + mLayoutTransition = new LayoutTransition(); + mLayoutTransition.setStagger(LayoutTransition.CHANGE_APPEARING, DEFAULT_ANIM_DURATION / 2); + mLayoutTransition.setDuration(LayoutTransition.APPEARING, DEFAULT_ANIM_DURATION); + mLayoutTransition.setDuration(LayoutTransition.DISAPPEARING, DEFAULT_ANIM_DURATION / 2); + mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_APPEARING); + mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_DISAPPEARING); + mLayoutTransition.setInterpolator(LayoutTransition.APPEARING, + Interpolators.FAST_OUT_SLOW_IN); + mLayoutTransition.setInterpolator(LayoutTransition.DISAPPEARING, Interpolators.ALPHA_OUT); + mLayoutTransition.setAnimateParentHierarchy(false); } @Override @@ -174,6 +175,12 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe mConfigurationController.removeCallback(this); } + @Override + public void onVisibilityAggregated(boolean isVisible) { + super.onVisibilityAggregated(isVisible); + setLayoutTransition(isVisible ? mLayoutTransition : null); + } + /** * Returns whether the current visible slice has a title/header. */ @@ -419,6 +426,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe * their desired positions. */ private final Animation.AnimationListener mKeepAwakeListener; + private LayoutTransition mLayoutTransition; private float mDarkAmount; public Row(Context context) { @@ -440,33 +448,41 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe @Override protected void onFinishInflate() { - LayoutTransition transition = new LayoutTransition(); - transition.setDuration(DEFAULT_ANIM_DURATION); + mLayoutTransition = new LayoutTransition(); + mLayoutTransition.setDuration(DEFAULT_ANIM_DURATION); PropertyValuesHolder left = PropertyValuesHolder.ofInt("left", 0, 1); PropertyValuesHolder right = PropertyValuesHolder.ofInt("right", 0, 1); ObjectAnimator changeAnimator = ObjectAnimator.ofPropertyValuesHolder((Object) null, left, right); - transition.setAnimator(LayoutTransition.CHANGE_APPEARING, changeAnimator); - transition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, changeAnimator); - transition.setInterpolator(LayoutTransition.CHANGE_APPEARING, + mLayoutTransition.setAnimator(LayoutTransition.CHANGE_APPEARING, changeAnimator); + mLayoutTransition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, changeAnimator); + mLayoutTransition.setInterpolator(LayoutTransition.CHANGE_APPEARING, Interpolators.ACCELERATE_DECELERATE); - transition.setInterpolator(LayoutTransition.CHANGE_DISAPPEARING, + mLayoutTransition.setInterpolator(LayoutTransition.CHANGE_DISAPPEARING, Interpolators.ACCELERATE_DECELERATE); - transition.setStartDelay(LayoutTransition.CHANGE_APPEARING, DEFAULT_ANIM_DURATION); - transition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, DEFAULT_ANIM_DURATION); + mLayoutTransition.setStartDelay(LayoutTransition.CHANGE_APPEARING, + DEFAULT_ANIM_DURATION); + mLayoutTransition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, + DEFAULT_ANIM_DURATION); ObjectAnimator appearAnimator = ObjectAnimator.ofFloat(null, "alpha", 0f, 1f); - transition.setAnimator(LayoutTransition.APPEARING, appearAnimator); - transition.setInterpolator(LayoutTransition.APPEARING, Interpolators.ALPHA_IN); + mLayoutTransition.setAnimator(LayoutTransition.APPEARING, appearAnimator); + mLayoutTransition.setInterpolator(LayoutTransition.APPEARING, Interpolators.ALPHA_IN); ObjectAnimator disappearAnimator = ObjectAnimator.ofFloat(null, "alpha", 1f, 0f); - transition.setInterpolator(LayoutTransition.DISAPPEARING, Interpolators.ALPHA_OUT); - transition.setDuration(LayoutTransition.DISAPPEARING, DEFAULT_ANIM_DURATION / 4); - transition.setAnimator(LayoutTransition.DISAPPEARING, disappearAnimator); + mLayoutTransition.setInterpolator(LayoutTransition.DISAPPEARING, + Interpolators.ALPHA_OUT); + mLayoutTransition.setDuration(LayoutTransition.DISAPPEARING, DEFAULT_ANIM_DURATION / 4); + mLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, disappearAnimator); - transition.setAnimateParentHierarchy(false); - setLayoutTransition(transition); + mLayoutTransition.setAnimateParentHierarchy(false); + } + + @Override + public void onVisibilityAggregated(boolean isVisible) { + super.onVisibilityAggregated(isVisible); + setLayoutTransition(isVisible ? mLayoutTransition : null); } @Override diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index fd618b05f348..109f270063d6 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -264,11 +264,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { */ private static final int BIOMETRIC_CONTINUE_DELAY_MS = 500; - // If FP daemon dies, keyguard should retry after a short delay + // If the HAL dies or is unable to authenticate, keyguard should retry after a short delay private int mHardwareFingerprintUnavailableRetryCount = 0; private int mHardwareFaceUnavailableRetryCount = 0; - private static final int HW_UNAVAILABLE_TIMEOUT = 3000; // ms - private static final int HW_UNAVAILABLE_RETRY_MAX = 3; + private static final int HAL_ERROR_RETRY_TIMEOUT = 500; // ms + private static final int HAL_ERROR_RETRY_MAX = 10; private final Handler mHandler = new Handler(Looper.getMainLooper()) { @Override @@ -671,10 +671,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { } if (msgId == FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE) { - if (mHardwareFingerprintUnavailableRetryCount < HW_UNAVAILABLE_RETRY_MAX) { + if (mHardwareFingerprintUnavailableRetryCount < HAL_ERROR_RETRY_MAX) { mHardwareFingerprintUnavailableRetryCount++; mHandler.removeCallbacks(mRetryFingerprintAuthentication); - mHandler.postDelayed(mRetryFingerprintAuthentication, HW_UNAVAILABLE_TIMEOUT); + mHandler.postDelayed(mRetryFingerprintAuthentication, HAL_ERROR_RETRY_TIMEOUT); } } @@ -830,11 +830,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { setFaceRunningState(BIOMETRIC_STATE_STOPPED); } - if (msgId == FaceManager.FACE_ERROR_HW_UNAVAILABLE) { - if (mHardwareFaceUnavailableRetryCount < HW_UNAVAILABLE_RETRY_MAX) { + if (msgId == FaceManager.FACE_ERROR_HW_UNAVAILABLE + || msgId == FaceManager.FACE_ERROR_UNABLE_TO_PROCESS) { + if (mHardwareFaceUnavailableRetryCount < HAL_ERROR_RETRY_MAX) { mHardwareFaceUnavailableRetryCount++; mHandler.removeCallbacks(mRetryFaceAuthentication); - mHandler.postDelayed(mRetryFaceAuthentication, HW_UNAVAILABLE_TIMEOUT); + mHandler.postDelayed(mRetryFaceAuthentication, HAL_ERROR_RETRY_TIMEOUT); } } @@ -1783,13 +1784,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { && mFpm.getEnrolledFingerprints(userId).size() > 0; } + private boolean isUnlockWithFacePossible(int userId) { + return isFaceAuthEnabledForUser(userId) && !isFaceDisabled(userId); + } + /** * If face hardware is available, user has enrolled and enabled auth via setting. - * Not considering encryption or lock down state. */ - public boolean isUnlockWithFacePossible(int userId) { + public boolean isFaceAuthEnabledForUser(int userId) { return mFaceManager != null && mFaceManager.isHardwareDetected() - && !isFaceDisabled(userId) && mFaceManager.hasEnrolledTemplates(userId) && mFaceSettingEnabledForUser.get(userId); } diff --git a/packages/SystemUI/src/com/android/systemui/CornerHandleView.java b/packages/SystemUI/src/com/android/systemui/CornerHandleView.java index 54a36355decb..a94952c5bc19 100644 --- a/packages/SystemUI/src/com/android/systemui/CornerHandleView.java +++ b/packages/SystemUI/src/com/android/systemui/CornerHandleView.java @@ -107,7 +107,9 @@ public class CornerHandleView extends View { mPaint.setColor((int) ArgbEvaluator.getInstance().evaluate(darkIntensity, mLightColor, mDarkColor)); - invalidate(); + if (getVisibility() == VISIBLE) { + invalidate(); + } } @Override diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index c9d4957494e4..bd91333100bd 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -47,7 +47,7 @@ public class ImageWallpaper extends WallpaperService { // This is to avoid destroying then recreating render context in a very short time. private static final int DELAY_FINISH_RENDERING = 1000; private static final int INTERVAL_WAIT_FOR_RENDERING = 100; - private static final int PATIENCE_WAIT_FOR_RENDERING = 5; + private static final int PATIENCE_WAIT_FOR_RENDERING = 10; private HandlerThread mWorker; @Override @@ -124,10 +124,10 @@ public class ImageWallpaper extends WallpaperService { @Override public void onAmbientModeChanged(boolean inAmbientMode, long animationDuration) { - long duration = mNeedTransition || animationDuration != 0 ? animationDuration : 0; + if (!mNeedTransition) return; mWorker.getThreadHandler().post( - () -> mRenderer.updateAmbientMode(inAmbientMode, duration)); - if (inAmbientMode && duration == 0) { + () -> mRenderer.updateAmbientMode(inAmbientMode, animationDuration)); + if (inAmbientMode && animationDuration == 0) { // This means that we are transiting from home to aod, to avoid // race condition between window visibility and transition, // we don't return until the transition is finished. See b/136643341. diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistHandleBehaviorController.java b/packages/SystemUI/src/com/android/systemui/assist/AssistHandleBehaviorController.java index 002d4f34be11..6da3818c5d05 100644 --- a/packages/SystemUI/src/com/android/systemui/assist/AssistHandleBehaviorController.java +++ b/packages/SystemUI/src/com/android/systemui/assist/AssistHandleBehaviorController.java @@ -74,6 +74,7 @@ public final class AssistHandleBehaviorController implements AssistHandleCallbac private boolean mHandlesShowing = false; private long mHandlesLastHiddenAt; + private long mShowAndGoEndsAt; /** * This should always be initialized as {@link AssistHandleBehavior#OFF} to ensure proper * behavior lifecycle. @@ -144,7 +145,9 @@ public final class AssistHandleBehaviorController implements AssistHandleCallbac private void showAndGoInternal() { maybeShowHandles(/* ignoreThreshold = */ false); - mHandler.postDelayed(mHideHandles, getShowAndGoDuration()); + long showAndGoDuration = getShowAndGoDuration(); + mShowAndGoEndsAt = SystemClock.elapsedRealtime() + showAndGoDuration; + mHandler.postDelayed(mHideHandles, showAndGoDuration); } @Override // AssistHandleCallbacks @@ -162,6 +165,10 @@ public final class AssistHandleBehaviorController implements AssistHandleCallbac mHandler.post(() -> maybeShowHandles(/* ignoreThreshold = */ true)); } + public long getShowAndGoRemainingTimeMs() { + return Long.max(mShowAndGoEndsAt - SystemClock.elapsedRealtime(), 0); + } + boolean areHandlesShowing() { return mHandlesShowing; } @@ -271,6 +278,7 @@ public final class AssistHandleBehaviorController implements AssistHandleCallbac private void clearPendingCommands() { mHandler.removeCallbacks(mHideHandles); mHandler.removeCallbacks(mShowAndGo); + mShowAndGoEndsAt = 0; } @VisibleForTesting diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java index 97b6e7c58440..4a4feada3c65 100644 --- a/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java +++ b/packages/SystemUI/src/com/android/systemui/assist/AssistManager.java @@ -82,7 +82,7 @@ public class AssistManager implements ConfigurationChangedReceiver { void processBundle(Bundle hints); /** - * Hides the UI. + * Hides any SysUI for the assistant, but _does not_ close the assistant itself. */ void hide(); } @@ -440,6 +440,10 @@ public class AssistManager implements ConfigurationChangedReceiver { mAssistUtils.onLockscreenShown(); } + public long getAssistHandleShowAndGoRemainingDurationMs() { + return mHandleController.getShowAndGoRemainingTimeMs(); + } + /** Returns the logging flags for the given Assistant invocation type. */ public int toLoggingSubType(int invocationType) { return toLoggingSubType(invocationType, mPhoneStateMonitor.getPhoneState()); diff --git a/packages/SystemUI/src/com/android/systemui/assist/ui/DefaultUiController.java b/packages/SystemUI/src/com/android/systemui/assist/ui/DefaultUiController.java index 662de3a5b5f5..0c4f05123c79 100644 --- a/packages/SystemUI/src/com/android/systemui/assist/ui/DefaultUiController.java +++ b/packages/SystemUI/src/com/android/systemui/assist/ui/DefaultUiController.java @@ -118,7 +118,6 @@ public class DefaultUiController implements AssistManager.UiController { @Override // AssistManager.UiController public void hide() { - Dependency.get(AssistManager.class).hideAssist(); detach(); if (mInvocationAnimator.isRunning()) { mInvocationAnimator.cancel(); diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java index a5857df8ba5a..ce67577ea483 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogView.java @@ -111,6 +111,9 @@ public abstract class BiometricDialogView extends LinearLayout { protected boolean mRequireConfirmation; private int mUserId; // used to determine if we should show work background + private boolean mCompletedAnimatingIn; + private boolean mPendingDismissDialog; + protected abstract int getHintStringResourceId(); protected abstract int getAuthenticatedAccessibilityResourceId(); protected abstract int getIconDescriptionResourceId(); @@ -332,6 +335,7 @@ public abstract class BiometricDialogView extends LinearLayout { mDialog.setAlpha(1.0f); mDialog.setTranslationY(0); mLayout.setAlpha(1.0f); + mCompletedAnimatingIn = true; } else { // Dim the background and slide the dialog up mDialog.setTranslationY(mAnimationTranslationOffset); @@ -352,6 +356,12 @@ public abstract class BiometricDialogView extends LinearLayout { } public void startDismiss() { + if (!mCompletedAnimatingIn) { + Log.w(TAG, "startDismiss(): waiting for onDialogAnimatedIn"); + mPendingDismissDialog = true; + return; + } + mAnimatingAway = true; // This is where final cleanup should occur. @@ -499,6 +509,13 @@ public abstract class BiometricDialogView extends LinearLayout { } public void onDialogAnimatedIn() { + mCompletedAnimatingIn = true; + + if (mPendingDismissDialog) { + Log.d(TAG, "onDialogAnimatedIn(): mPendingDismissDialog=true, dismissing now"); + startDismiss(); + mPendingDismissDialog = false; + } } public void restoreState(Bundle bundle) { diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java b/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java index 729242e3144f..ae6cb5ce23d3 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/FaceDialogView.java @@ -460,6 +460,7 @@ public class FaceDialogView extends BiometricDialogView { @Override public void onDialogAnimatedIn() { + super.onDialogAnimatedIn(); mDialogAnimatedIn = true; mIconController.startPulsing(); } diff --git a/packages/SystemUI/src/com/android/systemui/classifier/brightline/BrightLineFalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/brightline/BrightLineFalsingManager.java index cee01a4d3048..ce82bbfb1512 100644 --- a/packages/SystemUI/src/com/android/systemui/classifier/brightline/BrightLineFalsingManager.java +++ b/packages/SystemUI/src/com/android/systemui/classifier/brightline/BrightLineFalsingManager.java @@ -50,6 +50,8 @@ public class BrightLineFalsingManager implements FalsingManager { private boolean mSessionStarted; private MetricsLogger mMetricsLogger; private int mIsFalseTouchCalls; + private boolean mShowingAod; + private boolean mScreenOn; private final ExecutorService mBackgroundExecutor = Executors.newSingleThreadExecutor(); @@ -105,10 +107,12 @@ public class BrightLineFalsingManager implements FalsingManager { } private void sessionStart() { - logDebug("Starting Session"); - mSessionStarted = true; - registerSensors(); - mClassifiers.forEach(FalsingClassifier::onSessionStarted); + if (!mSessionStarted && !mShowingAod && mScreenOn) { + logDebug("Starting Session"); + mSessionStarted = true; + registerSensors(); + mClassifiers.forEach(FalsingClassifier::onSessionStarted); + } } private void sessionEnd() { @@ -172,6 +176,7 @@ public class BrightLineFalsingManager implements FalsingManager { mMetricsLogger.histogram(FALSING_SUCCESS, mIsFalseTouchCalls); mIsFalseTouchCalls = 0; } + sessionEnd(); } @Override @@ -180,6 +185,7 @@ public class BrightLineFalsingManager implements FalsingManager { @Override public void setShowingAod(boolean showingAod) { + mShowingAod = showingAod; if (showingAod) { sessionEnd(); } else { @@ -264,7 +270,7 @@ public class BrightLineFalsingManager implements FalsingManager { @Override public void onScreenOnFromTouch() { - sessionStart(); + onScreenTurningOn(); } @Override @@ -286,11 +292,13 @@ public class BrightLineFalsingManager implements FalsingManager { @Override public void onScreenTurningOn() { + mScreenOn = true; sessionStart(); } @Override public void onScreenOff() { + mScreenOn = false; sessionEnd(); } diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java b/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java index ae6dac59b2f5..07dd2cd77043 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeHost.java @@ -77,8 +77,10 @@ public interface DozeHost { interface Callback { /** * Called when a high priority notification is added. + * @param onPulseSuppressedListener A listener that is invoked if the pulse is being + * supressed. */ - default void onNotificationAlerted() {} + default void onNotificationAlerted(Runnable onPulseSuppressedListener) {} /** * Called when battery state or power save mode changes. diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java index 9bca3c7382ca..c09e28426072 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java @@ -261,6 +261,12 @@ public class DozeLog { + state + " blocked=" + blocked); } + public static void tracePulseDropped(Context context, String why) { + if (!ENABLED) return; + init(context); + log("pulseDropped why=" + why); + } + public static void tracePulseTouchDisabledByProx(Context context, boolean disabled) { if (!ENABLED) return; init(context); diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java index 8ef01e8d608e..310f04abc36c 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java @@ -106,22 +106,33 @@ public class DozeTriggers implements DozeMachine.Part { mDockManager = dockManager; } - private void onNotification() { + private void onNotification(Runnable onPulseSuppressedListener) { if (DozeMachine.DEBUG) { Log.d(TAG, "requestNotificationPulse"); } if (!sWakeDisplaySensorState) { Log.d(TAG, "Wake display false. Pulse denied."); + runIfNotNull(onPulseSuppressedListener); + DozeLog.tracePulseDropped(mContext, "wakeDisplaySensor"); return; } mNotificationPulseTime = SystemClock.elapsedRealtime(); if (!mConfig.pulseOnNotificationEnabled(UserHandle.USER_CURRENT)) { + runIfNotNull(onPulseSuppressedListener); + DozeLog.tracePulseDropped(mContext, "pulseOnNotificationsDisabled"); return; } - requestPulse(DozeLog.PULSE_REASON_NOTIFICATION, false /* performedProxCheck */); + requestPulse(DozeLog.PULSE_REASON_NOTIFICATION, false /* performedProxCheck */, + onPulseSuppressedListener); DozeLog.traceNotificationPulse(mContext); } + private static void runIfNotNull(Runnable runnable) { + if (runnable != null) { + runnable.run(); + } + } + private void proximityCheckThenCall(IntConsumer callback, boolean alreadyPerformedProxCheck, int reason) { @@ -158,10 +169,11 @@ public class DozeTriggers implements DozeMachine.Part { if (isWakeDisplay) { onWakeScreen(wakeEvent, mMachine.isExecutingTransition() ? null : mMachine.getState()); } else if (isLongPress) { - requestPulse(pulseReason, sensorPerformedProxCheck); + requestPulse(pulseReason, sensorPerformedProxCheck, null /* onPulseSupressedListener */); } else if (isWakeLockScreen) { if (wakeEvent) { - requestPulse(pulseReason, sensorPerformedProxCheck); + requestPulse(pulseReason, sensorPerformedProxCheck, + null /* onPulseSupressedListener */); } } else { proximityCheckThenCall((result) -> { @@ -340,7 +352,8 @@ public class DozeTriggers implements DozeMachine.Part { } } - private void requestPulse(final int reason, boolean performedProxCheck) { + private void requestPulse(final int reason, boolean performedProxCheck, + Runnable onPulseSuppressedListener) { Assert.isMainThread(); mDozeHost.extendPulse(reason); @@ -357,6 +370,7 @@ public class DozeTriggers implements DozeMachine.Part { DozeLog.tracePulseDropped(mContext, mPulsePending, mMachine.getState(), mDozeHost.isPulsingBlocked()); } + runIfNotNull(onPulseSuppressedListener); return; } @@ -364,7 +378,9 @@ public class DozeTriggers implements DozeMachine.Part { proximityCheckThenCall((result) -> { if (result == ProximityCheck.RESULT_NEAR) { // in pocket, abort pulse + DozeLog.tracePulseDropped(mContext, "inPocket"); mPulsePending = false; + runIfNotNull(onPulseSuppressedListener); } else { // not in pocket, continue pulsing continuePulseRequest(reason); @@ -482,7 +498,8 @@ public class DozeTriggers implements DozeMachine.Part { public void onReceive(Context context, Intent intent) { if (PULSE_ACTION.equals(intent.getAction())) { if (DozeMachine.DEBUG) Log.d(TAG, "Received pulse intent"); - requestPulse(DozeLog.PULSE_REASON_INTENT, false /* performedProxCheck */); + requestPulse(DozeLog.PULSE_REASON_INTENT, false, /* performedProxCheck */ + null /* onPulseSupressedListener */); } if (UiModeManager.ACTION_ENTER_CAR_MODE.equals(intent.getAction())) { mMachine.requestState(DozeMachine.State.FINISH); @@ -532,8 +549,8 @@ public class DozeTriggers implements DozeMachine.Part { private DozeHost.Callback mHostCallback = new DozeHost.Callback() { @Override - public void onNotificationAlerted() { - onNotification(); + public void onNotificationAlerted(Runnable onPulseSuppressedListener) { + onNotification(onPulseSuppressedListener); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java index dc977547b024..0e4c15576957 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java @@ -95,6 +95,7 @@ import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.GlobalActions.GlobalActionsManager; import com.android.systemui.plugins.GlobalActionsPanelPlugin; import com.android.systemui.statusbar.phone.ScrimController; +import com.android.systemui.statusbar.phone.StatusBarWindowController; import com.android.systemui.statusbar.phone.UnlockMethodCache; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.util.EmergencyDialerConstants; @@ -1515,6 +1516,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, private boolean mShowing; private float mScrimAlpha; private ResetOrientationData mResetOrientationData; + private boolean mHadTopUi; + private final StatusBarWindowController mStatusBarWindowController; ActionsDialog(Context context, MyAdapter adapter, GlobalActionsPanelPlugin.PanelViewController plugin) { @@ -1523,6 +1526,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, mAdapter = adapter; mColorExtractor = Dependency.get(SysuiColorExtractor.class); mStatusBarService = Dependency.get(IStatusBarService.class); + mStatusBarWindowController = Dependency.get(StatusBarWindowController.class); // Window initialization Window window = getWindow(); @@ -1698,6 +1702,8 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, public void show() { super.show(); mShowing = true; + mHadTopUi = mStatusBarWindowController.getForceHasTopUi(); + mStatusBarWindowController.setForceHasTopUi(true); mBackgroundDrawable.setAlpha(0); mGlobalActionsLayout.setTranslationX(mGlobalActionsLayout.getAnimationOffsetX()); mGlobalActionsLayout.setTranslationY(mGlobalActionsLayout.getAnimationOffsetY()); @@ -1730,7 +1736,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, .translationX(mGlobalActionsLayout.getAnimationOffsetX()) .translationY(mGlobalActionsLayout.getAnimationOffsetY()) .setDuration(300) - .withEndAction(super::dismiss) + .withEndAction(this::completeDismiss) .setInterpolator(new LogAccelerateInterpolator()) .setUpdateListener(animation -> { int alpha = (int) ((1f - (Float) animation.getAnimatedValue()) @@ -1743,10 +1749,15 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener, } void dismissImmediately() { - super.dismiss(); mShowing = false; dismissPanel(); resetOrientation(); + completeDismiss(); + } + + private void completeDismiss() { + mStatusBarWindowController.setForceHasTopUi(mHadTopUi); + super.dismiss(); } private void dismissPanel() { diff --git a/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageRevealHelper.java b/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageRevealHelper.java index 45e97b38d87e..b154e66a846e 100644 --- a/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageRevealHelper.java +++ b/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageRevealHelper.java @@ -65,7 +65,7 @@ class ImageRevealHelper { @Override public void onAnimationStart(Animator animation) { if (mRevealListener != null) { - mRevealListener.onRevealStart(); + mRevealListener.onRevealStart(true /* animate */); } } }); @@ -73,7 +73,7 @@ class ImageRevealHelper { private void animate() { mAnimator.cancel(); - mAnimator.setFloatValues(mReveal, !mAwake ? MIN_REVEAL : MAX_REVEAL); + mAnimator.setFloatValues(mReveal, mAwake ? MAX_REVEAL : MIN_REVEAL); mAnimator.start(); } @@ -84,12 +84,11 @@ class ImageRevealHelper { void updateAwake(boolean awake, long duration) { mAwake = awake; mAnimator.setDuration(duration); - if (!mAwake && duration == 0) { - // We are transiting from home to aod, - // since main thread is waiting for rendering finished, we only need draw - // the last state directly, which is a black screen. - mReveal = MIN_REVEAL; - mRevealListener.onRevealStart(); + if (duration == 0) { + // We are transiting from home to aod or aod to home directly, + // we don't need to do transition in these cases. + mReveal = mAwake ? MAX_REVEAL : MIN_REVEAL; + mRevealListener.onRevealStart(false /* animate */); mRevealListener.onRevealStateChanged(); mRevealListener.onRevealEnd(); } else { @@ -110,7 +109,7 @@ class ImageRevealHelper { /** * Called back while reveal starts. */ - void onRevealStart(); + void onRevealStart(boolean animate); /** * Called back while reveal ends. diff --git a/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageWallpaperRenderer.java b/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageWallpaperRenderer.java index 93d8dd6146a6..7b22a49fc88a 100644 --- a/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageWallpaperRenderer.java +++ b/packages/SystemUI/src/com/android/systemui/glwallpaper/ImageWallpaperRenderer.java @@ -24,6 +24,7 @@ import static android.opengl.GLES20.glViewport; import android.app.WallpaperManager; import android.content.Context; +import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Rect; import android.util.Log; @@ -70,7 +71,14 @@ public class ImageWallpaperRenderer implements GLWallpaperRenderer, DisplayInfo displayInfo = new DisplayInfo(); WindowManager wm = context.getSystemService(WindowManager.class); wm.getDefaultDisplay().getDisplayInfo(displayInfo); - mScissor = new Rect(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight); + + // We only do transition in portrait currently, b/137962047. + int orientation = context.getResources().getConfiguration().orientation; + if (orientation == Configuration.ORIENTATION_PORTRAIT) { + mScissor = new Rect(0, 0, displayInfo.logicalWidth, displayInfo.logicalHeight); + } else { + mScissor = new Rect(0, 0, displayInfo.logicalHeight, displayInfo.logicalWidth); + } mProxy = proxy; mProgram = new ImageGLProgram(context); @@ -179,20 +187,24 @@ public class ImageWallpaperRenderer implements GLWallpaperRenderer, } @Override - public void onRevealStart() { - mScissorMode = true; - // Use current display area of texture. - mWallpaper.adjustTextureCoordinates(mSurfaceSize, mScissor, mXOffset, mYOffset); + public void onRevealStart(boolean animate) { + if (animate) { + mScissorMode = true; + // Use current display area of texture. + mWallpaper.adjustTextureCoordinates(mSurfaceSize, mScissor, mXOffset, mYOffset); + } mProxy.preRender(); } @Override public void onRevealEnd() { - mScissorMode = false; - // reset texture coordinates to use full texture. - mWallpaper.adjustTextureCoordinates(null, null, 0, 0); - // We need draw full texture back before finishing render. - mProxy.requestRender(); + if (mScissorMode) { + mScissorMode = false; + // reset texture coordinates to use full texture. + mWallpaper.adjustTextureCoordinates(null, null, 0, 0); + // We need draw full texture back before finishing render. + mProxy.requestRender(); + } mProxy.postRender(); } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardSliceProvider.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardSliceProvider.java index 5136682bb292..48f32cf04fb2 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardSliceProvider.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardSliceProvider.java @@ -52,6 +52,7 @@ import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.systemui.R; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationMediaManager; +import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.policy.NextAlarmController; @@ -62,7 +63,6 @@ import com.android.systemui.util.wakelock.SettableWakeLock; import com.android.systemui.util.wakelock.WakeLock; import java.util.Date; -import java.util.HashSet; import java.util.Locale; import java.util.TimeZone; import java.util.concurrent.TimeUnit; @@ -128,6 +128,7 @@ public class KeyguardSliceProvider extends SliceProvider implements private CharSequence mMediaTitle; private CharSequence mMediaArtist; protected boolean mDozing; + private int mStatusBarState; private boolean mMediaIsVisible; /** @@ -231,7 +232,11 @@ public class KeyguardSliceProvider extends SliceProvider implements protected boolean needsMediaLocked() { boolean keepWhenAwake = mKeyguardBypassController != null && mKeyguardBypassController.getBypassEnabled() && mDozeParameters.getAlwaysOn(); - return !TextUtils.isEmpty(mMediaTitle) && mMediaIsVisible && (mDozing || keepWhenAwake); + // Show header if music is playing and the status bar is in the shade state. This way, an + // animation isn't necessary when pressing power and transitioning to AOD. + boolean keepWhenShade = mStatusBarState == StatusBarState.SHADE && mMediaIsVisible; + return !TextUtils.isEmpty(mMediaTitle) && mMediaIsVisible && (mDozing || keepWhenAwake + || keepWhenShade); } protected void addMediaLocked(ListBuilder listBuilder) { @@ -458,7 +463,7 @@ public class KeyguardSliceProvider extends SliceProvider implements synchronized (this) { boolean nextVisible = NotificationMediaManager.isPlayingState(state); mHandler.removeCallbacksAndMessages(mMediaToken); - if (mMediaIsVisible && !nextVisible) { + if (mMediaIsVisible && !nextVisible && mStatusBarState != StatusBarState.SHADE) { // We need to delay this event for a few millis when stopping to avoid jank in the // animation. The media app might not send its update when buffering, and the slice // would end up without a header for 0.5 second. @@ -515,5 +520,14 @@ public class KeyguardSliceProvider extends SliceProvider implements @Override public void onStateChanged(int newState) { + final boolean notify; + synchronized (this) { + boolean needsMedia = needsMediaLocked(); + mStatusBarState = newState; + notify = needsMedia != needsMediaLocked(); + } + if (notify) { + notifyChange(); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 57bf53676a4a..e9f99acd8d46 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -90,6 +90,7 @@ import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.NotificationPanelView; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; +import com.android.systemui.statusbar.phone.StatusBarWindowController; import com.android.systemui.util.InjectionInflationController; import java.io.FileDescriptor; @@ -204,6 +205,8 @@ public class KeyguardViewMediator extends SystemUI { private AlarmManager mAlarmManager; private AudioManager mAudioManager; private StatusBarManager mStatusBarManager; + private final StatusBarWindowController mStatusBarWindowController = + Dependency.get(StatusBarWindowController.class); private final UiOffloadThread mUiOffloadThread = Dependency.get(UiOffloadThread.class); private boolean mSystemReady; @@ -1779,6 +1782,7 @@ public class KeyguardViewMediator extends SystemUI { adjustStatusBarLocked(); userActivity(); mUpdateMonitor.setKeyguardGoingAway(false /* away */); + mStatusBarWindowController.setKeyguardGoingAway(false /* goingAway */); mShowKeyguardWakeLock.release(); } mKeyguardDisplayManager.show(); @@ -1811,6 +1815,7 @@ public class KeyguardViewMediator extends SystemUI { } mUpdateMonitor.setKeyguardGoingAway(true /* goingAway */); + mStatusBarWindowController.setKeyguardGoingAway(true /* goingAway */); // Don't actually hide the Keyguard at the moment, wait for window // manager until it tells us it's safe to do so with diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java index fb8b6c76a35f..75dc39722bcf 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java @@ -64,6 +64,8 @@ public class PowerUI extends SystemUI { private static final int CHARGE_CYCLE_PERCENT_RESET = 45; private static final long SIX_HOURS_MILLIS = Duration.ofHours(6).toMillis(); public static final int NO_ESTIMATE_AVAILABLE = -1; + private static final String BOOT_COUNT_KEY = "boot_count"; + private static final String PREFS = "powerui_prefs"; private final Handler mHandler = new Handler(); @VisibleForTesting @@ -118,7 +120,7 @@ public class PowerUI extends SystemUI { // Check to see if we need to let the user know that the phone previously shut down due // to the temperature being too high. - showThermalShutdownDialog(); + showWarnOnThermalShutdown(); // Register an observer to configure mEnableSkinTemperatureWarning and perform the // registration of skin thermal event listener upon Settings change. @@ -542,10 +544,23 @@ public class PowerUI extends SystemUI { } } - private void showThermalShutdownDialog() { - if (mPowerManager.getLastShutdownReason() - == PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN) { - mWarnings.showThermalShutdownWarning(); + private void showWarnOnThermalShutdown() { + int bootCount = -1; + int lastReboot = mContext.getSharedPreferences(PREFS, 0).getInt(BOOT_COUNT_KEY, -1); + try { + bootCount = Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.BOOT_COUNT); + } catch (Settings.SettingNotFoundException e) { + Slog.e(TAG, "Failed to read system boot count from Settings.Global.BOOT_COUNT"); + } + // Only show the thermal shutdown warning when there is a thermal reboot. + if (bootCount > lastReboot) { + mContext.getSharedPreferences(PREFS, 0).edit().putInt(BOOT_COUNT_KEY, + bootCount).apply(); + if (mPowerManager.getLastShutdownReason() + == PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN) { + mWarnings.showThermalShutdownWarning(); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java index 19edc94a3871..16f0b15be24c 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java @@ -546,7 +546,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis navBarFragment.updateSystemUiStateFlags(-1); } if (navBarView != null) { - navBarView.updateSystemUiStateFlags(); + navBarView.updatePanelSystemUiStateFlags(); + navBarView.updateDisabledSystemUiStateFlags(); } if (mStatusBarWinController != null) { mStatusBarWinController.notifyStateChangedCallbacks(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java index 514a2ae7a74e..8385c8e00392 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/DragDownHelper.java @@ -92,7 +92,7 @@ public class DragDownHelper implements Gefingerpoken { mInitialTouchY = y; mInitialTouchX = x; mDragDownCallback.onTouchSlopExceeded(); - return true; + return mStartingChild != null || mDragDownCallback.isDragDownAnywhereEnabled(); } break; } @@ -162,7 +162,11 @@ public class DragDownHelper implements Gefingerpoken { if (mStartingChild == null) { mStartingChild = findView(x, y); if (mStartingChild != null) { - mCallback.setUserLockedChild(mStartingChild, true); + if (mDragDownCallback.isDragDownEnabledForView(mStartingChild)) { + mCallback.setUserLockedChild(mStartingChild, true); + } else { + mStartingChild = null; + } } } } @@ -237,6 +241,10 @@ public class DragDownHelper implements Gefingerpoken { return mDraggingDown; } + public boolean isDragDownEnabled() { + return mDragDownCallback.isDragDownEnabledForView(null); + } + public interface DragDownCallback { /** @@ -253,5 +261,16 @@ public class DragDownHelper implements Gefingerpoken { void onTouchSlopExceeded(); void setEmptyDragAmount(float amount); boolean isFalsingCheckNeeded(); + + /** + * Is dragging down enabled on a given view + * @param view The view to check or {@code null} to check if it's enabled at all + */ + boolean isDragDownEnabledForView(ExpandableView view); + + /** + * @return if drag down is enabled anywhere, not just on selected views. + */ + boolean isDragDownAnywhereEnabled(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java index 0fe5f8a6af5a..4cc5b2144adc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java @@ -15,7 +15,6 @@ package com.android.systemui.statusbar; import android.content.pm.UserInfo; -import android.service.notification.StatusBarNotification; import android.util.SparseArray; import com.android.systemui.statusbar.notification.collection.NotificationEntry; @@ -58,7 +57,7 @@ public interface NotificationLockscreenUserManager { boolean shouldHideNotifications(int userId); boolean shouldHideNotifications(String key); - boolean shouldShowOnKeyguard(StatusBarNotification sbn); + boolean shouldShowOnKeyguard(NotificationEntry entry); boolean isAnyProfilePublicMode(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java index 4ea1ed5b9451..e08a5ae07bd8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java @@ -33,7 +33,6 @@ import android.os.ServiceManager; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; -import android.service.notification.StatusBarNotification; import android.util.Log; import android.util.SparseArray; import android.util.SparseBooleanArray; @@ -302,7 +301,7 @@ public class NotificationLockscreenUserManagerImpl implements Notification.VISIBILITY_SECRET; } - public boolean shouldShowOnKeyguard(StatusBarNotification sbn) { + public boolean shouldShowOnKeyguard(NotificationEntry entry) { if (getEntryManager() == null) { Log.wtf(TAG, "mEntryManager was null!", new Throwable()); return false; @@ -310,10 +309,10 @@ public class NotificationLockscreenUserManagerImpl implements boolean exceedsPriorityThreshold; if (NotificationUtils.useNewInterruptionModel(mContext) && hideSilentNotificationsOnLockscreen()) { - exceedsPriorityThreshold = getEntryManager().getNotificationData().isHighPriority(sbn); + exceedsPriorityThreshold = entry.isTopBucket(); } else { exceedsPriorityThreshold = - !getEntryManager().getNotificationData().isAmbient(sbn.getKey()); + !getEntryManager().getNotificationData().isAmbient(entry.key); } return mShowLockscreenNotifications && exceedsPriorityThreshold; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java index f001561754aa..00a12a9e4409 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationMediaManager.java @@ -17,6 +17,10 @@ package com.android.systemui.statusbar; import static com.android.systemui.Dependency.MAIN_HANDLER; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; +import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_UNLOCK_FADING; +import static com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK; +import static com.android.systemui.statusbar.phone.BiometricUnlockController + .MODE_WAKE_AND_UNLOCK_PULSING; import static com.android.systemui.statusbar.phone.StatusBar.DEBUG_MEDIA_FAKE_ARTWORK; import static com.android.systemui.statusbar.phone.StatusBar.ENABLE_LOCKSCREEN_WALLPAPER; import static com.android.systemui.statusbar.phone.StatusBar.SHOW_LOCKSCREEN_MEDIA_ARTWORK; @@ -595,9 +599,11 @@ public class NotificationMediaManager implements Dumpable { boolean cannotAnimateDoze = shadeController != null && shadeController.isDozing() && !ScrimState.AOD.getAnimateChange(); - if (mBiometricUnlockController != null && mBiometricUnlockController.getMode() + boolean needsBypassFading = mKeyguardMonitor.isBypassFadingAnimation(); + if (((mBiometricUnlockController != null && mBiometricUnlockController.getMode() == BiometricUnlockController.MODE_WAKE_AND_UNLOCK_PULSING - || hideBecauseOccluded || cannotAnimateDoze) { + || cannotAnimateDoze) && !needsBypassFading) + || hideBecauseOccluded) { // We are unlocking directly - no animation! mBackdrop.setVisibility(View.GONE); @@ -622,9 +628,7 @@ public class NotificationMediaManager implements Dumpable { }); if (mKeyguardMonitor.isKeyguardFadingAway()) { mBackdrop.animate() - // Make it disappear faster, as the focus should be on the activity - // behind. - .setDuration(mKeyguardMonitor.getKeyguardFadingAwayDuration() / 2) + .setDuration(mKeyguardMonitor.getShortenedFadingAwayDuration()) .setStartDelay(mKeyguardMonitor.getKeyguardFadingAwayDelay()) .setInterpolator(Interpolators.LINEAR) .start(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java index f34b912a255c..3cb2a2aaeec7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationPresenter.java @@ -63,11 +63,6 @@ public interface NotificationPresenter extends ExpandableNotificationRow.OnExpan int getMaxNotificationsWhileLocked(boolean recompute); /** - * True if the presenter is currently locked. - */ - boolean isPresenterLocked(); - - /** * Called when the row states are updated by {@link NotificationViewHierarchyManager}. */ void onUpdateRowStates(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index 4ccd0cd3353b..99682fcfccbf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -374,6 +374,10 @@ public class NotificationShelf extends ActivatableNotificationView implements clipTransientViews(); setClipTopAmount(clipTopAmount); + boolean isHidden = getViewState().hidden || clipTopAmount >= getIntrinsicHeight(); + if (mShowNotificationShelf) { + setVisibility(isHidden ? View.INVISIBLE : View.VISIBLE); + } setBackgroundTop(backgroundTop); setFirstElementRoundness(firstElementRoundness); mShelfIcons.setSpeedBumpIndex(mAmbientState.getSpeedBumpIndex()); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java index 22c91647d7f7..6e75c0375afc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java @@ -397,15 +397,13 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle int userId = entry.notification.getUserId(); boolean suppressedSummary = mGroupManager.isSummaryOfSuppressedGroup( entry.notification) && !entry.isRowRemoved(); - boolean showOnKeyguard = mLockscreenUserManager.shouldShowOnKeyguard(entry - .notification); + boolean showOnKeyguard = mLockscreenUserManager.shouldShowOnKeyguard(entry); if (!showOnKeyguard) { // min priority notifications should show if their summary is showing if (mGroupManager.isChildInGroupWithSummary(entry.notification)) { NotificationEntry summary = mGroupManager.getLogicalGroupSummary( entry.notification); - if (summary != null && mLockscreenUserManager.shouldShowOnKeyguard( - summary.notification)) { + if (summary != null && mLockscreenUserManager.shouldShowOnKeyguard(summary)) { showOnKeyguard = true; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java index 0d9f4e7b909d..91d47077fc31 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java @@ -153,6 +153,7 @@ public class ActivityLaunchAnimator { if (primary == null) { setAnimationPending(false); invokeCallback(iRemoteAnimationFinishedCallback); + mNotificationPanel.collapse(false /* delayed */, 1.0f /* speedUpFactor */); return; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/BypassHeadsUpNotifier.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/BypassHeadsUpNotifier.kt index ea474ced7632..314dc04e574f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/BypassHeadsUpNotifier.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/BypassHeadsUpNotifier.kt @@ -21,6 +21,7 @@ import android.media.MediaMetadata import android.provider.Settings import com.android.keyguard.KeyguardUpdateMonitor import com.android.systemui.plugins.statusbar.StatusBarStateController +import com.android.systemui.statusbar.NotificationLockscreenUserManager import com.android.systemui.statusbar.NotificationMediaManager import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.notification.collection.NotificationEntry @@ -40,6 +41,7 @@ class BypassHeadsUpNotifier @Inject constructor( private val bypassController: KeyguardBypassController, private val statusBarStateController: StatusBarStateController, private val headsUpManager: HeadsUpManagerPhone, + private val notificationLockscreenUserManager: NotificationLockscreenUserManager, private val mediaManager: NotificationMediaManager, tunerService: TunerService) : StatusBarStateController.StateListener, NotificationMediaManager.MediaListener { @@ -63,7 +65,7 @@ class BypassHeadsUpNotifier @Inject constructor( enabled = Settings.Secure.getIntForUser( context.contentResolver, Settings.Secure.SHOW_MEDIA_WHEN_BYPASSING, - 1 /* default */, + 0 /* default */, KeyguardUpdateMonitor.getCurrentUser()) != 0 }, Settings.Secure.SHOW_MEDIA_WHEN_BYPASSING) } @@ -79,9 +81,6 @@ class BypassHeadsUpNotifier @Inject constructor( if (!NotificationMediaManager.isPlayingState(state)) { newEntry = null } - if (newEntry?.isSensitive == true) { - newEntry = null - } currentMediaEntry = newEntry updateAutoHeadsUp(previous) updateAutoHeadsUp(currentMediaEntry) @@ -89,7 +88,7 @@ class BypassHeadsUpNotifier @Inject constructor( private fun updateAutoHeadsUp(entry: NotificationEntry?) { entry?.let { - val autoHeadsUp = it == currentMediaEntry && canAutoHeadsUp() + val autoHeadsUp = it == currentMediaEntry && canAutoHeadsUp(it) it.isAutoHeadsUp = autoHeadsUp if (autoHeadsUp) { headsUpManager.showNotification(it) @@ -97,11 +96,36 @@ class BypassHeadsUpNotifier @Inject constructor( } } + /** + * @return {@code true} if this entry be autoHeadsUpped right now. + */ + private fun canAutoHeadsUp(entry: NotificationEntry): Boolean { + if (!isAutoHeadsUpAllowed()) { + return false; + } + if (entry.isSensitive) { + // filter sensitive notifications + return false + } + if (!notificationLockscreenUserManager.shouldShowOnKeyguard(entry)) { + // filter notifications invisible on Keyguard + return false + } + if (!entryManager.notificationData.activeNotifications.contains(entry)) { + // filter notifications not the active list currently + return false + } + return true + } + override fun onStatePostChange() { updateAutoHeadsUp(currentMediaEntry) } - private fun canAutoHeadsUp() : Boolean { + /** + * @return {@code true} if autoHeadsUp is possible right now. + */ + private fun isAutoHeadsUpAllowed() : Boolean { if (!enabled) { return false } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java index 16bd884fcc58..d9328fa3affd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/DynamicPrivacyController.java @@ -20,8 +20,12 @@ import android.content.Context; import android.util.ArraySet; import com.android.internal.annotations.VisibleForTesting; +import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationLockscreenUserManager; +import com.android.systemui.statusbar.StatusBarState; +import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.UnlockMethodCache; +import com.android.systemui.statusbar.policy.KeyguardMonitor; import javax.inject.Inject; import javax.inject.Singleton; @@ -34,22 +38,33 @@ public class DynamicPrivacyController implements UnlockMethodCache.OnUnlockMetho private final UnlockMethodCache mUnlockMethodCache; private final NotificationLockscreenUserManager mLockscreenUserManager; + private final StatusBarStateController mStateController; + private final KeyguardMonitor mKeyguardMonitor; private ArraySet<Listener> mListeners = new ArraySet<>(); private boolean mLastDynamicUnlocked; private boolean mCacheInvalid; + private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; @Inject DynamicPrivacyController(Context context, - NotificationLockscreenUserManager notificationLockscreenUserManager) { - this(notificationLockscreenUserManager, UnlockMethodCache.getInstance(context)); + KeyguardMonitor keyguardMonitor, + NotificationLockscreenUserManager notificationLockscreenUserManager, + StatusBarStateController stateController) { + this(notificationLockscreenUserManager, keyguardMonitor, + UnlockMethodCache.getInstance(context), + stateController); } @VisibleForTesting DynamicPrivacyController(NotificationLockscreenUserManager notificationLockscreenUserManager, - UnlockMethodCache unlockMethodCache) { + KeyguardMonitor keyguardMonitor, + UnlockMethodCache unlockMethodCache, + StatusBarStateController stateController) { mLockscreenUserManager = notificationLockscreenUserManager; + mStateController = stateController; mUnlockMethodCache = unlockMethodCache; + mKeyguardMonitor = keyguardMonitor; mUnlockMethodCache.addListener(this); mLastDynamicUnlocked = isDynamicallyUnlocked(); } @@ -77,13 +92,39 @@ public class DynamicPrivacyController implements UnlockMethodCache.OnUnlockMetho } public boolean isDynamicallyUnlocked() { - return mUnlockMethodCache.canSkipBouncer() && isDynamicPrivacyEnabled(); + return (mUnlockMethodCache.canSkipBouncer() || mKeyguardMonitor.isKeyguardGoingAway() + || mKeyguardMonitor.isKeyguardFadingAway()) + && isDynamicPrivacyEnabled(); } public void addListener(Listener listener) { mListeners.add(listener); } + /** + * Is the notification shade currently in a locked down mode where it's fully showing but the + * contents aren't revealed yet? + */ + public boolean isInLockedDownShade() { + if (!mStatusBarKeyguardViewManager.isShowing() + || !mStatusBarKeyguardViewManager.isSecure()) { + return false; + } + int state = mStateController.getState(); + if (state != StatusBarState.SHADE && state != StatusBarState.SHADE_LOCKED) { + return false; + } + if (!isDynamicPrivacyEnabled() || isDynamicallyUnlocked()) { + return false; + } + return true; + } + + public void setStatusBarKeyguardViewManager( + StatusBarKeyguardViewManager statusBarKeyguardViewManager) { + mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; + } + public interface Listener { void onDynamicPrivacyChanged(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java index 5bab0ef39326..4fc646119261 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java @@ -23,7 +23,6 @@ import android.app.NotificationManager; import android.content.Context; import android.database.ContentObserver; import android.hardware.display.AmbientDisplayConfiguration; -import android.os.Bundle; import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; @@ -32,7 +31,6 @@ import android.provider.Settings; import android.service.dreams.DreamService; import android.service.dreams.IDreamManager; import android.service.notification.StatusBarNotification; -import android.text.TextUtils; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; @@ -51,6 +49,7 @@ public class NotificationInterruptionStateProvider { private static final String TAG = "InterruptionStateProvider"; private static final boolean DEBUG = false; + private static final boolean DEBUG_HEADS_UP = true; private static final boolean ENABLE_HEADS_UP = true; private static final String SETTING_HEADS_UP_TICKER = "ticker_gets_heads_up"; @@ -199,7 +198,7 @@ public class NotificationInterruptionStateProvider { boolean inShade = mStatusBarStateController.getState() == SHADE; if (entry.isBubble() && inShade) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: in unlocked shade where notification is shown as a " + "bubble: " + sbn.getKey()); } @@ -207,7 +206,7 @@ public class NotificationInterruptionStateProvider { } if (!canAlertCommon(entry)) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: notification shouldn't alert: " + sbn.getKey()); } return false; @@ -218,7 +217,7 @@ public class NotificationInterruptionStateProvider { } if (entry.importance < NotificationManager.IMPORTANCE_HIGH) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: unimportant notification: " + sbn.getKey()); } return false; @@ -233,13 +232,16 @@ public class NotificationInterruptionStateProvider { boolean inUse = mPowerManager.isScreenOn() && !isDreaming; if (!inUse) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: not in use: " + sbn.getKey()); } return false; } if (!mHeadsUpSuppressor.canHeadsUp(entry, sbn)) { + if (DEBUG_HEADS_UP) { + Log.d(TAG, "No heads up: aborted by suppressor: " + sbn.getKey()); + } return false; } @@ -257,28 +259,28 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (!mAmbientDisplayConfiguration.pulseOnNotificationEnabled(UserHandle.USER_CURRENT)) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: disabled by setting: " + sbn.getKey()); } return false; } if (!canAlertCommon(entry)) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: notification shouldn't alert: " + sbn.getKey()); } return false; } if (entry.shouldSuppressAmbient()) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: ambient effect suppressed: " + sbn.getKey()); } return false; } if (entry.importance < NotificationManager.IMPORTANCE_DEFAULT) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No pulsing: not important enough: " + sbn.getKey()); } return false; @@ -300,7 +302,7 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (mNotificationFilter.shouldFilterOut(entry)) { - if (DEBUG) { + if (DEBUG || DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: filtered notification: " + sbn.getKey()); } return false; @@ -308,7 +310,7 @@ public class NotificationInterruptionStateProvider { // Don't alert notifications that are suppressed due to group alert behavior if (sbn.isGroup() && sbn.getNotification().suppressAlertingDueToGrouping()) { - if (DEBUG) { + if (DEBUG || DEBUG_HEADS_UP) { Log.d(TAG, "No alerting: suppressed due to group alert behavior"); } return false; @@ -330,28 +332,28 @@ public class NotificationInterruptionStateProvider { StatusBarNotification sbn = entry.notification; if (!mUseHeadsUp || mPresenter.isDeviceInVrMode()) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: no huns or vr mode"); } return false; } if (entry.shouldSuppressPeek()) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: suppressed by DND: " + sbn.getKey()); } return false; } if (isSnoozedPackage(sbn)) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: snoozed package: " + sbn.getKey()); } return false; } if (entry.hasJustLaunchedFullScreenIntent()) { - if (DEBUG) { + if (DEBUG_HEADS_UP) { Log.d(TAG, "No heads up: recent fullscreen: " + sbn.getKey()); } return false; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt index 6a3816c50330..2f67f90a115e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt @@ -29,6 +29,7 @@ import com.android.systemui.statusbar.phone.DozeParameters import com.android.systemui.statusbar.phone.HeadsUpManagerPhone import com.android.systemui.statusbar.phone.KeyguardBypassController import com.android.systemui.statusbar.phone.NotificationIconAreaController +import com.android.systemui.statusbar.phone.PanelExpansionListener import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener import javax.inject.Inject @@ -40,7 +41,8 @@ class NotificationWakeUpCoordinator @Inject constructor( private val mHeadsUpManagerPhone: HeadsUpManagerPhone, private val statusBarStateController: StatusBarStateController, private val bypassController: KeyguardBypassController) - : OnHeadsUpChangedListener, StatusBarStateController.StateListener { + : OnHeadsUpChangedListener, StatusBarStateController.StateListener, + PanelExpansionListener { private val mNotificationVisibility = object : FloatProperty<NotificationWakeUpCoordinator>("notificationVisibility") { @@ -64,7 +66,6 @@ class NotificationWakeUpCoordinator @Inject constructor( private var mVisibilityAnimator: ObjectAnimator? = null private var mVisibilityAmount = 0.0f private var mLinearVisibilityAmount = 0.0f - private var mWakingUp = false private val mEntrySetToClearWhenFinished = mutableSetOf<NotificationEntry>() private val mDozeParameters: DozeParameters private var pulseExpanding: Boolean = false @@ -73,6 +74,25 @@ class NotificationWakeUpCoordinator @Inject constructor( var fullyAwake: Boolean = false + var wakingUp = false + set(value) { + field = value + willWakeUp = false + if (value) { + if (mNotificationsVisible && !mNotificationsVisibleForExpansion + && !bypassController.bypassEnabled) { + // We're waking up while pulsing, let's make sure the animation looks nice + mStackScroller.wakeUpFromPulse(); + } + if (bypassController.bypassEnabled && !mNotificationsVisible) { + // Let's make sure our huns become visible once we are waking up in case + // they were blocked by the proximity sensor + updateNotificationVisibility(animate = shouldAnimateVisibility(), + increaseSpeed = false) + } + } + } + var willWakeUp = false set(value) { if (!value || mDozeAmount != 0.0f) { @@ -80,7 +100,9 @@ class NotificationWakeUpCoordinator @Inject constructor( } } + private var collapsedEnoughToHide: Boolean = false lateinit var iconAreaController : NotificationIconAreaController + var pulsing: Boolean = false set(value) { field = value @@ -102,7 +124,6 @@ class NotificationWakeUpCoordinator @Inject constructor( } } } - /** * True if we can show pulsing heads up notifications */ @@ -112,8 +133,12 @@ class NotificationWakeUpCoordinator @Inject constructor( var canShow = pulsing if (bypassController.bypassEnabled) { // We also allow pulsing on the lock screen! - canShow = canShow || (mWakingUp || willWakeUp || fullyAwake) + canShow = canShow || (wakingUp || willWakeUp || fullyAwake) && statusBarStateController.state == StatusBarState.KEYGUARD + // We want to hide the notifications when collapsed too much + if (collapsedEnoughToHide) { + canShow = false + } } return canShow } @@ -122,6 +147,17 @@ class NotificationWakeUpCoordinator @Inject constructor( mHeadsUpManagerPhone.addListener(this) statusBarStateController.addCallback(this) mDozeParameters = DozeParameters.getInstance(mContext) + addListener(object : WakeUpListener { + override fun onFullyHiddenChanged(isFullyHidden: Boolean) { + if (isFullyHidden && mNotificationsVisibleForExpansion) { + // When the notification becomes fully invisible, let's make sure our expansion + // flag also changes. This can happen if the bouncer shows when dragging down + // and then the screen turning off, where we don't reset this state. + setNotificationsVisibleForExpansion(visible = false, animate = false, + increaseSpeed = false) + } + } + }); } fun setStackScroller(stackScroller: NotificationStackScrollLayout) { @@ -160,7 +196,7 @@ class NotificationWakeUpCoordinator @Inject constructor( wakeUpListeners.add(listener); } - fun removeFullyHiddenChangedListener(listener: WakeUpListener) { + fun removeListener(listener: WakeUpListener) { wakeUpListeners.remove(listener); } @@ -169,7 +205,7 @@ class NotificationWakeUpCoordinator @Inject constructor( var visible = mNotificationsVisibleForExpansion || mHeadsUpManagerPhone.hasNotifications() visible = visible && canShowPulsingHuns - if (!visible && mNotificationsVisible && (mWakingUp || willWakeUp) && mDozeAmount != 0.0f) { + if (!visible && mNotificationsVisible && (wakingUp || willWakeUp) && mDozeAmount != 0.0f) { // let's not make notifications invisible while waking up, otherwise the animation // is strange return; @@ -229,6 +265,18 @@ class NotificationWakeUpCoordinator @Inject constructor( this.state = newState } + override fun onPanelExpansionChanged(expansion: Float, tracking: Boolean) { + val collapsedEnough = expansion <= 0.9f + if (collapsedEnough != this.collapsedEnoughToHide) { + val couldShowPulsingHuns = canShowPulsingHuns; + this.collapsedEnoughToHide = collapsedEnough + if (couldShowPulsingHuns && !canShowPulsingHuns) { + updateNotificationVisibility(animate = true, increaseSpeed = true) + mHeadsUpManagerPhone.releaseAllImmediately() + } + } + } + private fun updateDozeAmountIfBypass(): Boolean { if (bypassController.bypassEnabled) { var amount = 1.0f; @@ -307,16 +355,6 @@ class NotificationWakeUpCoordinator @Inject constructor( return if (bypassController.bypassEnabled) 0.0f else overflow } - fun setWakingUp(wakingUp: Boolean) { - willWakeUp = false - mWakingUp = wakingUp - if (wakingUp && mNotificationsVisible && !mNotificationsVisibleForExpansion - && !bypassController.bypassEnabled) { - // We're waking up while pulsing, let's make sure the animation looks nice - mStackScroller.wakeUpFromPulse(); - } - } - override fun onHeadsUpStateChanged(entry: NotificationEntry, isHeadsUp: Boolean) { var animate = shouldAnimateVisibility() if (!isHeadsUp) { @@ -325,7 +363,7 @@ class NotificationWakeUpCoordinator @Inject constructor( // if we animate, we see the shelf briefly visible. Instead we fully animate // the notification and its background out animate = false - } else if (!mWakingUp && !willWakeUp){ + } else if (!wakingUp && !willWakeUp){ // TODO: look that this is done properly and not by anyone else entry.setHeadsUpAnimatingAway(true) mEntrySetToClearWhenFinished.add(entry) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java index fca520fe0521..1ce493444e25 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationData.java @@ -25,7 +25,6 @@ import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.SnoozeCriterion; import android.service.notification.StatusBarNotification; import android.util.ArrayMap; -import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; import com.android.systemui.Dependency; @@ -108,10 +107,19 @@ public class NotificationData { boolean bSystemMax = bImportance >= NotificationManager.IMPORTANCE_HIGH && isSystemNotification(nb); - boolean isHeadsUp = a.getRow().isHeadsUp(); - if (isHeadsUp != b.getRow().isHeadsUp()) { - return isHeadsUp ? -1 : 1; - } else if (isHeadsUp) { + + boolean aHeadsUp = a.getRow().isHeadsUp(); + boolean bHeadsUp = b.getRow().isHeadsUp(); + + // HACK: This should really go elsewhere, but it's currently not straightforward to + // extract the comparison code and we're guaranteed to touch every element, so this is + // the best place to set the buckets for the moment. + a.setIsTopBucket(aHeadsUp || aMedia || aSystemMax || a.isHighPriority()); + b.setIsTopBucket(bHeadsUp || bMedia || bSystemMax || b.isHighPriority()); + + if (aHeadsUp != bHeadsUp) { + return aHeadsUp ? -1 : 1; + } else if (aHeadsUp) { // Provide consistent ranking with headsUpManager return mHeadsUpManager.compare(a, b); } else if (aMedia != bMedia) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java index b19d2ca29c96..fe8854168288 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java @@ -173,9 +173,13 @@ public final class NotificationEntry { * the lock screen/status bar and in the top section in the shade. */ private boolean mHighPriority; + + private boolean mIsTopBucket; + private boolean mSensitive = true; private Runnable mOnSensitiveChangedListener; private boolean mAutoHeadsUp; + private boolean mPulseSupressed; public NotificationEntry(StatusBarNotification n) { this(n, null); @@ -224,6 +228,18 @@ public final class NotificationEntry { this.mHighPriority = highPriority; } + /** + * @return True if the notif should appear in the "top" or "important" section of notifications + * (as opposed to the "bottom" or "silent" section). This is usually the same as + * {@link #isHighPriority()}, but there are certain exceptions, such as media notifs. + */ + public boolean isTopBucket() { + return mIsTopBucket; + } + public void setIsTopBucket(boolean isTopBucket) { + mIsTopBucket = isTopBucket; + } + public boolean isBubble() { return (notification.getNotification().flags & FLAG_BUBBLE) != 0; } @@ -900,6 +916,14 @@ public final class NotificationEntry { mOnSensitiveChangedListener = listener; } + public boolean isPulseSuppressed() { + return mPulseSupressed; + } + + public void setPulseSuppressed(boolean suppressed) { + mPulseSupressed = suppressed; + } + /** Information about a suggestion that is being edited. */ public static class EditedSuggestionInfo { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt index 8e6822770694..782aad17345e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogController.kt @@ -23,6 +23,7 @@ import android.app.NotificationChannel.DEFAULT_CHANNEL_ID import android.app.NotificationChannelGroup import android.app.NotificationManager.IMPORTANCE_NONE import android.content.Context +import android.content.DialogInterface import android.graphics.Color import android.graphics.PixelFormat import android.graphics.drawable.Drawable @@ -171,7 +172,6 @@ class ChannelEditorDialogController @Inject constructor( private fun done() { resetState() dialog.dismiss() - onFinishListener?.onChannelEditorDialogFinished() } private fun resetState() { @@ -261,6 +261,11 @@ class ChannelEditorDialogController @Inject constructor( dialog.apply { setContentView(R.layout.notif_half_shelf) setCanceledOnTouchOutside(true) + setOnDismissListener(object : DialogInterface.OnDismissListener { + override fun onDismiss(dialog: DialogInterface?) { + onFinishListener?.onChannelEditorDialogFinished() + } + }) findViewById<ChannelEditorListView>(R.id.half_shelf_container).apply { controller = this@ChannelEditorDialogController appIcon = this@ChannelEditorDialogController.appIcon diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index a8327f63dcf7..ea31be4cf90c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -1367,7 +1367,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (isChildInGroup()) { mTranslationWhenRemoved += getNotificationParent().getTranslationY(); } - mPrivateLayout.setRemoved(); + for (NotificationContentView l : mLayouts) { + l.setRemoved(); + } } public boolean wasChildInGroupWhenRemoved() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java index d057a1d2f20b..48a82957bf1e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java @@ -349,7 +349,7 @@ public class NotificationContentInflater { } if ((reInflateFlags & FLAG_CONTENT_VIEW_PUBLIC) != 0) { - result.newPublicView = builder.makePublicContentView(); + result.newPublicView = builder.makePublicContentView(isLowPriority); } result.packageContext = packageContext; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java index 90f63249846e..0c5b27b92878 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java @@ -1542,6 +1542,15 @@ public class NotificationContentView extends FrameLayout { if (mHeadsUpRemoteInput != null) { mHeadsUpRemoteInput.setRemoved(); } + if (mExpandedWrapper != null) { + mExpandedWrapper.setRemoved(); + } + if (mContractedWrapper != null) { + mContractedWrapper.setRemoved(); + } + if (mHeadsUpWrapper != null) { + mHeadsUpWrapper.setRemoved(); + } } public void setContentHeightAnimating(boolean animating) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java index 20e8b733ce6a..1116106df19d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java @@ -39,6 +39,7 @@ import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; +import com.android.internal.widget.MediaNotificationView; import com.android.systemui.Dependency; import com.android.systemui.statusbar.NotificationMediaManager; import com.android.systemui.statusbar.TransformableView; @@ -67,6 +68,7 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi private View mSeekBarView; private Context mContext; private MetricsLogger mMetricsLogger; + private boolean mIsViewVisible; @VisibleForTesting protected SeekBar.OnSeekBarChangeListener mSeekListener = @@ -88,11 +90,46 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi } }; + private MediaNotificationView.VisibilityChangeListener mVisibilityListener = + new MediaNotificationView.VisibilityChangeListener() { + @Override + public void onAggregatedVisibilityChanged(boolean isVisible) { + mIsViewVisible = isVisible; + if (isVisible && mMediaController != null) { + // Restart timer if we're currently playing and didn't already have one going + PlaybackState state = mMediaController.getPlaybackState(); + if (state != null && state.getState() == PlaybackState.STATE_PLAYING + && mSeekBarTimer == null && mSeekBarView != null + && mSeekBarView.getVisibility() != View.GONE) { + startTimer(); + } + } else { + clearTimer(); + } + } + }; + + private View.OnAttachStateChangeListener mAttachStateListener = + new View.OnAttachStateChangeListener() { + @Override + public void onViewAttachedToWindow(View v) { + } + + @Override + public void onViewDetachedFromWindow(View v) { + mIsViewVisible = false; + } + }; + private MediaController.Callback mMediaCallback = new MediaController.Callback() { @Override public void onSessionDestroyed() { clearTimer(); mMediaController.unregisterCallback(this); + if (mView instanceof MediaNotificationView) { + ((MediaNotificationView) mView).removeVisibilityListener(mVisibilityListener); + mView.removeOnAttachStateChangeListener(mAttachStateListener); + } } @Override @@ -126,10 +163,17 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi mContext = ctx; mMediaManager = Dependency.get(NotificationMediaManager.class); mMetricsLogger = Dependency.get(MetricsLogger.class); + + if (mView instanceof MediaNotificationView) { + MediaNotificationView mediaView = (MediaNotificationView) mView; + mediaView.addVisibilityListener(mVisibilityListener); + mView.addOnAttachStateChangeListener(mAttachStateListener); + } } private void resolveViews() { mActions = mView.findViewById(com.android.internal.R.id.media_actions); + mIsViewVisible = mView.isShown(); final MediaSession.Token token = mRow.getEntry().notification.getNotification().extras .getParcelable(Notification.EXTRA_MEDIA_SESSION); @@ -208,24 +252,37 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi private void startTimer() { clearTimer(); - mSeekBarTimer = new Timer(true /* isDaemon */); - mSeekBarTimer.schedule(new TimerTask() { - @Override - public void run() { - mHandler.post(mOnUpdateTimerTick); - } - }, 0, PROGRESS_UPDATE_INTERVAL); + if (mIsViewVisible) { + mSeekBarTimer = new Timer(true /* isDaemon */); + mSeekBarTimer.schedule(new TimerTask() { + @Override + public void run() { + mHandler.post(mOnUpdateTimerTick); + } + }, 0, PROGRESS_UPDATE_INTERVAL); + } } private void clearTimer() { if (mSeekBarTimer != null) { - // TODO: also trigger this when the notification panel is collapsed mSeekBarTimer.cancel(); mSeekBarTimer.purge(); mSeekBarTimer = null; } } + @Override + public void setRemoved() { + clearTimer(); + if (mMediaController != null) { + mMediaController.unregisterCallback(mMediaCallback); + } + if (mView instanceof MediaNotificationView) { + ((MediaNotificationView) mView).removeVisibilityListener(mVisibilityListener); + mView.removeOnAttachStateChangeListener(mAttachStateListener); + } + } + private boolean canSeekMedia(@Nullable PlaybackState state) { if (state == null) { return false; @@ -261,7 +318,6 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi public void run() { if (mMediaController != null && mSeekBar != null) { PlaybackState playbackState = mMediaController.getPlaybackState(); - if (playbackState != null) { updatePlaybackUi(playbackState); } else { @@ -274,6 +330,10 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi }; private void updatePlaybackUi(PlaybackState state) { + if (mSeekBar == null || mSeekBarElapsedTime == null) { + return; + } + long position = state.getPosition(); mSeekBar.setProgress((int) position); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java index 47906a7058a3..3950003e64ce 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java @@ -261,6 +261,12 @@ public abstract class NotificationViewWrapper implements TransformableView { mView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE); } + /** + * Called to indicate this view is removed + */ + public void setRemoved() { + } + public int getCustomBackgroundColor() { // Parent notifications should always use the normal background color return mRow.isSummaryWithChildren() ? 0 : mBackgroundColor; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationListContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationListContainer.java index 212808dae8e3..15cc72c2d7a1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationListContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationListContainer.java @@ -184,4 +184,6 @@ public interface NotificationListContainer extends ExpandableView.OnHeightChange default boolean containsView(View v) { return true; } + + default void setWillExpand(boolean willExpand) {}; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java index 170a4d570688..d119fb79e4c6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.java @@ -133,7 +133,7 @@ class NotificationSectionsManager implements StackScrollAlgorithm.SectionProvide if (child instanceof ExpandableNotificationRow && child.getVisibility() != View.GONE) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; - if (!row.getEntry().isHighPriority()) { + if (!row.getEntry().isTopBucket()) { firstGentleNotifIndex = i; mFirstGentleNotif = row; break; @@ -248,7 +248,7 @@ class NotificationSectionsManager implements StackScrollAlgorithm.SectionProvide View child = mParent.getChildAt(i); if (child.getVisibility() != View.GONE && child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; - if (!row.getEntry().isHighPriority()) { + if (!row.getEntry().isTopBucket()) { break; } else { lastChildBeforeGap = row; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 9e3d74b138fa..f50790f3013b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -180,6 +180,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd */ private static final int DISTANCE_BETWEEN_ADJACENT_SECTIONS_PX = 1; private final KeyguardBypassController mKeyguardBypassController; + private final DynamicPrivacyController mDynamicPrivacyController; + private final SysuiStatusBarStateController mStatusbarStateController; private ExpandHelper mExpandHelper; private final NotificationSwipeHelper mSwipeHelper; @@ -412,6 +414,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd outline.setRoundRect(mBackgroundAnimationRect, MathUtils.lerp(mCornerRadius / 2.0f, mCornerRadius, xProgress)); + outline.setAlpha(1.0f - mAmbientState.getHideAmount()); } else { ViewOutlineProvider.BACKGROUND.getOutline(view, outline); } @@ -500,6 +503,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private boolean mAnimateBottomOnLayout; private float mLastSentAppear; private float mLastSentExpandedHeight; + private boolean mWillExpand; @Inject public NotificationStackScrollLayout( @@ -603,6 +607,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } }); dynamicPrivacyController.addListener(this); + mDynamicPrivacyController = dynamicPrivacyController; + mStatusbarStateController = (SysuiStatusBarStateController) statusBarStateController; } private void updateDismissRtlSetting(boolean dismissRtl) { @@ -693,6 +699,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public boolean hasActiveClearableNotifications(@SelectedRows int selection) { + if (mDynamicPrivacyController.isInLockedDownShade()) { + return false; + } int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); @@ -1043,6 +1052,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd requestChildrenUpdate(); updateFirstAndLastBackgroundViews(); updateAlgorithmLayoutMinHeight(); + updateOwnTranslationZ(); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) @@ -2549,13 +2559,21 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } return; } - int minTopPosition = 0; + int minTopPosition; NotificationSection lastSection = getLastVisibleSection(); boolean onKeyguard = mStatusBarState == StatusBarState.KEYGUARD; if (!onKeyguard) { minTopPosition = (int) (mTopPadding + mStackTranslation); } else if (lastSection == null) { minTopPosition = mTopPadding; + } else { + // The first sections could be empty while there could still be elements in later + // sections. The position of these first few sections is determined by the position of + // the first visible section. + NotificationSection firstVisibleSection = getFirstVisibleSection(); + firstVisibleSection.updateBounds(0 /* minTopPosition*/, 0 /* minBottomPosition */, + false /* shiftPulsingWithFirst */); + minTopPosition = firstVisibleSection.getBounds().top; } boolean shiftPulsingWithFirst = mHeadsUpManager.getAllEntries().count() <= 1 && (mAmbientState.isDozing() @@ -4398,6 +4416,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mStateAnimator.setShadeExpanded(isExpanded); mSwipeHelper.setIsExpanded(isExpanded); if (changed) { + mWillExpand = false; if (!mIsExpanded) { mGroupManager.collapseAllGroups(); mExpandHelper.cancelImmediately(); @@ -4766,6 +4785,20 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd updateAlgorithmHeightAndPadding(); updateBackgroundDimming(); requestChildrenUpdate(); + updateOwnTranslationZ(); + } + + private void updateOwnTranslationZ() { + // Since we are clipping to the outline we need to make sure that the shadows aren't + // clipped when pulsing + float ownTranslationZ = 0; + if (mKeyguardBypassController.getBypassEnabled() && mAmbientState.isHiddenAtAll()) { + ExpandableView firstChildNotGone = getFirstChildNotGone(); + if (firstChildNotGone != null && firstChildNotGone.showingPulsing()) { + ownTranslationZ = firstChildNotGone.getTranslationZ(); + } + } + setTranslationZ(ownTranslationZ); } private void updateVisibility() { @@ -5047,7 +5080,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd if (mAnimationsEnabled && (isHeadsUp || mHeadsUpGoingAwayAnimationsAllowed)) { mHeadsUpChangeAnimations.add(new Pair<>(row, isHeadsUp)); mNeedsAnimation = true; - if (!mIsExpanded && !isHeadsUp) { + if (!mIsExpanded && !mWillExpand && !isHeadsUp) { row.setHeadsUpAnimatingAway(true); } requestChildrenUpdate(); @@ -5068,6 +5101,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd requestChildrenUpdate(); } + @Override + public void setWillExpand(boolean willExpand) { + mWillExpand = willExpand; + } + @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setTrackingHeadsUp(ExpandableNotificationRow row) { mTrackingHeadsUp = row != null; @@ -5668,6 +5706,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd // The bottom might change because we're using the final actual height of the view mAnimateBottomOnLayout = true; } + // Let's update the footer once the notifications have been updated (in the next frame) + post(() -> { + updateFooter(); + updateSectionBoundaries(); + }); } public void setOnPulseHeightChangedListener(Runnable listener) { @@ -5738,7 +5781,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd currentIndex++; boolean beforeSpeedBump; if (mHighPriorityBeforeSpeedBump) { - beforeSpeedBump = row.getEntry().isHighPriority(); + beforeSpeedBump = row.getEntry().isTopBucket(); } else { beforeSpeedBump = !row.getEntry().ambient; } @@ -5796,9 +5839,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd case ROWS_ALL: return true; case ROWS_HIGH_PRIORITY: - return row.getEntry().isHighPriority(); + return row.getEntry().isTopBucket(); case ROWS_GENTLE: - return !row.getEntry().isHighPriority(); + return !row.getEntry().isTopBucket(); default: throw new IllegalArgumentException("Unknown selection: " + selection); } @@ -6323,6 +6366,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } return true; + } else if (mDynamicPrivacyController.isInLockedDownShade()) { + mStatusbarStateController.setLeaveOpenOnKeyguardHide(true); + mStatusBar.dismissKeyguardThenExecute(() -> false /* dismissAction */, + null /* cancelRunnable */, false /* afterKeyguardGone */); + return true; } else { // abort gesture. return false; @@ -6356,6 +6404,30 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd public boolean isFalsingCheckNeeded() { return mStatusBarState == StatusBarState.KEYGUARD; } + + @Override + public boolean isDragDownEnabledForView(ExpandableView view) { + if (isDragDownAnywhereEnabled()) { + return true; + } + if (mDynamicPrivacyController.isInLockedDownShade()) { + if (view == null) { + // Dragging down is allowed in general + return true; + } + if (view instanceof ExpandableNotificationRow) { + // Only drag down on sensitive views, otherwise the ExpandHelper will take this + return ((ExpandableNotificationRow) view).getEntry().isSensitive(); + } + } + return false; + } + + @Override + public boolean isDragDownAnywhereEnabled() { + return mStatusbarStateController.getState() == StatusBarState.KEYGUARD + && !mKeyguardBypassController.getBypassEnabled(); + } }; public DragDownCallback getDragDownCallback() { return mDragDownCallback; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java index 7655056ea60b..ef8048487022 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java @@ -161,6 +161,7 @@ public class StackScrollAlgorithm { : 0; float clipStart = 0; int childCount = algorithmState.visibleChildren.size(); + boolean firstHeadsUp = true; for (int i = 0; i < childCount; i++) { ExpandableView child = algorithmState.visibleChildren.get(i); ExpandableViewState state = child.getViewState(); @@ -173,7 +174,7 @@ public class StackScrollAlgorithm { boolean isHeadsUp = (child instanceof ExpandableNotificationRow) && ((ExpandableNotificationRow) child).isPinned(); if (mClipNotificationScrollToTop - && (!state.inShelf || isHeadsUp) + && (!state.inShelf || (isHeadsUp && !firstHeadsUp)) && newYTranslation < clipStart) { // The previous view is overlapping on top, clip! float overlapAmount = clipStart - newYTranslation; @@ -181,7 +182,9 @@ public class StackScrollAlgorithm { } else { state.clipTopAmount = 0; } - + if (isHeadsUp) { + firstHeadsUp = false; + } if (!child.isTransparent()) { // Only update the previous values if we are not transparent, // otherwise we would clip to a transparent view. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java index 94cd2cdaa9d3..41c6a7ba7848 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java @@ -445,14 +445,13 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback { if (!mUpdateMonitor.isDeviceInteractive()) { if (!mStatusBarKeyguardViewManager.isShowing()) { return bypass ? MODE_WAKE_AND_UNLOCK : MODE_ONLY_WAKE; - } else if (mDozeScrimController.isPulsing() && unlockingAllowed) { + } else if (!unlockingAllowed) { + return bypass ? MODE_SHOW_BOUNCER : MODE_NONE; + } else if (mDozeScrimController.isPulsing()) { // Let's not wake-up to lock screen when not bypassing, otherwise the notification // would move as the user tried to tap it. return bypass ? MODE_WAKE_AND_UNLOCK_PULSING : MODE_NONE; } else { - if (!(mDozeScrimController.isPulsing() && !unlockingAllowed)) { - Log.wtf(TAG, "Face somehow arrived when the device was not interactive"); - } if (bypass) { // Wake-up fading out nicely return MODE_WAKE_AND_UNLOCK_PULSING; @@ -530,7 +529,8 @@ public class BiometricUnlockController extends KeyguardUpdateMonitorCallback { mStatusBar.notifyBiometricAuthModeChanged(); } - private final WakefulnessLifecycle.Observer mWakefulnessObserver = + @VisibleForTesting + final WakefulnessLifecycle.Observer mWakefulnessObserver = new WakefulnessLifecycle.Observer() { @Override public void onFinishedWakingUp() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java index 539bc7bcb3f6..fce1dcc998fe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java @@ -14,8 +14,7 @@ package com.android.systemui.statusbar.phone; -import static com.android.systemui.Interpolators.ALPHA_IN; -import static com.android.systemui.Interpolators.ALPHA_OUT; +import static com.android.systemui.Interpolators.LINEAR; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -23,6 +22,8 @@ import android.animation.ValueAnimator; import android.view.View; import android.view.View.AccessibilityDelegate; +import com.android.systemui.Dependency; +import com.android.systemui.assist.AssistManager; import com.android.systemui.statusbar.policy.KeyButtonDrawable; import java.util.ArrayList; @@ -32,12 +33,13 @@ import java.util.ArrayList; * multiples of the same nav bar icon appearing. */ public class ButtonDispatcher { - private final static int FADE_DURATION_IN = 150; - private final static int FADE_DURATION_OUT = 100; + private static final int FADE_DURATION_IN = 150; + private static final int FADE_DURATION_OUT = 250; private final ArrayList<View> mViews = new ArrayList<>(); private final int mId; + private final AssistManager mAssistManager; private View.OnClickListener mClickListener; private View.OnTouchListener mTouchListener; @@ -55,7 +57,10 @@ public class ButtonDispatcher { private AccessibilityDelegate mAccessibilityDelegate; private final ValueAnimator.AnimatorUpdateListener mAlphaListener = animation -> - setAlpha((float) animation.getAnimatedValue()); + setAlpha( + (float) animation.getAnimatedValue(), + false /* animate */, + false /* cancelAnimator */); private final AnimatorListenerAdapter mFadeListener = new AnimatorListenerAdapter() { @Override @@ -67,6 +72,7 @@ public class ButtonDispatcher { public ButtonDispatcher(int id) { mId = id; + mAssistManager = Dependency.get(AssistManager.class); } void clear() { @@ -167,18 +173,32 @@ public class ButtonDispatcher { } public void setAlpha(float alpha, boolean animate) { - setAlpha(alpha, animate, (getAlpha() < alpha) ? FADE_DURATION_IN : FADE_DURATION_OUT); + setAlpha(alpha, animate, true /* cancelAnimator */); } public void setAlpha(float alpha, boolean animate, long duration) { + setAlpha(alpha, animate, duration, true /* cancelAnimator */); + } + + public void setAlpha(float alpha, boolean animate, boolean cancelAnimator) { + setAlpha( + alpha, + animate, + (getAlpha() < alpha) ? FADE_DURATION_IN : FADE_DURATION_OUT, + cancelAnimator); + } + + public void setAlpha(float alpha, boolean animate, long duration, boolean cancelAnimator) { + if (mFadeAnimator != null && (cancelAnimator || animate)) { + mFadeAnimator.cancel(); + } if (animate) { - if (mFadeAnimator != null) { - mFadeAnimator.cancel(); - } setVisibility(View.VISIBLE); mFadeAnimator = ValueAnimator.ofFloat(getAlpha(), alpha); + mFadeAnimator.setStartDelay( + mAssistManager.getAssistHandleShowAndGoRemainingDurationMs()); mFadeAnimator.setDuration(duration); - mFadeAnimator.setInterpolator(getAlpha() < alpha ? ALPHA_IN : ALPHA_OUT); + mFadeAnimator.setInterpolator(LINEAR); mFadeAnimator.addListener(mFadeListener); mFadeAnimator.addUpdateListener(mAlphaListener); mFadeAnimator.start(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java index f9cdde8059d4..e0c6c55c2e59 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java @@ -103,7 +103,7 @@ public class EdgeBackGestureHandler implements DisplayListener { new ISystemGestureExclusionListener.Stub() { @Override public void onSystemGestureExclusionChanged(int displayId, - Region systemGestureExclusion) { + Region systemGestureExclusion, Region unrestrictedOrNull) { if (displayId == mDisplayId) { mMainExecutor.execute(() -> mExcludeRegion.set(systemGestureExclusion)); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java index 46dd5e62ddda..f53c4e8c818e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java @@ -35,6 +35,7 @@ import com.android.systemui.statusbar.CrossFadeHelper; import com.android.systemui.statusbar.HeadsUpStatusBarView; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; +import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; @@ -48,7 +49,7 @@ import java.util.function.Consumer; * Controls the appearance of heads up notifications in the icon area and the header itself. */ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, - DarkIconDispatcher.DarkReceiver { + DarkIconDispatcher.DarkReceiver, NotificationWakeUpCoordinator.WakeUpListener { public static final int CONTENT_FADE_DURATION = 110; public static final int CONTENT_FADE_DELAY = 100; private final NotificationIconAreaController mNotificationIconAreaController; @@ -67,6 +68,7 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, private final KeyguardBypassController mBypassController; private final StatusBarStateController mStatusBarStateController; private final CommandQueue mCommandQueue; + private final NotificationWakeUpCoordinator mWakeUpCoordinator; @VisibleForTesting float mExpandedHeight; @VisibleForTesting @@ -95,9 +97,10 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, HeadsUpManagerPhone headsUpManager, View statusbarView, SysuiStatusBarStateController statusBarStateController, - KeyguardBypassController keyguardBypassController) { + KeyguardBypassController keyguardBypassController, + NotificationWakeUpCoordinator wakeUpCoordinator) { this(notificationIconAreaController, headsUpManager, statusBarStateController, - keyguardBypassController, + keyguardBypassController, wakeUpCoordinator, statusbarView.findViewById(R.id.heads_up_status_bar_view), statusbarView.findViewById(R.id.notification_stack_scroller), statusbarView.findViewById(R.id.notification_panel), @@ -112,6 +115,7 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, HeadsUpManagerPhone headsUpManager, StatusBarStateController stateController, KeyguardBypassController bypassController, + NotificationWakeUpCoordinator wakeUpCoordinator, HeadsUpStatusBarView headsUpStatusBarView, NotificationStackScrollLayout stackScroller, NotificationPanelView panelView, @@ -153,6 +157,8 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, }); mBypassController = bypassController; mStatusBarStateController = stateController; + mWakeUpCoordinator = wakeUpCoordinator; + wakeUpCoordinator.addListener(this); mCommandQueue = getComponent(headsUpStatusBarView.getContext(), CommandQueue.class); mKeyguardMonitor = Dependency.get(KeyguardMonitor.class); } @@ -161,6 +167,7 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, public void destroy() { mHeadsUpManager.removeListener(this); mHeadsUpStatusBarView.setOnDrawingRectChangedListener(null); + mWakeUpCoordinator.removeListener(this); mPanelView.removeTrackingHeadsUpListener(mSetTrackingHeadsUp); mPanelView.removeVerticalTranslationListener(mUpdatePanelTranslation); mPanelView.setHeadsUpAppearanceController(null); @@ -289,6 +296,11 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, updateParentClipping(true /* shouldClip */); }); } + // Show the status bar icons when the view gets shown / hidden + if (mStatusBarStateController.getState() != StatusBarState.SHADE) { + mCommandQueue.recomputeDisableFlags( + mHeadsUpStatusBarView.getContext().getDisplayId(), false); + } } } @@ -362,10 +374,12 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, * @return if the heads up status bar view should be shown */ public boolean shouldBeVisible() { - boolean canShow = !mIsExpanded; + boolean notificationsShown = !mWakeUpCoordinator.getNotificationsFullyHidden(); + boolean canShow = !mIsExpanded && notificationsShown; if (mBypassController.getBypassEnabled() && (mStatusBarStateController.getState() == StatusBarState.KEYGUARD - || mKeyguardMonitor.isKeyguardGoingAway())) { + || mKeyguardMonitor.isKeyguardGoingAway()) + && notificationsShown) { canShow = true; } return canShow && mHeadsUpManager.hasPinnedHeadsUp(); @@ -377,15 +391,6 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, updateHeader(entry); } - @Override - public void onHeadsUpPinnedModeChanged(boolean inPinnedMode) { - if (mStatusBarStateController.getState() != StatusBarState.SHADE) { - // Show the status bar icons when the pinned mode changes - mCommandQueue.recomputeDisableFlags( - mHeadsUpStatusBarView.getContext().getDisplayId(), false); - } - } - public void setAppearFraction(float expandedHeight, float appearFraction) { boolean changed = expandedHeight != mExpandedHeight; mExpandedHeight = expandedHeight; @@ -451,4 +456,9 @@ public class HeadsUpAppearanceController implements OnHeadsUpChangedListener, mAppearFraction = oldController.mAppearFraction; } } + + @Override + public void onFullyHiddenChanged(boolean isFullyHidden) { + updateTopEntry(); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index d6f8a606af55..c4d346ccaefb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -170,7 +170,7 @@ public class KeyguardBouncer { // Split up the work over multiple frames. DejankUtils.removeCallbacks(mResetRunnable); - if (mUnlockMethodCache.isUnlockingWithFacePossible() && !needsFullscreenBouncer() + if (mUnlockMethodCache.isFaceAuthEnabled() && !needsFullscreenBouncer() && !mKeyguardUpdateMonitor.userNeedsStrongAuth()) { mHandler.postDelayed(mShowRunnable, BOUNCER_FACE_DELAY); } else { @@ -207,14 +207,12 @@ public class KeyguardBouncer { * @see #onFullyShown() */ private void onFullyHidden() { - if (!mShowingSoon) { - cancelShowRunnable(); - if (mRoot != null) { - mRoot.setVisibility(View.INVISIBLE); - } - mFalsingManager.onBouncerHidden(); - DejankUtils.postAfterTraversal(mResetRunnable); + cancelShowRunnable(); + if (mRoot != null) { + mRoot.setVisibility(View.INVISIBLE); } + mFalsingManager.onBouncerHidden(); + DejankUtils.postAfterTraversal(mResetRunnable); } private final Runnable mShowRunnable = new Runnable() { @@ -349,7 +347,7 @@ public class KeyguardBouncer { * {@link #show(boolean)} was called but we're not showing yet, or being dragged. */ public boolean inTransit() { - return mShowingSoon || mExpansion != EXPANSION_HIDDEN; + return mShowingSoon || mExpansion != EXPANSION_HIDDEN && mExpansion != EXPANSION_VISIBLE; } /** diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt index 0aec2b12fa92..832ea9e3d72e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt @@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone import android.content.Context import android.content.pm.PackageManager import android.hardware.biometrics.BiometricSourceType -import android.hardware.face.FaceManager import android.provider.Settings import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.statusbar.NotificationLockscreenUserManager @@ -34,6 +33,7 @@ class KeyguardBypassController { private val unlockMethodCache: UnlockMethodCache private val statusBarStateController: StatusBarStateController + private var hasFaceFeature: Boolean /** * The pending unlock type which is set if the bypass was blocked when it happened. @@ -47,7 +47,7 @@ class KeyguardBypassController { * If face unlock dismisses the lock screen or keeps user on keyguard for the current user. */ var bypassEnabled: Boolean = false - get() = field && unlockMethodCache.isUnlockingWithFacePossible + get() = field && unlockMethodCache.isFaceAuthEnabled private set var bouncerShowing: Boolean = false @@ -71,11 +71,8 @@ class KeyguardBypassController { unlockMethodCache = UnlockMethodCache.getInstance(context) this.statusBarStateController = statusBarStateController - if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE)) { - return - } - val faceManager = context.getSystemService(FaceManager::class.java) - if (faceManager?.isHardwareDetected != true) { + hasFaceFeature = context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_FACE) + if (!hasFaceFeature) { return } @@ -165,7 +162,7 @@ class KeyguardBypassController { pw.print(" isPulseExpanding: "); pw.println(isPulseExpanding) pw.print(" launchingAffordance: "); pw.println(launchingAffordance) pw.print(" qSExpanded: "); pw.println(qSExpanded) - pw.print(" bouncerShowing: "); pw.println(bouncerShowing) + pw.print(" hasFaceFeature: "); pw.println(hasFaceFeature) } companion object { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java index 1360a084207b..06a2225ed0bf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java @@ -217,7 +217,7 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange mConfigurationController.removeCallback(this); mKeyguardUpdateMonitor.removeCallback(mUpdateMonitorCallback); mKeyguardMonitor.removeCallback(mKeyguardMonitorCallback); - mWakeUpCoordinator.removeFullyHiddenChangedListener(this); + mWakeUpCoordinator.removeListener(this); mUnlockMethodCache.removeListener(this); if (mDockManager != null) { mDockManager.removeListener(mDockEventListener); @@ -323,14 +323,24 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange } updateDarkTint(); + updateIconVisibility(); + updateClickability(); + + return true; + } + + /** + * Update the icon visibility + * @return true if the visibility changed + */ + private boolean updateIconVisibility() { boolean onAodNotPulsingOrDocked = mDozing && (!mPulsing || mDocked); boolean invisible = onAodNotPulsingOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance; if (mBypassController.getBypassEnabled() && !mBouncerShowingScrimmed) { - if (mHeadsUpManager.isHeadsUpGoingAway() - || mHeadsUpManager.hasPinnedHeadsUp() - || (mStatusBarStateController.getState() == StatusBarState.KEYGUARD - && !mWakeUpCoordinator.getNotificationsFullyHidden())) { + if ((mHeadsUpManager.isHeadsUpGoingAway() || mHeadsUpManager.hasPinnedHeadsUp() + || mStatusBarStateController.getState() == StatusBarState.KEYGUARD) + && !mWakeUpCoordinator.getNotificationsFullyHidden()) { invisible = true; } } @@ -349,10 +359,9 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange .setDuration(233) .start(); } + return true; } - updateClickability(); - - return true; + return false; } private boolean canBlockUpdates() { @@ -440,7 +449,10 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange @Override public void onFullyHiddenChanged(boolean isFullyHidden) { if (mBypassController.getBypassEnabled()) { - update(); + boolean changed = updateIconVisibility(); + if (changed) { + update(); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java index c0a1b123fe77..1d4d0bd17f01 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java @@ -103,10 +103,11 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener final boolean userSwitcherEnabled = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.USER_SWITCHER_ENABLED, 0) != 0; - if (!UserManager.supportsMultipleUsers() - || mUserManager.hasUserRestriction(UserManager.DISALLOW_USER_SWITCH) + // TODO(b/138661450) Move IPC calls to background + if (!userSwitcherEnabled + || !UserManager.supportsMultipleUsers() || UserManager.isDeviceInDemoMode(mContext) - || !userSwitcherEnabled) { + || mUserManager.hasUserRestriction(UserManager.DISALLOW_USER_SWITCH)) { return false; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 22e3edb2bbd8..6bfa048eb63d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -21,7 +21,9 @@ import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SEARCH_DISABLED; import static com.android.systemui.shared.system.QuickStepContract.isGesturalMode; import static com.android.systemui.statusbar.phone.BarTransitions.MODE_OPAQUE; @@ -321,7 +323,7 @@ public class NavigationBarView extends FrameLayout implements public void setComponents(NotificationPanelView panel, AssistManager assistManager) { mPanelView = panel; - updateSystemUiStateFlags(); + updatePanelSystemUiStateFlags(); } @Override @@ -585,7 +587,7 @@ public class NavigationBarView extends FrameLayout implements updateNavButtonIcons(); updateSlippery(); setUpSwipeUpOnboarding(isQuickStepSwipeUpEnabled()); - updateSystemUiStateFlags(); + updateDisabledSystemUiStateFlags(); } public void updateNavButtonIcons() { @@ -706,12 +708,12 @@ public class NavigationBarView extends FrameLayout implements } } - public void onPanelExpandedChange() { + public void onStatusBarPanelStateChanged() { updateSlippery(); - updateSystemUiStateFlags(); + updatePanelSystemUiStateFlags(); } - public void updateSystemUiStateFlags() { + public void updateDisabledSystemUiStateFlags() { int displayId = mContext.getDisplayId(); mOverviewProxyService.setSystemUiStateFlag(SYSUI_STATE_SCREEN_PINNING, ActivityManagerWrapper.getInstance().isScreenPinningActive(), displayId); @@ -719,9 +721,17 @@ public class NavigationBarView extends FrameLayout implements (mDisabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0, displayId); mOverviewProxyService.setSystemUiStateFlag(SYSUI_STATE_HOME_DISABLED, (mDisabledFlags & View.STATUS_BAR_DISABLE_HOME) != 0, displayId); + mOverviewProxyService.setSystemUiStateFlag(SYSUI_STATE_SEARCH_DISABLED, + (mDisabledFlags & View.STATUS_BAR_DISABLE_SEARCH) != 0, displayId); + } + + public void updatePanelSystemUiStateFlags() { + int displayId = mContext.getDisplayId(); if (mPanelView != null) { mOverviewProxyService.setSystemUiStateFlag(SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED, mPanelView.isFullyExpanded() && !mPanelView.isInSettings(), displayId); + mOverviewProxyService.setSystemUiStateFlag(SYSUI_STATE_QUICK_SETTINGS_EXPANDED, + mPanelView.isInSettings(), displayId); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationHandle.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationHandle.java index 0fe12943614c..4f7af58094ec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationHandle.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationHandle.java @@ -53,8 +53,8 @@ public class NavigationHandle extends View implements ButtonInterface { final int dualToneLightTheme = Utils.getThemeAttr(context, R.attr.lightIconTheme); Context lightContext = new ContextThemeWrapper(context, dualToneLightTheme); Context darkContext = new ContextThemeWrapper(context, dualToneDarkTheme); - mLightColor = Utils.getColorAttrDefaultColor(lightContext, R.attr.singleToneColor); - mDarkColor = Utils.getColorAttrDefaultColor(darkContext, R.attr.singleToneColor); + mLightColor = Utils.getColorAttrDefaultColor(lightContext, R.attr.homeHandleColor); + mDarkColor = Utils.getColorAttrDefaultColor(darkContext, R.attr.homeHandleColor); mPaint.setAntiAlias(true); setFocusable(false); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java index 64fef55a21d3..1df9411019d2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationModeController.java @@ -32,8 +32,6 @@ import static com.android.systemui.shared.system.QuickStepContract.ACTION_ENABLE import static com.android.systemui.shared.system.QuickStepContract.ACTION_ENABLE_GESTURE_NAV_RESULT; import static com.android.systemui.shared.system.QuickStepContract.EXTRA_RESULT_INTENT; -import android.app.Notification; -import android.app.NotificationManager; import android.app.PendingIntent; import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; @@ -42,7 +40,6 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.om.IOverlayManager; -import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.res.ApkAssets; import android.os.PatternMatcher; @@ -52,16 +49,13 @@ import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import android.provider.Settings.Secure; -import android.text.TextUtils; import android.util.Log; import android.util.SparseBooleanArray; import com.android.systemui.Dumpable; -import com.android.systemui.R; import com.android.systemui.UiOffloadThread; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.statusbar.policy.DeviceProvisionedController; -import com.android.systemui.util.NotificationChannels; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -80,11 +74,6 @@ public class NavigationModeController implements Dumpable { private static final String TAG = NavigationModeController.class.getSimpleName(); private static final boolean DEBUG = false; - private static final int SYSTEM_APP_MASK = - ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP; - static final String SHARED_PREFERENCES_NAME = "navigation_mode_controller_preferences"; - static final String PREFS_SWITCHED_FROM_GESTURE_NAV_KEY = "switched_from_gesture_nav"; - public interface ModeChangedListener { void onNavigationModeChanged(int mode); } @@ -100,8 +89,6 @@ public class NavigationModeController implements Dumpable { private int mMode = NAV_BAR_MODE_3BUTTON; private ArrayList<ModeChangedListener> mListeners = new ArrayList<>(); - private String mLastDefaultLauncher; - private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -112,18 +99,6 @@ public class NavigationModeController implements Dumpable { } updateCurrentInteractionMode(true /* notify */); break; - case ACTION_PREFERRED_ACTIVITY_CHANGED: - if (DEBUG) { - Log.d(TAG, "ACTION_PREFERRED_ACTIVITY_CHANGED"); - } - final String launcher = getDefaultLauncherPackageName(mCurrentUserContext); - // Check if it is a default launcher change - if (!TextUtils.equals(mLastDefaultLauncher, launcher)) { - switchFromGestureNavModeIfNotSupportedByDefaultLauncher(); - showNotificationIfDefaultLauncherSupportsGestureNav(); - mLastDefaultLauncher = launcher; - } - break; } } }; @@ -159,7 +134,6 @@ public class NavigationModeController implements Dumpable { // Update the nav mode for the current user updateCurrentInteractionMode(true /* notify */); - switchFromGestureNavModeIfNotSupportedByDefaultLauncher(); // When switching users, defer enabling the gestural nav overlay until the user // is all set up @@ -190,11 +164,7 @@ public class NavigationModeController implements Dumpable { mContext.registerReceiverAsUser(mReceiver, UserHandle.ALL, preferredActivityFilter, null, null); - // We are only interested in launcher changes, so keeping track of the current default. - mLastDefaultLauncher = getDefaultLauncherPackageName(mContext); - updateCurrentInteractionMode(false /* notify */); - switchFromGestureNavModeIfNotSupportedByDefaultLauncher(); // Check if we need to defer enabling gestural nav deferGesturalNavOverlayIfNecessary(); @@ -216,21 +186,13 @@ public class NavigationModeController implements Dumpable { // Already in gesture mode return true; } - final Boolean supported = isGestureNavSupportedByDefaultLauncher(mCurrentUserContext); - if (supported == null || supported) { - Log.d(TAG, "Switching system navigation to full-gesture mode:" - + " defaultLauncher=" - + getDefaultLauncherPackageName(mCurrentUserContext) - + " contextUser=" - + mCurrentUserContext.getUserId()); - - setModeOverlay(NAV_BAR_MODE_GESTURAL_OVERLAY, USER_CURRENT); - return true; - } else { - Log.e(TAG, "Gesture nav is not supported for defaultLauncher=" - + getDefaultLauncherPackageName(mCurrentUserContext)); - return false; - } + + Log.d(TAG, "Switching system navigation to full-gesture mode:" + + " contextUser=" + + mCurrentUserContext.getUserId()); + + setModeOverlay(NAV_BAR_MODE_GESTURAL_OVERLAY, USER_CURRENT); + return true; } private boolean enableGestureNav(Intent intent) { @@ -430,100 +392,6 @@ public class NavigationModeController implements Dumpable { }); } - private void switchFromGestureNavModeIfNotSupportedByDefaultLauncher() { - if (getCurrentInteractionMode(mCurrentUserContext) != NAV_BAR_MODE_GESTURAL) { - return; - } - final Boolean supported = isGestureNavSupportedByDefaultLauncher(mCurrentUserContext); - if (supported == null || supported) { - return; - } - - Log.d(TAG, "Switching system navigation to 3-button mode:" - + " defaultLauncher=" + getDefaultLauncherPackageName(mCurrentUserContext) - + " contextUser=" + mCurrentUserContext.getUserId()); - - setModeOverlay(NAV_BAR_MODE_3BUTTON_OVERLAY, USER_CURRENT); - showNotification(mCurrentUserContext, R.string.notification_content_system_nav_changed); - mCurrentUserContext.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE) - .edit().putBoolean(PREFS_SWITCHED_FROM_GESTURE_NAV_KEY, true).apply(); - } - - private void showNotificationIfDefaultLauncherSupportsGestureNav() { - boolean previouslySwitchedFromGestureNav = mCurrentUserContext - .getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE) - .getBoolean(PREFS_SWITCHED_FROM_GESTURE_NAV_KEY, false); - if (!previouslySwitchedFromGestureNav) { - return; - } - if (getCurrentInteractionMode(mCurrentUserContext) == NAV_BAR_MODE_GESTURAL) { - return; - } - final Boolean supported = isGestureNavSupportedByDefaultLauncher(mCurrentUserContext); - if (supported == null || !supported) { - return; - } - - showNotification(mCurrentUserContext, R.string.notification_content_gesture_nav_available); - mCurrentUserContext.getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE) - .edit().putBoolean(PREFS_SWITCHED_FROM_GESTURE_NAV_KEY, false).apply(); - } - - /** - * Returns null if there is no default launcher set for the current user. Returns true if the - * current default launcher supports Gesture Navigation. Returns false otherwise. - */ - private Boolean isGestureNavSupportedByDefaultLauncher(Context context) { - final String defaultLauncherPackageName = getDefaultLauncherPackageName(context); - if (DEBUG) { - Log.d(TAG, "isGestureNavSupportedByDefaultLauncher:" - + " defaultLauncher=" + defaultLauncherPackageName - + " contextUser=" + context.getUserId()); - } - if (defaultLauncherPackageName == null) { - return null; - } - if (isSystemApp(context, defaultLauncherPackageName)) { - return true; - } - return false; - } - - private String getDefaultLauncherPackageName(Context context) { - final ComponentName cn = context.getPackageManager().getHomeActivities(new ArrayList<>()); - if (cn == null) { - return null; - } - return cn.getPackageName(); - } - - /** Returns true if the app for the given package name is a system app for this device */ - private boolean isSystemApp(Context context, String packageName) { - try { - ApplicationInfo ai = context.getPackageManager().getApplicationInfo(packageName, - PackageManager.GET_META_DATA); - return ai != null && ((ai.flags & SYSTEM_APP_MASK) != 0); - } catch (PackageManager.NameNotFoundException e) { - return false; - } - } - - private void showNotification(Context context, int resId) { - final CharSequence message = context.getResources().getString(resId); - if (DEBUG) { - Log.d(TAG, "showNotification: message=" + message); - } - - final Notification.Builder builder = - new Notification.Builder(mContext, NotificationChannels.ALERTS) - .setContentText(message) - .setStyle(new Notification.BigTextStyle()) - .setSmallIcon(R.drawable.ic_info) - .setAutoCancel(true) - .setContentIntent(PendingIntent.getActivity(context, 0, new Intent(), 0)); - context.getSystemService(NotificationManager.class).notify(TAG, 0, builder.build()); - } - @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("NavigationModeController:"); @@ -536,12 +404,6 @@ public class NavigationModeController implements Dumpable { } pw.println(" defaultOverlays=" + defaultOverlays); dumpAssetPaths(mCurrentUserContext); - - pw.println(" defaultLauncher=" + mLastDefaultLauncher); - boolean previouslySwitchedFromGestureNav = mCurrentUserContext - .getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE) - .getBoolean(PREFS_SWITCHED_FROM_GESTURE_NAV_KEY, false); - pw.println(" previouslySwitchedFromGestureNav=" + previouslySwitchedFromGestureNav); } private void dumpAssetPaths(Context context) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java index d2159ca15b24..ba3406999388 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java @@ -4,7 +4,6 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Rect; -import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -32,7 +31,6 @@ import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; -import com.android.systemui.tuner.TunerService; import java.util.ArrayList; import java.util.Objects; @@ -58,7 +56,6 @@ public class NotificationIconAreaController implements DarkReceiver, private final KeyguardBypassController mBypassController; private final DozeParameters mDozeParameters; - private boolean mShowSilentOnLockscreen = true; private int mIconSize; private int mIconHPadding; private int mIconTint = Color.WHITE; @@ -81,6 +78,7 @@ public class NotificationIconAreaController implements DarkReceiver, private int mAodIconTint; private boolean mFullyHidden; private boolean mAodIconsVisible; + private boolean mIsPulsing; public NotificationIconAreaController(Context context, StatusBar statusBar, StatusBarStateController statusBarStateController, @@ -101,11 +99,6 @@ public class NotificationIconAreaController implements DarkReceiver, initializeNotificationAreaViews(context); reloadAodColor(); - - TunerService tunerService = Dependency.get(TunerService.class); - tunerService.addTunable((key, newValue) -> { - mShowSilentOnLockscreen = "1".equals(newValue); - }, Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS); } protected View inflateIconArea(LayoutInflater inflater) { @@ -238,7 +231,7 @@ public class NotificationIconAreaController implements DarkReceiver, } protected boolean shouldShowNotificationIcon(NotificationEntry entry, - boolean showAmbient, boolean showLowPriority, boolean hideDismissed, + boolean showAmbient, boolean hideDismissed, boolean hideRepliedMessages, boolean hideCurrentMedia, boolean hideCenteredIcon, boolean hidePulsing, boolean onlyShowCenteredIcon) { @@ -257,9 +250,6 @@ public class NotificationIconAreaController implements DarkReceiver, if (hideCurrentMedia && entry.key.equals(mMediaManager.getMediaNotificationKey())) { return false; } - if (!showLowPriority && !entry.isHighPriority()) { - return false; - } if (!entry.isTopLevelChild()) { return false; } @@ -276,7 +266,9 @@ public class NotificationIconAreaController implements DarkReceiver, if (!showAmbient && entry.shouldSuppressStatusBar()) { return false; } - if (hidePulsing && entry.showingPulsing()) { + if (hidePulsing && entry.showingPulsing() + && (!mWakeUpCoordinator.getNotificationsFullyHidden() + || !entry.isPulseSuppressed())) { return false; } return true; @@ -297,7 +289,6 @@ public class NotificationIconAreaController implements DarkReceiver, private void updateShelfIcons() { updateIconsForLayout(entry -> entry.expandedIcon, mShelfIcons, true /* showAmbient */, - true /* showLowPriority */, false /* hideDismissed */, false /* hideRepliedMessages */, false /* hideCurrentMedia */, @@ -309,7 +300,6 @@ public class NotificationIconAreaController implements DarkReceiver, public void updateStatusBarIcons() { updateIconsForLayout(entry -> entry.icon, mNotificationIcons, false /* showAmbient */, - true /* showLowPriority */, true /* hideDismissed */, true /* hideRepliedMessages */, false /* hideCurrentMedia */, @@ -321,7 +311,6 @@ public class NotificationIconAreaController implements DarkReceiver, private void updateCenterIcon() { updateIconsForLayout(entry -> entry.centeredIcon, mCenteredIcon, false /* showAmbient */, - true /* showLowPriority */, false /* hideDismissed */, false /* hideRepliedMessages */, false /* hideCurrentMedia */, @@ -333,7 +322,6 @@ public class NotificationIconAreaController implements DarkReceiver, public void updateAodNotificationIcons() { updateIconsForLayout(entry -> entry.aodIcon, mAodIcons, false /* showAmbient */, - mShowSilentOnLockscreen /* showLowPriority */, true /* hideDismissed */, true /* hideRepliedMessages */, true /* hideCurrentMedia */, @@ -353,7 +341,7 @@ public class NotificationIconAreaController implements DarkReceiver, * @param hidePulsing should pulsing notifications be hidden */ private void updateIconsForLayout(Function<NotificationEntry, StatusBarIconView> function, - NotificationIconContainer hostLayout, boolean showAmbient, boolean showLowPriority, + NotificationIconContainer hostLayout, boolean showAmbient, boolean hideDismissed, boolean hideRepliedMessages, boolean hideCurrentMedia, boolean hideCenteredIcon, boolean hidePulsing, boolean onlyShowCenteredIcon) { ArrayList<StatusBarIconView> toShow = new ArrayList<>( @@ -364,7 +352,7 @@ public class NotificationIconAreaController implements DarkReceiver, View view = mNotificationScrollLayout.getChildAt(i); if (view instanceof ExpandableNotificationRow) { NotificationEntry ent = ((ExpandableNotificationRow) view).getEntry(); - if (shouldShowNotificationIcon(ent, showAmbient, showLowPriority, hideDismissed, + if (shouldShowNotificationIcon(ent, showAmbient, hideDismissed, hideRepliedMessages, hideCurrentMedia, hideCenteredIcon, hidePulsing, onlyShowCenteredIcon)) { StatusBarIconView iconView = function.apply(ent); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 37855ae592a5..a0847b62eddb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -40,6 +40,7 @@ import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.Region; import android.os.PowerManager; +import android.os.SystemClock; import android.util.AttributeSet; import android.util.Log; import android.util.MathUtils; @@ -140,6 +141,12 @@ public class NotificationPanelView extends PanelView implements private static final int CAP_HEIGHT = 1456; private static final int FONT_HEIGHT = 2163; + /** + * Maximum time before which we will expand the panel even for slow motions when getting a + * touch passed over from launcher. + */ + private static final int MAX_TIME_TO_OPEN_WHEN_FLINGING_FROM_LAUNCHER = 300; + static final String COUNTER_PANEL_OPEN = "panel_open"; static final String COUNTER_PANEL_OPEN_QS = "panel_open_qs"; private static final String COUNTER_PANEL_OPEN_PEEK = "panel_open_peek"; @@ -375,6 +382,8 @@ public class NotificationPanelView extends PanelView implements private boolean mHeadsUpPinnedMode; private float mKeyguardHeadsUpShowingAmount = 0.0f; private boolean mShowingKeyguardHeadsUp; + private boolean mAllowExpandForSmallExpansion; + private Runnable mExpandAfterLayoutRunnable; @Inject public NotificationPanelView(@Named(VIEW_CONTEXT) Context context, AttributeSet attrs, @@ -454,6 +463,11 @@ public class NotificationPanelView extends PanelView implements mPulseExpansionHandler.setUp(mNotificationStackScroller, this, mShadeController); mWakeUpCoordinator.addListener(new NotificationWakeUpCoordinator.WakeUpListener() { @Override + public void onFullyHiddenChanged(boolean isFullyHidden) { + updateKeyguardStatusBarForHeadsUp(); + } + + @Override public void onPulseExpansionChanged(boolean expandingChanged) { if (mKeyguardBypassController.getBypassEnabled()) { // Position the notifications while dragging down while pulsing @@ -666,6 +680,10 @@ public class NotificationPanelView extends PanelView implements } updateMaxHeadsUpTranslation(); updateGestureExclusionRect(); + if (mExpandAfterLayoutRunnable != null) { + mExpandAfterLayoutRunnable.run(); + mExpandAfterLayoutRunnable = null; + } } private void updateGestureExclusionRect() { @@ -803,8 +821,7 @@ public class NotificationPanelView extends PanelView implements if (suppressedSummary) { continue; } - if (!mLockscreenUserManager.shouldShowOnKeyguard( - row.getStatusBarNotification())) { + if (!mLockscreenUserManager.shouldShowOnKeyguard(row.getEntry())) { continue; } if (row.isRemoved()) { @@ -1065,6 +1082,8 @@ public class NotificationPanelView extends PanelView implements mDownY = event.getY(); mCollapsedOnDown = isFullyCollapsed(); mListenForHeadsUp = mCollapsedOnDown && mHeadsUpManager.hasPinnedHeadsUp(); + mAllowExpandForSmallExpansion = mExpectingSynthesizedDown; + mTouchSlopExceededBeforeDown = mExpectingSynthesizedDown; if (mExpectingSynthesizedDown) { mLastEventSynthesizedDown = true; } else { @@ -1123,6 +1142,20 @@ public class NotificationPanelView extends PanelView implements } @Override + protected boolean shouldExpandWhenNotFlinging() { + if (super.shouldExpandWhenNotFlinging()) { + return true; + } + if (mAllowExpandForSmallExpansion) { + // When we get a touch that came over from launcher, the velocity isn't always correct + // Let's err on expanding if the gesture has been reasonably slow + long timeSinceDown = SystemClock.uptimeMillis() - mDownTime; + return timeSinceDown <= MAX_TIME_TO_OPEN_WHEN_FLINGING_FROM_LAUNCHER; + } + return false; + } + + @Override protected float getOpeningHeight() { return mNotificationStackScroller.getOpeningHeight(); } @@ -1278,6 +1311,7 @@ public class NotificationPanelView extends PanelView implements } mExpectingSynthesizedDown = true; onTrackingStarted(); + updatePanelExpanded(); } /** @@ -1294,10 +1328,19 @@ public class NotificationPanelView extends PanelView implements * * @param velocity unit is in px / millis */ - public void stopWaitingForOpenPanelGesture(float velocity) { + public void stopWaitingForOpenPanelGesture(final float velocity) { if (mExpectingSynthesizedDown) { mExpectingSynthesizedDown = false; - fling(velocity > 1f ? 1000f * velocity : 0, true /* animate */); + maybeVibrateOnOpening(); + Runnable runnable = () -> fling(velocity > 1f ? 1000f * velocity : 0, + true /* expand */); + if (mStatusBar.getStatusBarWindow().getHeight() + != mStatusBar.getStatusBarHeight()) { + // The panel is already expanded to its full size, let's expand directly + runnable.run(); + } else { + mExpandAfterLayoutRunnable = runnable; + } onTrackingStopped(false); } } @@ -1560,9 +1603,15 @@ public class NotificationPanelView extends PanelView implements anim.setStartDelay(mKeyguardMonitor.isKeyguardFadingAway() ? mKeyguardMonitor.getKeyguardFadingAwayDelay() : 0); - anim.setDuration(mKeyguardMonitor.isKeyguardFadingAway() - ? mKeyguardMonitor.getKeyguardFadingAwayDuration() / 2 - : StackStateAnimator.ANIMATION_DURATION_STANDARD); + + long duration; + if (mKeyguardMonitor.isKeyguardFadingAway()) { + duration = mKeyguardMonitor.getShortenedFadingAwayDuration(); + } else { + duration = StackStateAnimator.ANIMATION_DURATION_STANDARD; + } + anim.setDuration(duration); + anim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN); anim.addListener(new AnimatorListenerAdapter() { @Override @@ -1605,7 +1654,7 @@ public class NotificationPanelView extends PanelView implements mKeyguardBottomArea.animate() .alpha(0f) .setStartDelay(mKeyguardMonitor.getKeyguardFadingAwayDelay()) - .setDuration(mKeyguardMonitor.getKeyguardFadingAwayDuration() / 2) + .setDuration(mKeyguardMonitor.getShortenedFadingAwayDuration()) .setInterpolator(Interpolators.ALPHA_OUT) .withEndAction(mAnimateKeyguardBottomAreaInvisibleEndRunnable) .start(); @@ -1634,7 +1683,7 @@ public class NotificationPanelView extends PanelView implements if (keyguardFadingAway) { mKeyguardStatusView.animate() .setStartDelay(mKeyguardMonitor.getKeyguardFadingAwayDelay()) - .setDuration(mKeyguardMonitor.getKeyguardFadingAwayDuration() / 2) + .setDuration(mKeyguardMonitor.getShortenedFadingAwayDuration()) .start(); } } else if (mBarState == StatusBarState.SHADE_LOCKED @@ -1717,8 +1766,8 @@ public class NotificationPanelView extends PanelView implements mStatusBar.executeRunnableDismissingKeyguard(null, null /* cancelAction */, false /* dismissShade */, true /* afterKeyguardGone */, false /* deferred */); } - if (mExpansionListener != null) { - mExpansionListener.onQsExpansionChanged(mQsMaxExpansionHeight != 0 + for (int i = 0; i < mExpansionListeners.size(); i++) { + mExpansionListeners.get(i).onQsExpansionChanged(mQsMaxExpansionHeight != 0 ? mQsExpansionHeight / mQsMaxExpansionHeight : 0); } if (DEBUG) { @@ -1918,7 +1967,8 @@ public class NotificationPanelView extends PanelView implements * @return Whether we should intercept a gesture to open Quick Settings. */ private boolean shouldQuickSettingsIntercept(float x, float y, float yDiff) { - if (!mQsExpansionEnabled || mCollapsedOnDown) { + if (!mQsExpansionEnabled || mCollapsedOnDown + || (mKeyguardShowing && mKeyguardBypassController.getBypassEnabled())) { return false; } View header = mKeyguardShowing || mQs == null ? mKeyguardStatusBar : mQs.getHeader(); @@ -2029,7 +2079,7 @@ public class NotificationPanelView extends PanelView implements } private void updatePanelExpanded() { - boolean isExpanded = !isFullyCollapsed(); + boolean isExpanded = !isFullyCollapsed() || mExpectingSynthesizedDown; if (mPanelExpanded != isExpanded) { mHeadsUpManager.setIsPanelExpanded(isExpanded); mStatusBar.setPanelExpanded(isExpanded); @@ -3374,24 +3424,4 @@ public class NotificationPanelView extends PanelView implements mOnReinflationListener = onReinflationListener; } - /** - * Panel and QS expansion callbacks. - */ - public interface PanelExpansionListener { - /** - * Invoked whenever the notification panel expansion changes, at every animation frame. - * This is the main expansion that happens when the user is swiping up to dismiss the - * lock screen. - * - * @param expansion 0 when collapsed, 1 when expanded. - * @param tracking {@code true} when the user is actively dragging the panel. - */ - void onPanelExpansionChanged(float expansion, boolean tracking); - - /** - * Invoked whenever the QS expansion changes, at every animation frame. - * @param expansion 0 when collapsed, 1 when expanded. - */ - void onQsExpansionChanged(float expansion); - } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelExpansionListener.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelExpansionListener.java new file mode 100644 index 000000000000..655a25d22337 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelExpansionListener.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2019 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.systemui.statusbar.phone; + +/** + * Panel and QS expansion callbacks. + */ +public interface PanelExpansionListener { + /** + * Invoked whenever the notification panel expansion changes, at every animation frame. + * This is the main expansion that happens when the user is swiping up to dismiss the + * lock screen. + * + * @param expansion 0 when collapsed, 1 when expanded. + * @param tracking {@code true} when the user is actively dragging the panel. + */ + void onPanelExpansionChanged(float expansion, boolean tracking); + + /** + * Invoked whenever the QS expansion changes, at every animation frame. + * @param expansion 0 when collapsed, 1 when expanded. + */ + default void onQsExpansionChanged(float expansion) {}; +} 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 a5b221bbad8c..f8e1093e210b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -50,11 +50,11 @@ import com.android.systemui.statusbar.FlingAnimationUtils; import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.VibratorHelper; -import com.android.systemui.statusbar.phone.NotificationPanelView.PanelExpansionListener; import com.android.systemui.statusbar.policy.KeyguardMonitor; import java.io.FileDescriptor; import java.io.PrintWriter; +import java.util.ArrayList; public abstract class PanelView extends FrameLayout { public static final boolean DEBUG = PanelBar.DEBUG; @@ -62,14 +62,15 @@ public abstract class PanelView extends FrameLayout { private static final int INITIAL_OPENING_PEEK_DURATION = 200; private static final int PEEK_ANIMATION_DURATION = 360; private static final int NO_FIXED_DURATION = -1; - private long mDownTime; + protected long mDownTime; + protected boolean mTouchSlopExceededBeforeDown; private float mMinExpandHeight; private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private boolean mPanelUpdateWhenAnimatorEnds; private boolean mVibrateOnOpening; protected boolean mLaunchingNotification; private int mFixedDuration = NO_FIXED_DURATION; - protected PanelExpansionListener mExpansionListener; + protected ArrayList<PanelExpansionListener> mExpansionListeners = new ArrayList<>(); private final void logf(String fmt, Object... args) { Log.v(TAG, (mViewName != null ? (mViewName + ": ") : "") + String.format(fmt, args)); @@ -323,7 +324,7 @@ public abstract class PanelView extends FrameLayout { if (!mGestureWaitForTouchSlop || (mHeightAnimator != null && !mHintAnimationRunning) || mPeekAnimator != null) { mTouchSlopExceeded = (mHeightAnimator != null && !mHintAnimationRunning) - || mPeekAnimator != null; + || mPeekAnimator != null || mTouchSlopExceededBeforeDown; cancelHeightAnimator(); cancelPeek(); onTrackingStarted(); @@ -409,9 +410,7 @@ public abstract class PanelView extends FrameLayout { runPeekAnimation(INITIAL_OPENING_PEEK_DURATION, getOpeningHeight(), false /* collapseWhenFinished */); notifyBarPanelExpansionChanged(); - if (mVibrateOnOpening) { - mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK); - } + maybeVibrateOnOpening(); //TODO: keyguard opens QS a different way; log that too? @@ -426,6 +425,12 @@ public abstract class PanelView extends FrameLayout { rot); } + protected void maybeVibrateOnOpening() { + if (mVibrateOnOpening) { + mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK); + } + } + protected abstract float getOpeningHeight(); /** @@ -577,7 +582,7 @@ public abstract class PanelView extends FrameLayout { mInitialTouchY = y; mInitialTouchX = x; mTouchStartedInEmptyArea = !isInContentBounds(x, y); - mTouchSlopExceeded = false; + mTouchSlopExceeded = mTouchSlopExceededBeforeDown; mJustPeeked = false; mMotionAborted = false; mPanelClosedOnDown = isFullyCollapsed(); @@ -680,12 +685,16 @@ public abstract class PanelView extends FrameLayout { return true; } if (Math.abs(vectorVel) < mFlingAnimationUtils.getMinVelocityPxPerSecond()) { - return getExpandedFraction() > 0.5f; + return shouldExpandWhenNotFlinging(); } else { return vel > 0; } } + protected boolean shouldExpandWhenNotFlinging() { + return getExpandedFraction() > 0.5f; + } + /** * @param x the final x-coordinate when the finger was lifted * @param y the final y-coordinate when the finger was lifted @@ -1174,13 +1183,13 @@ public abstract class PanelView extends FrameLayout { || mPeekAnimator != null || mInstantExpanding || isPanelVisibleBecauseOfHeadsUp() || mTracking || mHeightAnimator != null); } - if (mExpansionListener != null) { - mExpansionListener.onPanelExpansionChanged(mExpandedFraction, mTracking); + for (int i = 0; i < mExpansionListeners.size(); i++) { + mExpansionListeners.get(i).onPanelExpansionChanged(mExpandedFraction, mTracking); } } - public void setExpansionListener(PanelExpansionListener panelExpansionListener) { - mExpansionListener = panelExpansionListener; + public void addExpansionListener(PanelExpansionListener panelExpansionListener) { + mExpansionListeners.add(panelExpansionListener); } protected abstract boolean isPanelVisibleBecauseOfHeadsUp(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 660810fe7eb9..8efd952e67c5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -46,7 +46,6 @@ import com.android.systemui.R; import com.android.systemui.plugins.DarkIconDispatcher; import com.android.systemui.plugins.DarkIconDispatcher.DarkReceiver; import com.android.systemui.statusbar.CommandQueue; -import com.android.systemui.statusbar.policy.HeadsUpManager; import java.util.Objects; @@ -279,7 +278,7 @@ public class PhoneStatusBarView extends PanelBar { super.panelExpansionChanged(frac, expanded); updateScrimFraction(); if ((frac == 0 || frac == 1) && mBar.getNavigationBarView() != null) { - mBar.getNavigationBarView().onPanelExpandedChange(); + mBar.getNavigationBarView().onStatusBarPanelStateChanged(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 1aec5e4d0b1d..b12bf5c39970 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -491,8 +491,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo * away once the display turns on. */ public void prepareForGentleWakeUp() { - if (mState == ScrimState.AOD && mDozeParameters.getAlwaysOn()) { + if (mState == ScrimState.AOD) { mCurrentInFrontAlpha = 1f; + mCurrentInFrontTint = Color.BLACK; + mCurrentBehindTint = Color.BLACK; mAnimateChange = false; updateScrims(); mAnimateChange = true; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java index 763e0d70469b..c706062d3bb3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java @@ -129,7 +129,10 @@ public enum ScrimState { public void prepare(ScrimState previousState) { mCurrentInFrontAlpha = 0f; mCurrentBehindTint = Color.BLACK; + mCurrentInFrontTint = Color.BLACK; mBlankScreen = mDisplayRequiresBlanking; + mAnimationDuration = mWakeLockScreenSensorActive + ? ScrimController.ANIMATION_DURATION_LONG : ScrimController.ANIMATION_DURATION; } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index d93dc950a077..c943a04c0f2a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -194,6 +194,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.VibratorHelper; import com.android.systemui.statusbar.notification.ActivityLaunchAnimator; import com.android.systemui.statusbar.notification.BypassHeadsUpNotifier; +import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationActivityStarter; import com.android.systemui.statusbar.notification.NotificationAlertingManager; import com.android.systemui.statusbar.notification.NotificationClicker; @@ -376,6 +377,8 @@ public class StatusBar extends SystemUI implements DemoMode, @Inject protected HeadsUpManagerPhone mHeadsUpManager; @Inject + DynamicPrivacyController mDynamicPrivacyController; + @Inject BypassHeadsUpNotifier mBypassHeadsUpNotifier; @Nullable @Inject @@ -490,9 +493,12 @@ public class StatusBar extends SystemUI implements DemoMode, WallpaperInfo info = wallpaperManager.getWallpaperInfo(UserHandle.USER_CURRENT); final boolean deviceSupportsAodWallpaper = mContext.getResources().getBoolean( com.android.internal.R.bool.config_dozeSupportsAodWallpaper); + final boolean imageWallpaperInAmbient = + !DozeParameters.getInstance(mContext).getDisplayNeedsBlanking(); // If WallpaperInfo is null, it must be ImageWallpaper. final boolean supportsAmbientMode = deviceSupportsAodWallpaper - && (info == null || info.supportsAmbientMode()); + && ((info == null && imageWallpaperInAmbient) + || (info != null && info.supportsAmbientMode())); mStatusBarWindowController.setWallpaperSupportsAmbientMode(supportsAmbientMode); mScrimController.setWallpaperSupportsAmbientMode(supportsAmbientMode); @@ -589,7 +595,7 @@ public class StatusBar extends SystemUI implements DemoMode, private boolean mVibrateOnOpening; private VibratorHelper mVibratorHelper; private ActivityLaunchAnimator mActivityLaunchAnimator; - protected NotificationPresenter mPresenter; + protected StatusBarNotificationPresenter mPresenter; private NotificationActivityStarter mNotificationActivityStarter; private boolean mPulsing; protected BubbleController mBubbleController; @@ -814,6 +820,7 @@ public class StatusBar extends SystemUI implements DemoMode, inflateShelf(); mNotificationIconAreaController.setupShelf(mNotificationShelf); mNotificationPanel.setOnReinflationListener(mNotificationIconAreaController::initAodIcons); + mNotificationPanel.addExpansionListener(mWakeUpCoordinator); Dependency.get(DarkIconDispatcher.class).addDarkReceiver(mNotificationIconAreaController); // Allow plugins to reference DarkIconDispatcher and StatusBarStateController @@ -856,7 +863,8 @@ public class StatusBar extends SystemUI implements DemoMode, } mHeadsUpAppearanceController = new HeadsUpAppearanceController( mNotificationIconAreaController, mHeadsUpManager, mStatusBarWindow, - mStatusBarStateController, mKeyguardBypassController); + mStatusBarStateController, mKeyguardBypassController, + mWakeUpCoordinator); mHeadsUpAppearanceController.readFrom(oldController); mStatusBarWindow.setStatusBarView(mStatusBarView); updateAreThereNotifications(); @@ -1062,7 +1070,7 @@ public class StatusBar extends SystemUI implements DemoMode, mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanel, mHeadsUpManager, mStatusBarWindow, mStackScroller, mDozeScrimController, - mScrimController, mActivityLaunchAnimator, mStatusBarKeyguardViewManager, + mScrimController, mActivityLaunchAnimator, mDynamicPrivacyController, mNotificationAlertingManager, rowBinder); mNotificationListController = @@ -1239,6 +1247,7 @@ public class StatusBar extends SystemUI implements DemoMode, .setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mBiometricUnlockController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mRemoteInputManager.getController().addCallback(mStatusBarKeyguardViewManager); + mDynamicPrivacyController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); mKeyguardViewMediatorCallback = keyguardViewMediator.getViewMediatorCallback(); mLightBarController.setBiometricUnlockController(mBiometricUnlockController); @@ -1508,6 +1517,9 @@ public class StatusBar extends SystemUI implements DemoMode, mNotificationPanel.setStatusAccessibilityImportance(expanded ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS : View.IMPORTANT_FOR_ACCESSIBILITY_AUTO); + if (getNavigationBarView() != null) { + getNavigationBarView().onStatusBarPanelStateChanged(); + } } public boolean isWakeUpComingFromTouch() { @@ -1578,7 +1590,8 @@ public class StatusBar extends SystemUI implements DemoMode, public void onHeadsUpStateChanged(NotificationEntry entry, boolean isHeadsUp) { mEntryManager.updateNotifications(); if (isDozing() && isHeadsUp) { - mDozeServiceHost.fireNotificationPulse(); + entry.setPulseSuppressed(false); + mDozeServiceHost.fireNotificationPulse(entry); if (mPulsing) { mDozeScrimController.cancelPendingPulseTimeout(); } @@ -1802,6 +1815,8 @@ public class StatusBar extends SystemUI implements DemoMode, mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK); } mNotificationPanel.expand(true /* animate */); + ((NotificationListContainer) mStackScroller).setWillExpand(true); + mHeadsUpManager.unpinAll(true /* userUnpinned */); mMetricsLogger.count(NotificationPanelView.COUNTER_PANEL_OPEN, 1); } else if (!mNotificationPanel.isInSettings() && !mNotificationPanel.isExpanding()){ mNotificationPanel.flingSettings(0 /* velocity */, @@ -1939,7 +1954,6 @@ public class StatusBar extends SystemUI implements DemoMode, if (start) { mNotificationPanel.startWaitingForOpenPanelGesture(); - setPanelExpanded(true); } else { mNotificationPanel.stopWaitingForOpenPanelGesture(velocity); } @@ -2388,6 +2402,10 @@ public class StatusBar extends SystemUI implements DemoMode, mLightBarController.dump(fd, pw, args); } + if (mUnlockMethodCache != null) { + mUnlockMethodCache.dump(pw); + } + if (mKeyguardBypassController != null) { mKeyguardBypassController.dump(pw); } @@ -3200,12 +3218,13 @@ public class StatusBar extends SystemUI implements DemoMode, /** * Notifies the status bar the Keyguard is fading away with the specified timings. - * - * @param startTime the start time of the animations in uptime millis + * @param startTime the start time of the animations in uptime millis * @param delay the precalculated animation delay in milliseconds * @param fadeoutDuration the duration of the exit animation, in milliseconds + * @param isBypassFading is this a fading away animation while bypassing */ - public void setKeyguardFadingAway(long startTime, long delay, long fadeoutDuration) { + public void setKeyguardFadingAway(long startTime, long delay, long fadeoutDuration, + boolean isBypassFading) { mCommandQueue.appTransitionStarting(mDisplayId, startTime + fadeoutDuration - LightBarTransitionsController.DEFAULT_TINT_ANIMATION_DURATION, LightBarTransitionsController.DEFAULT_TINT_ANIMATION_DURATION, true); @@ -3213,7 +3232,7 @@ public class StatusBar extends SystemUI implements DemoMode, mCommandQueue.appTransitionStarting(mDisplayId, startTime - LightBarTransitionsController.DEFAULT_TINT_ANIMATION_DURATION, LightBarTransitionsController.DEFAULT_TINT_ANIMATION_DURATION, true); - mKeyguardMonitor.notifyKeyguardFadingAway(delay, fadeoutDuration); + mKeyguardMonitor.notifyKeyguardFadingAway(delay, fadeoutDuration, isBypassFading); } /** @@ -3563,6 +3582,9 @@ public class StatusBar extends SystemUI implements DemoMode, userAllowsPrivateNotificationsInPublic(mLockscreenUserManager.getCurrentUserId()) || !mLockscreenUserManager.shouldShowLockscreenNotifications() || mFalsingManager.shouldEnforceBouncer(); + if (mKeyguardBypassController.getBypassEnabled()) { + fullShadeNeedsBouncer = false; + } if (mLockscreenUserManager.isLockscreenPublicMode(userId) && fullShadeNeedsBouncer) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); showBouncerIfKeyguard(); @@ -3769,7 +3791,8 @@ public class StatusBar extends SystemUI implements DemoMode, return; } if (!mNotificationPanel.canCameraGestureBeLaunched( - mStatusBarKeyguardViewManager.isShowing() && mExpandedVisible)) { + mStatusBarKeyguardViewManager.isShowing() + && (mExpandedVisible || mBouncerShowing))) { if (DEBUG_CAMERA_LIFT) Slog.d(TAG, "Can't launch camera right now, mExpandedVisible: " + mExpandedVisible); return; @@ -3920,9 +3943,13 @@ public class StatusBar extends SystemUI implements DemoMode, } } - public void fireNotificationPulse() { + public void fireNotificationPulse(NotificationEntry entry) { + Runnable pulseSupressedListener = () -> { + entry.setPulseSuppressed(true); + mNotificationIconAreaController.updateAodNotificationIcons(); + }; for (Callback callback : mCallbacks) { - callback.onNotificationAlerted(); + callback.onNotificationAlerted(pulseSupressedListener); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index 1321784c978a..4d85a422d9b9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -69,7 +69,7 @@ import java.util.ArrayList; */ public class StatusBarKeyguardViewManager implements RemoteInputController.Callback, StatusBarStateController.StateListener, ConfigurationController.ConfigurationListener, - NotificationPanelView.PanelExpansionListener, NavigationModeController.ModeChangedListener { + PanelExpansionListener, NavigationModeController.ModeChangedListener { // When hiding the Keyguard with timing supplied from WindowManager, better be early than late. private static final long HIDE_TIMING_CORRECTION_MS = - 16 * 3; @@ -222,7 +222,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb mViewMediatorCallback, mLockPatternUtils, container, dismissCallbackRegistry, mExpansionCallback); mNotificationPanelView = notificationPanelView; - notificationPanelView.setExpansionListener(this); + notificationPanelView.addExpansionListener(this); mBypassController = bypassController; mNotificationContainer = notificationContainer; } @@ -560,18 +560,22 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb executeAfterKeyguardGoneAction(); boolean wakeUnlockPulsing = mBiometricUnlockController.getMode() == MODE_WAKE_AND_UNLOCK_PULSING; - if (wakeUnlockPulsing) { + boolean needsFading = needsBypassFading(); + if (needsFading) { + delay = 0; + fadeoutDuration = KeyguardBypassController.BYPASS_PANEL_FADE_DURATION; + } else if (wakeUnlockPulsing) { delay = 0; fadeoutDuration = 240; } - mStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration); + mStatusBar.setKeyguardFadingAway(startTime, delay, fadeoutDuration, needsFading); mBiometricUnlockController.startKeyguardFadingAway(); hideBouncer(true /* destroyView */); if (wakeUnlockPulsing) { - if (needsBypassFading()) { + if (needsFading) { ViewGroupFadeHelper.fadeOutAllChildrenExcept(mNotificationPanelView, mNotificationContainer, - KeyguardBypassController.BYPASS_PANEL_FADE_DURATION, + fadeoutDuration, () -> { mStatusBar.hideKeyguard(); onKeyguardFadedAway(); @@ -584,10 +588,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide(); if (!staying) { mStatusBarWindowController.setKeyguardFadingAway(true); - if (needsBypassFading()) { + if (needsFading) { ViewGroupFadeHelper.fadeOutAllChildrenExcept(mNotificationPanelView, mNotificationContainer, - KeyguardBypassController.BYPASS_PANEL_FADE_DURATION, + fadeoutDuration, () -> { mStatusBar.hideKeyguard(); }); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java index a87dca45bf75..a870590c08ac 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java @@ -59,6 +59,7 @@ import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.AboveShelfObserver; import com.android.systemui.statusbar.notification.ActivityLaunchAnimator; +import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationAlertingManager; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; @@ -117,9 +118,9 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, private final AccessibilityManager mAccessibilityManager; private final KeyguardManager mKeyguardManager; private final ActivityLaunchAnimator mActivityLaunchAnimator; - private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; private final int mMaxAllowedKeyguardNotifications; private final IStatusBarService mBarService; + private final DynamicPrivacyController mDynamicPrivacyController; private boolean mReinflateNotificationsOnUserSwitched; private boolean mDispatchUiModeChangeOnUserSwitched; private final UnlockMethodCache mUnlockMethodCache; @@ -136,16 +137,16 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, DozeScrimController dozeScrimController, ScrimController scrimController, ActivityLaunchAnimator activityLaunchAnimator, - StatusBarKeyguardViewManager statusBarKeyguardViewManager, + DynamicPrivacyController dynamicPrivacyController, NotificationAlertingManager notificationAlertingManager, NotificationRowBinderImpl notificationRowBinder) { mContext = context; mNotificationPanel = panel; mHeadsUpManager = headsUp; + mDynamicPrivacyController = dynamicPrivacyController; mCommandQueue = getComponent(context, CommandQueue.class); mAboveShelfObserver = new AboveShelfObserver(stackScroller); mActivityLaunchAnimator = activityLaunchAnimator; - mStatusBarKeyguardViewManager = statusBarKeyguardViewManager; mAboveShelfObserver.setListener(statusBarWindow.findViewById( R.id.notification_container_parent)); mAccessibilityManager = context.getSystemService(AccessibilityManager.class); @@ -454,8 +455,15 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, @Override public void onExpandClicked(NotificationEntry clickedEntry, boolean nowExpanded) { mHeadsUpManager.setExpanded(clickedEntry, nowExpanded); - if (mStatusBarStateController.getState() == StatusBarState.KEYGUARD && nowExpanded) { - mShadeController.goToLockedShade(clickedEntry.getRow()); + if (nowExpanded) { + if (mStatusBarStateController.getState() == StatusBarState.KEYGUARD) { + mShadeController.goToLockedShade(clickedEntry.getRow()); + } else if (clickedEntry.isSensitive() + && mDynamicPrivacyController.isInLockedDownShade()) { + mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); + mActivityStarter.dismissKeyguardThenExecute(() -> false /* dismissAction */ + , null /* cancelRunnable */, false /* afterKeyguardGone */); + } } } @@ -464,12 +472,6 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, return mVrMode; } - @Override - public boolean isPresenterLocked() { - return mStatusBarKeyguardViewManager.isShowing() - && mStatusBarKeyguardViewManager.isSecure(); - } - private void onLockedNotificationImportanceChange(OnDismissAction dismissAction) { mStatusBarStateController.setLeaveOpenOnKeyguardHide(true); mActivityStarter.dismissKeyguardThenExecute(dismissAction, null, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java index 4ddd0e9962ad..0ef981bdb3de 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java @@ -29,7 +29,9 @@ import android.graphics.PixelFormat; import android.os.Binder; import android.os.RemoteException; import android.os.SystemProperties; +import android.os.Trace; import android.util.Log; +import android.view.Display; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; @@ -51,12 +53,14 @@ import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; import com.google.android.collect.Lists; + import java.io.FileDescriptor; import java.io.PrintWriter; import java.lang.ref.WeakReference; import java.lang.reflect.Field; - import java.util.ArrayList; +import java.util.Arrays; + import javax.inject.Inject; import javax.inject.Singleton; @@ -72,11 +76,13 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat private final WindowManager mWindowManager; private final IActivityManager mActivityManager; private final DozeParameters mDozeParameters; - private final WindowManager.LayoutParams mLpChanged; + private final LayoutParams mLpChanged; private final boolean mKeyguardScreenRotation; private final long mLockScreenDisplayTimeout; + private final Display.Mode mKeyguardDisplayMode; + private final KeyguardBypassController mKeyguardBypassController; private ViewGroup mStatusBarView; - private WindowManager.LayoutParams mLp; + private LayoutParams mLp; private boolean mHasTopUi; private boolean mHasTopUiChanged; private int mBarHeight; @@ -90,27 +96,49 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat private final SysuiColorExtractor mColorExtractor = Dependency.get(SysuiColorExtractor.class); @Inject - public StatusBarWindowController(Context context) { + public StatusBarWindowController(Context context, + StatusBarStateController statusBarStateController, + ConfigurationController configurationController, + KeyguardBypassController keyguardBypassController) { this(context, context.getSystemService(WindowManager.class), ActivityManager.getService(), - DozeParameters.getInstance(context)); + DozeParameters.getInstance(context), statusBarStateController, + configurationController, keyguardBypassController); } @VisibleForTesting public StatusBarWindowController(Context context, WindowManager windowManager, - IActivityManager activityManager, DozeParameters dozeParameters) { + IActivityManager activityManager, DozeParameters dozeParameters, + StatusBarStateController statusBarStateController, + ConfigurationController configurationController, + KeyguardBypassController keyguardBypassController) { mContext = context; mWindowManager = windowManager; mActivityManager = activityManager; mKeyguardScreenRotation = shouldEnableKeyguardScreenRotation(); mDozeParameters = dozeParameters; mScreenBrightnessDoze = mDozeParameters.getScreenBrightnessDoze(); - mLpChanged = new WindowManager.LayoutParams(); + mLpChanged = new LayoutParams(); + mKeyguardBypassController = keyguardBypassController; mLockScreenDisplayTimeout = context.getResources() .getInteger(R.integer.config_lockScreenDisplayTimeout); - ((SysuiStatusBarStateController) Dependency.get(StatusBarStateController.class)) + ((SysuiStatusBarStateController) statusBarStateController) .addCallback(mStateListener, SysuiStatusBarStateController.RANK_STATUS_BAR_WINDOW_CONTROLLER); - Dependency.get(ConfigurationController.class).addCallback(this); + configurationController.addCallback(this); + + Display.Mode[] supportedModes = context.getDisplay().getSupportedModes(); + Display.Mode currentMode = context.getDisplay().getMode(); + // Running on the highest frame rate available can be expensive. + // Let's specify a preferred refresh rate, and allow higher FPS only when we + // know that we're not falsing (because we unlocked.) + int keyguardRefreshRate = context.getResources() + .getInteger(R.integer.config_keyguardRefreshRate); + // Find supported display mode with the same resolution and requested refresh rate. + mKeyguardDisplayMode = Arrays.stream(supportedModes).filter(mode -> + (int) mode.getRefreshRate() == keyguardRefreshRate + && mode.getPhysicalWidth() == currentMode.getPhysicalWidth() + && mode.getPhysicalHeight() == currentMode.getPhysicalHeight()) + .findFirst().orElse(null); } /** @@ -143,19 +171,19 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat // Now that the status bar window encompasses the sliding panel and its // translucent backdrop, the entire thing is made TRANSLUCENT and is // hardware-accelerated. - mLp = new WindowManager.LayoutParams( + mLp = new LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, barHeight, - WindowManager.LayoutParams.TYPE_STATUS_BAR, - WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE - | WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING - | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH - | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH - | WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, + LayoutParams.TYPE_STATUS_BAR, + LayoutParams.FLAG_NOT_FOCUSABLE + | LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING + | LayoutParams.FLAG_SPLIT_TOUCH + | LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH + | LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, PixelFormat.TRANSLUCENT); mLp.token = new Binder(); mLp.gravity = Gravity.TOP; - mLp.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; + mLp.softInputMode = LayoutParams.SOFT_INPUT_ADJUST_RESIZE; mLp.setTitle("StatusBar"); mLp.packageName = mContext.getPackageName(); mLp.layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; @@ -188,9 +216,9 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat private void applyKeyguardFlags(State state) { if (state.keyguardShowing) { - mLpChanged.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD; + mLpChanged.privateFlags |= LayoutParams.PRIVATE_FLAG_KEYGUARD; } else { - mLpChanged.privateFlags &= ~WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD; + mLpChanged.privateFlags &= ~LayoutParams.PRIVATE_FLAG_KEYGUARD; } final boolean scrimsOccludingWallpaper = @@ -198,9 +226,9 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat final boolean keyguardOrAod = state.keyguardShowing || (state.dozing && mDozeParameters.getAlwaysOn()); if (keyguardOrAod && !state.backdropShowing && !scrimsOccludingWallpaper) { - mLpChanged.flags |= WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; + mLpChanged.flags |= LayoutParams.FLAG_SHOW_WALLPAPER; } else { - mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; + mLpChanged.flags &= ~LayoutParams.FLAG_SHOW_WALLPAPER; } if (state.dozing) { @@ -208,6 +236,18 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat } else { mLpChanged.privateFlags &= ~LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; } + + if (mKeyguardDisplayMode != null) { + boolean bypassOnKeyguard = mKeyguardBypassController.getBypassEnabled() + && state.statusBarState == StatusBarState.KEYGUARD && !state.keyguardFadingAway + && !state.keyguardGoingAway; + if (state.dozing || bypassOnKeyguard) { + mLpChanged.preferredDisplayModeId = mKeyguardDisplayMode.getModeId(); + } else { + mLpChanged.preferredDisplayModeId = 0; + } + Trace.setCounter("display_mode_id", mLpChanged.preferredDisplayModeId); + } } private void adjustScreenOrientation(State state) { @@ -227,17 +267,17 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat if (state.bouncerShowing && (state.keyguardOccluded || state.keyguardNeedsInput) || ENABLE_REMOTE_INPUT && state.remoteInputActive || state.bubbleExpanded) { - mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; - mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + mLpChanged.flags &= ~LayoutParams.FLAG_NOT_FOCUSABLE; + mLpChanged.flags &= ~LayoutParams.FLAG_ALT_FOCUSABLE_IM; } else if (state.isKeyguardShowingAndNotOccluded() || panelFocusable) { - mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; - mLpChanged.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + mLpChanged.flags &= ~LayoutParams.FLAG_NOT_FOCUSABLE; + mLpChanged.flags |= LayoutParams.FLAG_ALT_FOCUSABLE_IM; } else { - mLpChanged.flags |= WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; - mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM; + mLpChanged.flags |= LayoutParams.FLAG_NOT_FOCUSABLE; + mLpChanged.flags &= ~LayoutParams.FLAG_ALT_FOCUSABLE_IM; } - mLpChanged.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; + mLpChanged.softInputMode = LayoutParams.SOFT_INPUT_ADJUST_RESIZE; } private void applyForceShowNavigationFlag(State state) { @@ -295,19 +335,19 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat && state.statusBarState == StatusBarState.KEYGUARD && !state.qsExpanded && !state.forceUserActivity) { mLpChanged.inputFeatures |= - WindowManager.LayoutParams.INPUT_FEATURE_DISABLE_USER_ACTIVITY; + LayoutParams.INPUT_FEATURE_DISABLE_USER_ACTIVITY; } else { mLpChanged.inputFeatures &= - ~WindowManager.LayoutParams.INPUT_FEATURE_DISABLE_USER_ACTIVITY; + ~LayoutParams.INPUT_FEATURE_DISABLE_USER_ACTIVITY; } } private void applyStatusBarColorSpaceAgnosticFlag(State state) { if (!isExpanded(state)) { - mLpChanged.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC; + mLpChanged.privateFlags |= LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC; } else { mLpChanged.privateFlags &= - ~WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC; + ~LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC; } } @@ -352,20 +392,20 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat } private void applyForceStatusBarVisibleFlag(State state) { - if (state.forceStatusBarVisible) { + if (state.forceStatusBarVisible || state.forcePluginOpen) { mLpChanged.privateFlags |= WindowManager .LayoutParams.PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT; } else { - mLpChanged.privateFlags &= ~WindowManager - .LayoutParams.PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT; + mLpChanged.privateFlags + &= ~LayoutParams.PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT; } } private void applyModalFlag(State state) { if (state.headsUpShowing) { - mLpChanged.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; + mLpChanged.flags |= LayoutParams.FLAG_NOT_TOUCH_MODAL; } else { - mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; + mLpChanged.flags &= ~LayoutParams.FLAG_NOT_TOUCH_MODAL; } } @@ -373,12 +413,12 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat if (state.forceDozeBrightness) { mLpChanged.screenBrightness = mScreenBrightnessDoze; } else { - mLpChanged.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE; + mLpChanged.screenBrightness = LayoutParams.BRIGHTNESS_OVERRIDE_NONE; } } private void applyHasTopUi(State state) { - mHasTopUiChanged = isExpanded(state); + mHasTopUiChanged = state.forceHasTopUi || isExpanded(state); } private void applyNotTouchable(State state) { @@ -574,7 +614,8 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { - pw.println("StatusBarWindowController state:"); + pw.println("StatusBarWindowController:"); + pw.println(" mKeyguardDisplayMode=" + mKeyguardDisplayMode); pw.println(mCurrentState); } @@ -593,6 +634,23 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat setKeyguardDark(useDarkText); } + /** + * When keyguard will be dismissed but didn't start animation yet. + */ + public void setKeyguardGoingAway(boolean goingAway) { + mCurrentState.keyguardGoingAway = goingAway; + apply(mCurrentState); + } + + public boolean getForceHasTopUi() { + return mCurrentState.forceHasTopUi; + } + + public void setForceHasTopUi(boolean forceHasTopUi) { + mCurrentState.forceHasTopUi = forceHasTopUi; + apply(mCurrentState); + } + private static class State { boolean keyguardShowing; boolean keyguardOccluded; @@ -602,6 +660,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat boolean statusBarFocusable; boolean bouncerShowing; boolean keyguardFadingAway; + boolean keyguardGoingAway; boolean qsExpanded; boolean headsUpShowing; boolean forceStatusBarVisible; @@ -613,6 +672,7 @@ public class StatusBarWindowController implements Callback, Dumpable, Configurat boolean notTouchable; boolean bubblesShowing; boolean bubbleExpanded; + boolean forceHasTopUi; /** * The {@link StatusBar} state from the status bar. diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index 94054188d769..1081bad9bf1c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -67,6 +67,7 @@ import com.android.systemui.plugins.FalsingManager; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.DragDownHelper; import com.android.systemui.statusbar.StatusBarState; +import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.phone.ScrimController.ScrimVisibility; import com.android.systemui.tuner.TunerService; @@ -417,9 +418,8 @@ public class StatusBarWindowView extends FrameLayout { } boolean intercept = false; if (mNotificationPanel.isFullyExpanded() - && mStatusBarStateController.getState() == StatusBarState.KEYGUARD + && mDragDownHelper.isDragDownEnabled() && !mService.isBouncerShowing() - && !mBypassController.getBypassEnabled() && !mService.isDozing()) { intercept = mDragDownHelper.onInterceptTouchEvent(ev); } @@ -442,9 +442,7 @@ public class StatusBarWindowView extends FrameLayout { if (mService.isDozing()) { handled = !mService.isPulsing(); } - if ((mStatusBarStateController.getState() == StatusBarState.KEYGUARD && !handled - && !mBypassController.getBypassEnabled()) - || mDragDownHelper.isDraggingDown()) { + if ((mDragDownHelper.isDragDownEnabled() && !handled) || mDragDownHelper.isDraggingDown()) { // we still want to finish our drag down gesture when locking the screen handled = mDragDownHelper.onTouchEvent(ev); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java index a71fcdbd9914..b1d6ca6e5580 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockMethodCache.java @@ -28,6 +28,7 @@ import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; +import java.io.PrintWriter; import java.util.ArrayList; /** @@ -51,7 +52,7 @@ public class UnlockMethodCache { private boolean mTrustManaged; private boolean mTrusted; private boolean mDebugUnlocked = false; - private boolean mIsUnlockingWithFacePossible; + private boolean mFaceAuthEnabled; private UnlockMethodCache(Context ctx) { mLockPatternUtils = new LockPatternUtils(ctx); @@ -110,8 +111,8 @@ public class UnlockMethodCache { /** * If there are faces enrolled and user enabled face auth on keyguard. */ - public boolean isUnlockingWithFacePossible() { - return mIsUnlockingWithFacePossible; + public boolean isFaceAuthEnabled() { + return mFaceAuthEnabled; } private void update(boolean updateAlways) { @@ -122,16 +123,16 @@ public class UnlockMethodCache { || (Build.IS_DEBUGGABLE && DEBUG_AUTH_WITH_ADB && mDebugUnlocked); boolean trustManaged = mKeyguardUpdateMonitor.getUserTrustIsManaged(user); boolean trusted = mKeyguardUpdateMonitor.getUserHasTrust(user); - boolean isUnlockingWithFacePossible = mKeyguardUpdateMonitor.isUnlockWithFacePossible(user); + boolean faceAuthEnabled = mKeyguardUpdateMonitor.isFaceAuthEnabledForUser(user); boolean changed = secure != mSecure || canSkipBouncer != mCanSkipBouncer || trustManaged != mTrustManaged - || mIsUnlockingWithFacePossible != isUnlockingWithFacePossible; + || mFaceAuthEnabled != faceAuthEnabled; if (changed || updateAlways) { mSecure = secure; mCanSkipBouncer = canSkipBouncer; mTrusted = trusted; mTrustManaged = trustManaged; - mIsUnlockingWithFacePossible = isUnlockingWithFacePossible; + mFaceAuthEnabled = faceAuthEnabled; notifyListeners(); } Trace.endSection(); @@ -143,6 +144,16 @@ public class UnlockMethodCache { } } + public void dump(PrintWriter pw) { + pw.println("UnlockMethodCache"); + pw.println(" mSecure: " + mSecure); + pw.println(" mCanSkipBouncer: " + mCanSkipBouncer); + pw.println(" mTrustManaged: " + mTrustManaged); + pw.println(" mTrusted: " + mTrusted); + pw.println(" mDebugUnlocked: " + mDebugUnlocked); + pw.println(" mFaceAuthEnabled: " + mFaceAuthEnabled); + } + private final KeyguardUpdateMonitorCallback mCallback = new KeyguardUpdateMonitorCallback() { @Override public void onUserSwitchComplete(int userId) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java index f61b556e22ab..070136ec94c1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitor.java @@ -29,6 +29,19 @@ public interface KeyguardMonitor extends CallbackController<Callback> { long getKeyguardFadingAwayDelay(); long calculateGoingToFullShadeDelay(); + /** + * @return a shortened fading away duration similar to + * {{@link #getKeyguardFadingAwayDuration()}} which may only span half of the duration, unless + * we're bypassing + */ + default long getShortenedFadingAwayDuration() { + if (isBypassFadingAnimation()) { + return getKeyguardFadingAwayDuration(); + } else { + return getKeyguardFadingAwayDuration() / 2; + } + } + default boolean isDeviceInteractive() { return false; } @@ -39,7 +52,21 @@ public interface KeyguardMonitor extends CallbackController<Callback> { default void notifyKeyguardGoingAway(boolean b) { } - default void notifyKeyguardFadingAway(long delay, long fadeoutDuration) { + /** + * @return {@code true} if the current fading away animation is the fast bypass fading. + */ + default boolean isBypassFadingAnimation() { + return false; + } + + /** + * Notifies that the Keyguard is fading away with the specified timings. + * @param delay the precalculated animation delay in milliseconds + * @param fadeoutDuration the duration of the exit animation, in milliseconds + * @param isBypassFading is this a fading away animation while bypassing + */ + default void notifyKeyguardFadingAway(long delay, long fadeoutDuration, + boolean isBypassFading) { } default void notifyKeyguardDoneFading() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitorImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitorImpl.java index 68d00708b0d3..8829be4ee0f8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitorImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardMonitorImpl.java @@ -54,6 +54,7 @@ public class KeyguardMonitorImpl extends KeyguardUpdateMonitorCallback private long mKeyguardFadingAwayDuration; private boolean mKeyguardGoingAway; private boolean mLaunchTransitionFadingAway; + private boolean mBypassFadingAnimation; /** */ @@ -140,10 +141,11 @@ public class KeyguardMonitorImpl extends KeyguardUpdateMonitorCallback new ArrayList<>(mCallbacks).forEach(Callback::onKeyguardShowingChanged); } - public void notifyKeyguardFadingAway(long delay, long fadeoutDuration) { + public void notifyKeyguardFadingAway(long delay, long fadeoutDuration, boolean isBypassFading) { setKeyguardFadingAway(true); mKeyguardFadingAwayDelay = delay; mKeyguardFadingAwayDuration = fadeoutDuration; + mBypassFadingAnimation = isBypassFading; } private void setKeyguardFadingAway(boolean keyguardFadingAway) { @@ -172,6 +174,11 @@ public class KeyguardMonitorImpl extends KeyguardUpdateMonitorCallback } @Override + public boolean isBypassFadingAnimation() { + return mBypassFadingAnimation; + } + + @Override public long getKeyguardFadingAwayDelay() { return mKeyguardFadingAwayDelay; } diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java index 69d2e31135e8..d3862b6eed81 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java @@ -43,6 +43,7 @@ import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; +import android.os.UserHandle; import android.os.VibrationEffect; import android.os.Vibrator; import android.provider.Settings; @@ -272,14 +273,14 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa } public boolean areCaptionsEnabled() { - int currentValue = Settings.Secure.getInt(mContext.getContentResolver(), - Settings.Secure.ODI_CAPTIONS_ENABLED, 0); + int currentValue = Settings.Secure.getIntForUser(mContext.getContentResolver(), + Settings.Secure.ODI_CAPTIONS_ENABLED, 0, UserHandle.USER_CURRENT); return currentValue == 1; } public void setCaptionsEnabled(boolean isEnabled) { - Settings.Secure.putInt(mContext.getContentResolver(), - Settings.Secure.ODI_CAPTIONS_ENABLED, isEnabled ? 1 : 0); + Settings.Secure.putIntForUser(mContext.getContentResolver(), + Settings.Secure.ODI_CAPTIONS_ENABLED, isEnabled ? 1 : 0, UserHandle.USER_CURRENT); } @Override diff --git a/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextControllerTest.java b/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextControllerTest.java index db45ad788bfc..0044ca7c0409 100644 --- a/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/keyguard/CarrierTextControllerTest.java @@ -36,6 +36,7 @@ import android.content.Context; import android.net.ConnectivityManager; import android.net.wifi.WifiManager; import android.os.Handler; +import android.provider.Settings; import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; @@ -65,6 +66,8 @@ import java.util.List; public class CarrierTextControllerTest extends SysuiTestCase { private static final CharSequence SEPARATOR = " \u2014 "; + private static final CharSequence INVALID_CARD_TEXT = "Invalid card"; + private static final CharSequence AIRPLANE_MODE_TEXT = "Airplane mode"; private static final String TEST_CARRIER = "TEST_CARRIER"; private static final String TEST_CARRIER_2 = "TEST_CARRIER_2"; private static final String TEST_GROUP_UUID = "59b5c870-fc4c-47a4-a99e-9db826b48b24"; @@ -106,6 +109,10 @@ public class CarrierTextControllerTest extends SysuiTestCase { mContext.addMockSystemService(ConnectivityManager.class, mConnectivityManager); mContext.addMockSystemService(TelephonyManager.class, mTelephonyManager); mContext.addMockSystemService(SubscriptionManager.class, mSubscriptionManager); + mContext.getOrCreateTestableResources().addOverride( + R.string.keyguard_sim_error_message_short, INVALID_CARD_TEXT); + mContext.getOrCreateTestableResources().addOverride( + R.string.airplane_mode, AIRPLANE_MODE_TEXT); mDependency.injectMockDependency(WakefulnessLifecycle.class); mDependency.injectTestDependency(Dependency.MAIN_HANDLER, new Handler(mTestableLooper.getLooper())); @@ -122,6 +129,53 @@ public class CarrierTextControllerTest extends SysuiTestCase { } @Test + public void testAirplaneMode() { + Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1); + reset(mCarrierTextCallback); + List<SubscriptionInfo> list = new ArrayList<>(); + list.add(TEST_SUBSCRIPTION); + when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list); + when(mKeyguardUpdateMonitor.getSimState(0)).thenReturn(IccCardConstants.State.READY); + mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); + + mCarrierTextController.updateCarrierText(); + + ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor = + ArgumentCaptor.forClass( + CarrierTextController.CarrierTextCallbackInfo.class); + + mTestableLooper.processAllMessages(); + verify(mCarrierTextCallback).updateCarrierInfo(captor.capture()); + assertEquals(AIRPLANE_MODE_TEXT, captor.getValue().carrierText); + } + + @Test + public void testCardIOError() { + reset(mCarrierTextCallback); + List<SubscriptionInfo> list = new ArrayList<>(); + list.add(TEST_SUBSCRIPTION); + when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn(list); + when(mKeyguardUpdateMonitor.getSimState(0)).thenReturn(IccCardConstants.State.READY); + when(mKeyguardUpdateMonitor.getSimState(1)).thenReturn( + IccCardConstants.State.CARD_IO_ERROR); + mKeyguardUpdateMonitor.mServiceStates = new HashMap<>(); + + mCarrierTextController.mCallback.onSimStateChanged(3, 1, + IccCardConstants.State.CARD_IO_ERROR); + + ArgumentCaptor<CarrierTextController.CarrierTextCallbackInfo> captor = + ArgumentCaptor.forClass( + CarrierTextController.CarrierTextCallbackInfo.class); + + mTestableLooper.processAllMessages(); + verify(mCarrierTextCallback).updateCarrierInfo(captor.capture()); + assertEquals("TEST_CARRIER" + SEPARATOR + INVALID_CARD_TEXT, captor.getValue().carrierText); + // There's only one subscription in the list + assertEquals(1, captor.getValue().listOfCarriers.length); + assertEquals(TEST_CARRIER, captor.getValue().listOfCarriers[0]); + } + + @Test public void testWrongSlots() { reset(mCarrierTextCallback); when(mKeyguardUpdateMonitor.getSubscriptionInfo(anyBoolean())).thenReturn( diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java index b3f6f4ecdf0c..2221915a627a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java @@ -60,6 +60,7 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.statusbar.NotificationPresenter; import com.android.systemui.statusbar.NotificationRemoveInterceptor; import com.android.systemui.statusbar.NotificationTestHelper; +import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.NotificationEntryListener; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.NotificationInterruptionStateProvider; @@ -67,6 +68,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationData; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.phone.DozeParameters; +import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.StatusBarWindowController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.HeadsUpManager; @@ -105,6 +107,10 @@ public class BubbleControllerTest extends SysuiTestCase { private ZenModeController mZenModeController; @Mock private ZenModeConfig mZenModeConfig; + @Mock + private SysuiStatusBarStateController mStatusBarStateController; + @Mock + private KeyguardBypassController mKeyguardBypassController; private FrameLayout mStatusBarView; @Captor @@ -143,7 +149,8 @@ public class BubbleControllerTest extends SysuiTestCase { // Bubbles get added to status bar window view mStatusBarWindowController = new StatusBarWindowController(mContext, mWindowManager, - mActivityManager, mDozeParameters); + mActivityManager, mDozeParameters, mStatusBarStateController, + mConfigurationController, mKeyguardBypassController); mStatusBarWindowController.add(mStatusBarView, 120 /* height */); // Need notifications for bubbles diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java index eb8ef09d0635..d4642238d8fd 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java @@ -95,13 +95,13 @@ public class DozeTriggersTest extends SysuiTestCase { mTriggers.transitionTo(DozeMachine.State.INITIALIZED, DozeMachine.State.DOZE); clearInvocations(mMachine); - mHost.callback.onNotificationAlerted(); + mHost.callback.onNotificationAlerted(null /* pulseSuppressedListener */); mSensors.getMockProximitySensor().sendProximityResult(false); /* Near */ verify(mMachine, never()).requestState(any()); verify(mMachine, never()).requestPulse(anyInt()); - mHost.callback.onNotificationAlerted(); + mHost.callback.onNotificationAlerted(null /* pulseSuppressedListener */); mSensors.getMockProximitySensor().sendProximityResult(true); /* Far */ verify(mMachine).requestPulse(anyInt()); diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardSliceProviderTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardSliceProviderTest.java index 893f3d184acb..9576cb2eec45 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardSliceProviderTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardSliceProviderTest.java @@ -48,6 +48,7 @@ import com.android.keyguard.KeyguardUpdateMonitor; import com.android.systemui.SysuiTestCase; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationMediaManager; +import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.policy.ZenModeController; @@ -197,6 +198,7 @@ public class KeyguardSliceProviderTest extends SysuiTestCase { @Test public void onMetadataChanged_updatesSlice() { + mProvider.onStateChanged(StatusBarState.KEYGUARD); mProvider.onDozingChanged(true); reset(mContentResolver); mProvider.onMetadataOrStateChanged(mock(MediaMetadata.class), PlaybackState.STATE_PLAYING); @@ -210,6 +212,7 @@ public class KeyguardSliceProviderTest extends SysuiTestCase { @Test public void onDozingChanged_updatesSliceIfMedia() { + mProvider.onStateChanged(StatusBarState.KEYGUARD); mProvider.onMetadataOrStateChanged(mock(MediaMetadata.class), PlaybackState.STATE_PLAYING); reset(mContentResolver); // Show media when dozing diff --git a/packages/SystemUI/tests/src/com/android/systemui/shared/recents/model/TaskKeyLruCacheTest.java b/packages/SystemUI/tests/src/com/android/systemui/shared/recents/model/TaskKeyLruCacheTest.java new file mode 100644 index 000000000000..eb71dd6ee677 --- /dev/null +++ b/packages/SystemUI/tests/src/com/android/systemui/shared/recents/model/TaskKeyLruCacheTest.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2019 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.systemui.shared.recents.model; + + +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.assertNull; + +import android.test.suitebuilder.annotation.SmallTest; + +import com.android.systemui.SysuiTestCase; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@SmallTest +@RunWith(JUnit4.class) +public class TaskKeyLruCacheTest extends SysuiTestCase { + private static int sCacheSize = 3; + private static int sIdTask1 = 1; + private static int sIdTask2 = 2; + private static int sIdTask3 = 3; + private static int sIdUser1 = 1; + + TaskKeyCache<Integer> mCache = new TaskKeyLruCache<>(sCacheSize, null); + Task.TaskKey mKey1; + Task.TaskKey mKey2; + Task.TaskKey mKey3; + + @Before + public void setup() { + mKey1 = new Task.TaskKey(sIdTask1, 0, null, null, sIdUser1, System.currentTimeMillis()); + mKey2 = new Task.TaskKey(sIdTask2, 0, null, null, sIdUser1, System.currentTimeMillis()); + mKey3 = new Task.TaskKey(sIdTask3, 0, null, null, sIdUser1, System.currentTimeMillis()); + } + + @Test + public void addSingleItem_get_success() { + mCache.put(mKey1, 1); + + assertEquals(1, (int) mCache.get(mKey1)); + } + + @Test + public void addSingleItem_getUninsertedItem_returnsNull() { + mCache.put(mKey1, 1); + + assertNull(mCache.get(mKey2)); + } + + @Test + public void emptyCache_get_returnsNull() { + assertNull(mCache.get(mKey1)); + } + + @Test + public void updateItem_get_returnsSecond() { + mCache.put(mKey1, 1); + mCache.put(mKey1, 2); + + assertEquals(2, (int) mCache.get(mKey1)); + assertEquals(1, mCache.mKeys.size()); + } + + @Test + public void fillCache_put_evictsOldest() { + mCache.put(mKey1, 1); + mCache.put(mKey2, 2); + mCache.put(mKey3, 3); + Task.TaskKey key4 = new Task.TaskKey(sIdTask3 + 1, 0, + null, null, sIdUser1, System.currentTimeMillis()); + mCache.put(key4, 4); + + assertNull(mCache.get(mKey1)); + assertEquals(3, mCache.mKeys.size()); + assertEquals(mKey2, mCache.mKeys.valueAt(0)); + } + + @Test + public void fillCache_remove_success() { + mCache.put(mKey1, 1); + mCache.put(mKey2, 2); + mCache.put(mKey3, 3); + + mCache.remove(mKey2); + + assertNull(mCache.get(mKey2)); + assertEquals(2, mCache.mKeys.size()); + } +} diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java index 49a263a8d781..57dd8c94c790 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java @@ -38,7 +38,6 @@ import android.os.Handler; import android.os.Looper; import android.os.UserManager; import android.provider.Settings; -import android.service.notification.StatusBarNotification; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; @@ -48,6 +47,7 @@ import com.android.systemui.Dependency; import com.android.systemui.SysuiTestCase; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationData; +import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.DeviceProvisionedController; @@ -166,7 +166,7 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 1); when(mNotificationData.isHighPriority(any())).thenReturn(false); - assertTrue(mLockscreenUserManager.shouldShowOnKeyguard(mock(StatusBarNotification.class))); + assertTrue(mLockscreenUserManager.shouldShowOnKeyguard(mock(NotificationEntry.class))); } @Test @@ -179,7 +179,7 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, 0); when(mNotificationData.isHighPriority(any())).thenReturn(false); - assertFalse(mLockscreenUserManager.shouldShowOnKeyguard(mock(StatusBarNotification.class))); + assertFalse(mLockscreenUserManager.shouldShowOnKeyguard(mock(NotificationEntry.class))); } private class TestNotificationLockscreenUserManager diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java index 6ca5d2c7f687..d804b6f5c5ee 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java @@ -29,9 +29,12 @@ import android.testing.TestableLooper; import android.testing.TestableLooper.RunWithLooper; import com.android.systemui.SysuiTestCase; +import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationViewHierarchyManager; +import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.UnlockMethodCache; +import com.android.systemui.statusbar.policy.KeyguardMonitor; import org.junit.Assert; import org.junit.Before; @@ -51,12 +54,17 @@ public class DynamicPrivacyControllerTest extends SysuiTestCase { = mock(NotificationLockscreenUserManager.class); private DynamicPrivacyController.Listener mListener = mock(DynamicPrivacyController.Listener.class); + private KeyguardMonitor mKeyguardMonitor = mock(KeyguardMonitor.class); @Before public void setUp() throws Exception { when(mCache.canSkipBouncer()).thenReturn(false); + when(mKeyguardMonitor.isShowing()).thenReturn(true); mDynamicPrivacyController = new DynamicPrivacyController( - mLockScreenUserManager, mCache); + mLockScreenUserManager, mKeyguardMonitor, mCache, + mock(StatusBarStateController.class)); + mDynamicPrivacyController.setStatusBarKeyguardViewManager( + mock(StatusBarKeyguardViewManager.class)); mDynamicPrivacyController.addListener(mListener); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManagerTest.java index 73abda9a5da7..59d0f912d38e 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManagerTest.java @@ -263,6 +263,8 @@ public class NotificationSectionsManagerTest extends SysuiTestCase { when(notifRow.getVisibility()).thenReturn(View.VISIBLE); when(notifRow.getEntry().isHighPriority()) .thenReturn(children[i] == ChildType.HIPRI); + when(notifRow.getEntry().isTopBucket()) + .thenReturn(children[i] == ChildType.HIPRI); when(notifRow.getParent()).thenReturn(mNssl); child = notifRow; break; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java index 92173ccbad2e..c851c915d655 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java @@ -61,6 +61,7 @@ import com.android.systemui.statusbar.NotificationRemoteInputManager; import com.android.systemui.statusbar.NotificationShelf; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.StatusBarState; +import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationEntryManager; import com.android.systemui.statusbar.notification.collection.NotificationData; @@ -105,7 +106,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Rule public MockitoRule mockito = MockitoJUnit.rule(); @Mock private StatusBar mBar; - @Mock private StatusBarStateController mBarState; + @Mock private SysuiStatusBarStateController mBarState; @Mock private HeadsUpManagerPhone mHeadsUpManager; @Mock private NotificationBlockingHelperManager mBlockingHelperManager; @Mock private NotificationGroupManager mGroupManager; @@ -136,7 +137,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mDependency.injectTestDependency( NotificationBlockingHelperManager.class, mBlockingHelperManager); - mDependency.injectTestDependency(StatusBarStateController.class, mBarState); + mDependency.injectTestDependency(SysuiStatusBarStateController.class, mBarState); mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger); mDependency.injectTestDependency(NotificationRemoteInputManager.class, mRemoteInputManager); @@ -162,7 +163,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mock(DynamicPrivacyController.class), mock(ConfigurationController.class), mock(ActivityStarterDelegate.class), - mock(StatusBarStateController.class), + mock(SysuiStatusBarStateController.class), mHeadsUpManager, mKeyguardBypassController); mStackScroller = spy(mStackScrollerInternal); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java index 7d9920db36a4..fd676111b1da 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java @@ -82,7 +82,7 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { MockitoAnnotations.initMocks(this); when(mStatusBarKeyguardViewManager.isShowing()).thenReturn(true); when(mUpdateMonitor.isDeviceInteractive()).thenReturn(true); - when(mUnlockMethodCache.isUnlockingWithFacePossible()).thenReturn(true); + when(mUnlockMethodCache.isFaceAuthEnabled()).thenReturn(true); when(mKeyguardBypassController.onBiometricAuthenticated(any())).thenReturn(true); when(mKeyguardBypassController.canPlaySubtleWindowAnimations()).thenReturn(true); mContext.addMockSystemService(PowerManager.class, mPowerManager); @@ -161,6 +161,7 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { @Test public void onBiometricAuthenticated_whenFace_andBypass_encrypted_showBouncer() { + reset(mUpdateMonitor); when(mKeyguardBypassController.getBypassEnabled()).thenReturn(true); mBiometricUnlockController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); @@ -168,11 +169,18 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FACE); + // Wake up before showing the bouncer + verify(mStatusBarKeyguardViewManager, never()).showBouncer(eq(false)); + mBiometricUnlockController.mWakefulnessObserver.onFinishedWakingUp(); + verify(mStatusBarKeyguardViewManager).showBouncer(eq(false)); + assertThat(mBiometricUnlockController.getMode()) + .isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER); } @Test public void onBiometricAuthenticated_whenFace_noBypass_encrypted_doNothing() { + reset(mUpdateMonitor); mBiometricUnlockController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager); when(mUpdateMonitor.isUnlockingWithBiometricAllowed()).thenReturn(false); @@ -181,6 +189,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { verify(mStatusBarKeyguardViewManager, never()).showBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).animateCollapsePanels(anyFloat()); + assertThat(mBiometricUnlockController.getMode()) + .isEqualTo(BiometricUnlockController.MODE_NONE); } @Test diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java index b45707ef6c10..a38094da3e1c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java @@ -35,6 +35,7 @@ import com.android.systemui.plugins.DarkIconDispatcher; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.HeadsUpStatusBarView; import com.android.systemui.statusbar.NotificationTestHelper; +import com.android.systemui.statusbar.notification.NotificationWakeUpCoordinator; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; @@ -59,6 +60,7 @@ public class HeadsUpAppearanceControllerTest extends SysuiTestCase { private View mOperatorNameView; private StatusBarStateController mStatusbarStateController; private KeyguardBypassController mBypassController; + private NotificationWakeUpCoordinator mWakeUpCoordinator; @Before public void setUp() throws Exception { @@ -72,11 +74,13 @@ public class HeadsUpAppearanceControllerTest extends SysuiTestCase { mOperatorNameView = new View(mContext); mStatusbarStateController = mock(StatusBarStateController.class); mBypassController = mock(KeyguardBypassController.class); + mWakeUpCoordinator = mock(NotificationWakeUpCoordinator.class); mHeadsUpAppearanceController = new HeadsUpAppearanceController( mock(NotificationIconAreaController.class), mHeadsUpManager, mStatusbarStateController, mBypassController, + mWakeUpCoordinator, mHeadsUpStatusBarView, mStackScroller, mPanelView, @@ -153,6 +157,7 @@ public class HeadsUpAppearanceControllerTest extends SysuiTestCase { mHeadsUpManager, mStatusbarStateController, mBypassController, + mWakeUpCoordinator, mHeadsUpStatusBarView, mStackScroller, mPanelView, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java index 4e0ef56ad830..907e695f2513 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java @@ -379,7 +379,7 @@ public class KeyguardBouncerTest extends SysuiTestCase { @Test public void testShow_delaysIfFaceAuthIsRunning() { - when(mUnlockMethodCache.isUnlockingWithFacePossible()).thenReturn(true); + when(mUnlockMethodCache.isFaceAuthEnabled()).thenReturn(true); mBouncer.show(true /* reset */); ArgumentCaptor<Runnable> showRunnable = ArgumentCaptor.forClass(Runnable.class); @@ -394,4 +394,15 @@ public class KeyguardBouncerTest extends SysuiTestCase { public void testRegisterUpdateMonitorCallback() { verify(mKeyguardUpdateMonitor).registerCallback(any()); } + + @Test + public void testInTransit_whenTranslation() { + mBouncer.show(true); + mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN); + assertThat(mBouncer.inTransit()).isFalse(); + mBouncer.setExpansion(0.5f); + assertThat(mBouncer.inTransit()).isTrue(); + mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE); + assertThat(mBouncer.inTransit()).isFalse(); + } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java index d8e90a584058..0dbf30881ffe 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java @@ -225,11 +225,12 @@ public class ScrimControllerTest extends SysuiTestCase { mScrimController.transitionTo(ScrimState.PULSING); mScrimController.finishAnimationsImmediately(); - // Front scrim should be transparent + // Front scrim should be transparent, but tinted // Back scrim should be semi-transparent so the user can see the wallpaper // Pulse callback should have been invoked assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE); assertScrimTint(mScrimBehind, true /* tinted */); + assertScrimTint(mScrimInFront, true /* tinted */); mScrimController.setWakeLockScreenSensorActive(true); mScrimController.finishAnimationsImmediately(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java index 1b33aefd1634..da2e8dc90854 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.phone; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyFloat; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.RETURNS_DEEP_STUBS; import static org.mockito.Mockito.clearInvocations; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; @@ -31,6 +32,7 @@ import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; import android.view.ViewGroup; +import android.view.ViewPropertyAnimator; import androidx.test.filters.SmallTest; @@ -85,6 +87,8 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mDependency.injectMockDependency(StatusBarWindowController.class); mDependency.injectTestDependency(StatusBarStateController.class, mStatusBarStateController); when(mLockIconContainer.getParent()).thenReturn(mock(ViewGroup.class)); + when(mLockIconContainer.animate()).thenReturn(mock(ViewPropertyAnimator.class, + RETURNS_DEEP_STUBS)); mStatusBarKeyguardViewManager = new TestableStatusBarKeyguardViewManager(getContext(), mViewMediatorCallback, mLockPatternUtils); mStatusBarKeyguardViewManager.registerStatusBar(mStatusBar, mContainer, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java index e811e1d955ee..186a8c7dcee1 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java @@ -40,6 +40,7 @@ import com.android.internal.logging.testing.FakeMetricsLogger; import com.android.systemui.SysuiTestCase; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.notification.ActivityLaunchAnimator; +import com.android.systemui.statusbar.notification.DynamicPrivacyController; import com.android.systemui.statusbar.notification.NotificationAlertingManager; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationRowBinderImpl; @@ -75,7 +76,7 @@ public class StatusBarNotificationPresenterTest extends SysuiTestCase { mock(NotificationPanelView.class), mock(HeadsUpManagerPhone.class), statusBarWindowView, mock(NotificationListContainerViewGroup.class), mock(DozeScrimController.class), mock(ScrimController.class), - mock(ActivityLaunchAnimator.class), mock(StatusBarKeyguardViewManager.class), + mock(ActivityLaunchAnimator.class), mock(DynamicPrivacyController.class), mock(NotificationAlertingManager.class), mock(NotificationRowBinderImpl.class)); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java index cffd57b35f04..fa235bd46d7e 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java @@ -157,7 +157,7 @@ public class StatusBarTest extends SysuiTestCase { @Mock private RemoteInputController mRemoteInputController; @Mock private StatusBarStateControllerImpl mStatusBarStateController; @Mock private DeviceProvisionedController mDeviceProvisionedController; - @Mock private NotificationPresenter mNotificationPresenter; + @Mock private StatusBarNotificationPresenter mNotificationPresenter; @Mock private NotificationEntryListener mEntryListener; @Mock @@ -780,7 +780,7 @@ public class StatusBarTest extends SysuiTestCase { NotificationShelf notificationShelf, NotificationLockscreenUserManager notificationLockscreenUserManager, CommandQueue commandQueue, - NotificationPresenter notificationPresenter, + StatusBarNotificationPresenter notificationPresenter, BubbleController bubbleController, NavigationBarController navBarController, AutoHideController autoHideController, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java index fea41a441065..4ffaeaef77b4 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java @@ -33,6 +33,8 @@ import android.view.WindowManager; import androidx.test.filters.SmallTest; import com.android.systemui.SysuiTestCase; +import com.android.systemui.statusbar.SysuiStatusBarStateController; +import com.android.systemui.statusbar.policy.ConfigurationController; import org.junit.Before; import org.junit.Test; @@ -54,6 +56,12 @@ public class StatusBarWindowControllerTest extends SysuiTestCase { private ViewGroup mStatusBarView; @Mock private IActivityManager mActivityManager; + @Mock + private SysuiStatusBarStateController mStatusBarStateController; + @Mock + private ConfigurationController mConfigurationController; + @Mock + private KeyguardBypassController mKeyguardBypassController; private StatusBarWindowController mStatusBarWindowController; @@ -63,7 +71,8 @@ public class StatusBarWindowControllerTest extends SysuiTestCase { when(mDozeParameters.getAlwaysOn()).thenReturn(true); mStatusBarWindowController = new StatusBarWindowController(mContext, mWindowManager, - mActivityManager, mDozeParameters); + mActivityManager, mDozeParameters, mStatusBarStateController, + mConfigurationController, mKeyguardBypassController); mStatusBarWindowController.add(mStatusBarView, 100 /* height */); } @@ -88,7 +97,8 @@ public class StatusBarWindowControllerTest extends SysuiTestCase { @Test public void testOnThemeChanged_doesntCrash() { mStatusBarWindowController = new StatusBarWindowController(mContext, mWindowManager, - mActivityManager, mDozeParameters); + mActivityManager, mDozeParameters, mStatusBarStateController, + mConfigurationController, mKeyguardBypassController); mStatusBarWindowController.onThemeChanged(); } @@ -100,7 +110,8 @@ public class StatusBarWindowControllerTest extends SysuiTestCase { @Test public void testSetForcePluginOpen_beforeStatusBarInitialization() { mStatusBarWindowController = new StatusBarWindowController(mContext, mWindowManager, - mActivityManager, mDozeParameters); + mActivityManager, mDozeParameters, mStatusBarStateController, + mConfigurationController, mKeyguardBypassController); mStatusBarWindowController.setForcePluginOpen(true); } } diff --git a/packages/VpnDialogs/res/values-hi/strings.xml b/packages/VpnDialogs/res/values-hi/strings.xml index 34b79cb4100a..eed0858787d9 100644 --- a/packages/VpnDialogs/res/values-hi/strings.xml +++ b/packages/VpnDialogs/res/values-hi/strings.xml @@ -22,7 +22,7 @@ <string name="session" msgid="6470628549473641030">"सत्र:"</string> <string name="duration" msgid="3584782459928719435">"अवधि:"</string> <string name="data_transmitted" msgid="7988167672982199061">"भेजे गए:"</string> - <string name="data_received" msgid="4062776929376067820">"प्राप्त:"</string> + <string name="data_received" msgid="4062776929376067820">"पाया:"</string> <string name="data_value_format" msgid="2192466557826897580">"<xliff:g id="NUMBER_0">%1$s</xliff:g> बाइट / <xliff:g id="NUMBER_1">%2$s</xliff:g> पैकेट"</string> <string name="always_on_disconnected_title" msgid="1906740176262776166">"हमेशा चालू रहने वाले VPN से नहीं जुड़ पा रहा है"</string> <string name="always_on_disconnected_message" msgid="555634519845992917">"<xliff:g id="VPN_APP_0">%1$s</xliff:g> को हर समय जुड़े रहने के लिए सेट अप किया गया है, लेकिन वह इस समय नहीं जुड़ पा रहा है. जब तक आपका फ़ोन <xliff:g id="VPN_APP_1">%1$s</xliff:g> से नहीं जुड़ जाता, तब तक वह सार्वजनिक नेटवर्क का इस्तेमाल करेगा."</string> diff --git a/proto/src/wifi.proto b/proto/src/wifi.proto index f9a2ca269335..8ad24894a1b9 100644 --- a/proto/src/wifi.proto +++ b/proto/src/wifi.proto @@ -551,6 +551,30 @@ message WifiLog { // Histogram of the EAP method type of all installed Passpoint profiles for R2 repeated PasspointProfileTypeCount installed_passpoint_profile_type_for_r2 = 148; + + // Histogram of Tx link speed at 2G + repeated Int32Count tx_link_speed_count_2g = 149; + + // Histogram of Tx link speed at 5G low band + repeated Int32Count tx_link_speed_count_5g_low = 150; + + // Histogram of Tx link speed at 5G middle band + repeated Int32Count tx_link_speed_count_5g_mid = 151; + + // Histogram of Tx link speed at 5G high band + repeated Int32Count tx_link_speed_count_5g_high = 152; + + // Histogram of Rx link speed at 2G + repeated Int32Count rx_link_speed_count_2g = 153; + + // Histogram of Rx link speed at 5G low band + repeated Int32Count rx_link_speed_count_5g_low = 154; + + // Histogram of Rx link speed at 5G middle band + repeated Int32Count rx_link_speed_count_5g_mid = 155; + + // Histogram of Rx link speed at 5G high band + repeated Int32Count rx_link_speed_count_5g_high = 156; } // Information that gets logged for every WiFi connection. @@ -827,6 +851,7 @@ message LinkSpeedCount { optional int64 rssi_sum_of_squares_dbm_sq = 4; } + // Number of occurrences of Soft AP session durations message SoftApDurationBucket { // Bucket covers duration : [duration_sec, duration_sec + bucket_size_sec) diff --git a/services/backup/java/com/android/server/backup/UserBackupManagerService.java b/services/backup/java/com/android/server/backup/UserBackupManagerService.java index c0af99c30542..2554433fb659 100644 --- a/services/backup/java/com/android/server/backup/UserBackupManagerService.java +++ b/services/backup/java/com/android/server/backup/UserBackupManagerService.java @@ -166,6 +166,52 @@ import java.util.concurrent.atomic.AtomicInteger; /** System service that performs backup/restore operations. */ public class UserBackupManagerService { + /** Wrapper over {@link PowerManager.WakeLock} to prevent double-free exceptions on release() + * after quit(). + * */ + public static class BackupWakeLock { + private final PowerManager.WakeLock mPowerManagerWakeLock; + private boolean mHasQuit = false; + + public BackupWakeLock(PowerManager.WakeLock powerManagerWakeLock) { + mPowerManagerWakeLock = powerManagerWakeLock; + } + + /** Acquires the {@link PowerManager.WakeLock} if hasn't been quit. */ + public synchronized void acquire() { + if (mHasQuit) { + Slog.v(TAG, "Ignore wakelock acquire after quit:" + mPowerManagerWakeLock.getTag()); + return; + } + mPowerManagerWakeLock.acquire(); + } + + /** Releases the {@link PowerManager.WakeLock} if hasn't been quit. */ + public synchronized void release() { + if (mHasQuit) { + Slog.v(TAG, "Ignore wakelock release after quit:" + mPowerManagerWakeLock.getTag()); + return; + } + mPowerManagerWakeLock.release(); + } + + /** + * Returns true if the {@link PowerManager.WakeLock} has been acquired but not yet released. + */ + public synchronized boolean isHeld() { + return mPowerManagerWakeLock.isHeld(); + } + + /** Release the {@link PowerManager.WakeLock} till it isn't held. */ + public synchronized void quit() { + while (mPowerManagerWakeLock.isHeld()) { + Slog.v(TAG, "Releasing wakelock:" + mPowerManagerWakeLock.getTag()); + mPowerManagerWakeLock.release(); + } + mHasQuit = true; + } + } + // Persistently track the need to do a full init. private static final String INIT_SENTINEL_FILE_NAME = "_need_init_"; @@ -252,7 +298,6 @@ public class UserBackupManagerService { private final @UserIdInt int mUserId; private final BackupAgentTimeoutParameters mAgentTimeoutParameters; private final TransportManager mTransportManager; - private final HandlerThread mUserBackupThread; private final Context mContext; private final PackageManager mPackageManager; @@ -263,7 +308,7 @@ public class UserBackupManagerService { private final AlarmManager mAlarmManager; private final IStorageManager mStorageManager; private final BackupManagerConstants mConstants; - private final PowerManager.WakeLock mWakelock; + private final BackupWakeLock mWakelock; private final BackupHandler mBackupHandler; private final IBackupManager mBackupManagerBinder; @@ -367,6 +412,9 @@ public class UserBackupManagerService { private long mCurrentToken = 0; @Nullable private File mAncestralSerialNumberFile; + private final ContentObserver mSetupObserver; + private final BroadcastReceiver mRunBackupReceiver; + private final BroadcastReceiver mRunInitReceiver; /** * Creates an instance of {@link UserBackupManagerService} and initializes state for it. This @@ -484,8 +532,7 @@ public class UserBackupManagerService { mAgentTimeoutParameters.start(); checkNotNull(userBackupThread, "userBackupThread cannot be null"); - mUserBackupThread = userBackupThread; - mBackupHandler = new BackupHandler(this, userBackupThread.getLooper()); + mBackupHandler = new BackupHandler(this, userBackupThread); // Set up our bookkeeping final ContentResolver resolver = context.getContentResolver(); @@ -493,11 +540,11 @@ public class UserBackupManagerService { mAutoRestore = Settings.Secure.getIntForUser(resolver, Settings.Secure.BACKUP_AUTO_RESTORE, 1, userId) != 0; - ContentObserver setupObserver = new SetupObserver(this, mBackupHandler); + mSetupObserver = new SetupObserver(this, mBackupHandler); resolver.registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), /* notifyForDescendents */ false, - setupObserver, + mSetupObserver, mUserId); mBaseStateDir = checkNotNull(baseStateDir, "baseStateDir cannot be null"); @@ -516,21 +563,21 @@ public class UserBackupManagerService { mBackupPasswordManager = new BackupPasswordManager(mContext, mBaseStateDir, mRng); // Receivers for scheduled backups and transport initialization operations. - BroadcastReceiver runBackupReceiver = new RunBackupReceiver(this); + mRunBackupReceiver = new RunBackupReceiver(this); IntentFilter filter = new IntentFilter(); filter.addAction(RUN_BACKUP_ACTION); context.registerReceiverAsUser( - runBackupReceiver, + mRunBackupReceiver, UserHandle.of(userId), filter, android.Manifest.permission.BACKUP, /* scheduler */ null); - BroadcastReceiver runInitReceiver = new RunInitializeReceiver(this); + mRunInitReceiver = new RunInitializeReceiver(this); filter = new IntentFilter(); filter.addAction(RUN_INITIALIZE_ACTION); context.registerReceiverAsUser( - runInitReceiver, + mRunInitReceiver, UserHandle.of(userId), filter, android.Manifest.permission.BACKUP, @@ -585,7 +632,10 @@ public class UserBackupManagerService { mBackupHandler.postDelayed(this::parseLeftoverJournals, INITIALIZATION_DELAY_MILLIS); // Power management - mWakelock = mPowerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*backup*-" + userId); + mWakelock = new BackupWakeLock( + mPowerManager.newWakeLock( + PowerManager.PARTIAL_WAKE_LOCK, + "*backup*-" + userId + "-" + userBackupThread.getThreadId())); // Set up the various sorts of package tracking we do mFullBackupScheduleFile = new File(mBaseStateDir, "fb-schedule"); @@ -599,7 +649,13 @@ public class UserBackupManagerService { /** Cleans up state when the user of this service is stopped. */ void tearDownService() { - mUserBackupThread.quit(); + mAgentTimeoutParameters.stop(); + mConstants.stop(); + mContext.getContentResolver().unregisterContentObserver(mSetupObserver); + mContext.unregisterReceiver(mRunBackupReceiver); + mContext.unregisterReceiver(mRunInitReceiver); + mContext.unregisterReceiver(mPackageTrackingReceiver); + mBackupHandler.stop(); } public @UserIdInt int getUserId() { @@ -659,7 +715,7 @@ public class UserBackupManagerService { mSetupComplete = setupComplete; } - public PowerManager.WakeLock getWakelock() { + public BackupWakeLock getWakelock() { return mWakelock; } @@ -670,7 +726,7 @@ public class UserBackupManagerService { @VisibleForTesting public void setWorkSource(@Nullable WorkSource workSource) { // TODO: This is for testing, unfortunately WakeLock is final and WorkSource is not exposed - mWakelock.setWorkSource(workSource); + mWakelock.mPowerManagerWakeLock.setWorkSource(workSource); } public Handler getBackupHandler() { @@ -747,7 +803,7 @@ public class UserBackupManagerService { @VisibleForTesting BroadcastReceiver getPackageTrackingReceiver() { - return mBroadcastReceiver; + return mPackageTrackingReceiver; } @Nullable @@ -874,7 +930,7 @@ public class UserBackupManagerService { filter.addAction(Intent.ACTION_PACKAGE_CHANGED); filter.addDataScheme("package"); mContext.registerReceiverAsUser( - mBroadcastReceiver, + mPackageTrackingReceiver, UserHandle.of(mUserId), filter, /* broadcastPermission */ null, @@ -885,7 +941,7 @@ public class UserBackupManagerService { sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE); sdFilter.addAction(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE); mContext.registerReceiverAsUser( - mBroadcastReceiver, + mPackageTrackingReceiver, UserHandle.of(mUserId), sdFilter, /* broadcastPermission */ null, @@ -1158,7 +1214,7 @@ public class UserBackupManagerService { * A {@link BroadcastReceiver} tracking changes to packages and sd cards in order to update our * internal bookkeeping. */ - private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { + private BroadcastReceiver mPackageTrackingReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { if (MORE_DEBUG) { Slog.d(TAG, "Received broadcast " + intent); diff --git a/services/backup/java/com/android/server/backup/internal/BackupHandler.java b/services/backup/java/com/android/server/backup/internal/BackupHandler.java index ba153bf90ebe..059b1b9379af 100644 --- a/services/backup/java/com/android/server/backup/internal/BackupHandler.java +++ b/services/backup/java/com/android/server/backup/internal/BackupHandler.java @@ -23,7 +23,7 @@ import static com.android.server.backup.BackupManagerService.TAG; import android.app.backup.RestoreSet; import android.content.Intent; import android.os.Handler; -import android.os.Looper; +import android.os.HandlerThread; import android.os.Message; import android.os.RemoteException; import android.os.UserHandle; @@ -83,19 +83,47 @@ public class BackupHandler extends Handler { // backup task state machine tick public static final int MSG_BACKUP_RESTORE_STEP = 20; public static final int MSG_OP_COMPLETE = 21; + // Release the wakelock. This is used to ensure we don't hold it after + // a user is removed. This will also terminate the looper thread. + public static final int MSG_STOP = 22; private final UserBackupManagerService backupManagerService; private final BackupAgentTimeoutParameters mAgentTimeoutParameters; - public BackupHandler(UserBackupManagerService backupManagerService, Looper looper) { - super(looper); + private final HandlerThread mBackupThread; + private volatile boolean mIsStopping = false; + + public BackupHandler( + UserBackupManagerService backupManagerService, HandlerThread backupThread) { + super(backupThread.getLooper()); + mBackupThread = backupThread; this.backupManagerService = backupManagerService; mAgentTimeoutParameters = Preconditions.checkNotNull( backupManagerService.getAgentTimeoutParameters(), "Timeout parameters cannot be null"); } + /** + * Put the BackupHandler into a stopping state where the remaining messages on the queue will be + * silently dropped and the {@link WakeLock} held by the {@link UserBackupManagerService} will + * then be released. + */ + public void stop() { + mIsStopping = true; + sendMessage(obtainMessage(BackupHandler.MSG_STOP)); + } + public void handleMessage(Message msg) { + if (msg.what == MSG_STOP) { + Slog.v(TAG, "Stopping backup handler"); + backupManagerService.getWakelock().quit(); + mBackupThread.quitSafely(); + } + + if (mIsStopping) { + // If we're finishing all other types of messages should be ignored + return; + } TransportManager transportManager = backupManagerService.getTransportManager(); switch (msg.what) { diff --git a/services/backup/java/com/android/server/backup/internal/RunInitializeReceiver.java b/services/backup/java/com/android/server/backup/internal/RunInitializeReceiver.java index 97711e3c27ed..96d61e5755c8 100644 --- a/services/backup/java/com/android/server/backup/internal/RunInitializeReceiver.java +++ b/services/backup/java/com/android/server/backup/internal/RunInitializeReceiver.java @@ -23,7 +23,6 @@ import static com.android.server.backup.UserBackupManagerService.RUN_INITIALIZE_ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import android.os.PowerManager; import android.util.Slog; import com.android.server.backup.UserBackupManagerService; @@ -57,7 +56,8 @@ public class RunInitializeReceiver extends BroadcastReceiver { mUserBackupManagerService.clearPendingInits(); - PowerManager.WakeLock wakelock = mUserBackupManagerService.getWakelock(); + UserBackupManagerService.BackupWakeLock wakelock = + mUserBackupManagerService.getWakelock(); wakelock.acquire(); OnTaskFinishedListener listener = caller -> wakelock.release(); diff --git a/services/backup/java/com/android/server/backup/restore/ActiveRestoreSession.java b/services/backup/java/com/android/server/backup/restore/ActiveRestoreSession.java index 10304c39f021..5a57cdc39402 100644 --- a/services/backup/java/com/android/server/backup/restore/ActiveRestoreSession.java +++ b/services/backup/java/com/android/server/backup/restore/ActiveRestoreSession.java @@ -34,7 +34,6 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.os.Binder; import android.os.Handler; import android.os.Message; -import android.os.PowerManager; import android.util.Slog; import com.android.server.backup.TransportManager; @@ -110,7 +109,7 @@ public class ActiveRestoreSession extends IRestoreSession.Stub { // comes in. mBackupManagerService.getBackupHandler().removeMessages(MSG_RESTORE_SESSION_TIMEOUT); - PowerManager.WakeLock wakelock = mBackupManagerService.getWakelock(); + UserBackupManagerService.BackupWakeLock wakelock = mBackupManagerService.getWakelock(); wakelock.acquire(); // Prevent lambda from leaking 'this' @@ -392,7 +391,7 @@ public class ActiveRestoreSession extends IRestoreSession.Stub { Handler backupHandler = mBackupManagerService.getBackupHandler(); backupHandler.removeMessages(MSG_RESTORE_SESSION_TIMEOUT); - PowerManager.WakeLock wakelock = mBackupManagerService.getWakelock(); + UserBackupManagerService.BackupWakeLock wakelock = mBackupManagerService.getWakelock(); wakelock.acquire(); if (MORE_DEBUG) { Slog.d(TAG, callerLogString); diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index f7e825eecc12..e66e596d5038 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -1027,12 +1027,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { log(str); } mLocalLog.log(str); - // for service state updates, don't notify clients when subId is invalid. This prevents - // us from sending incorrect notifications like b/133140128 - // In the future, we can remove this logic for every notification here and add a - // callback so listeners know when their PhoneStateListener's subId becomes invalid, but - // for now we use the simplest fix. - if (validatePhoneId(phoneId) && SubscriptionManager.isValidSubscriptionId(subId)) { + if (validatePhoneId(phoneId)) { mServiceState[phoneId] = state; for (Record r : mRecords) { @@ -1064,8 +1059,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } } } else { - log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId - + " or subId=" + subId); + log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId); } handleRemoveListLocked(); } diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 91ae156afdf5..2ddc72596e43 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -8467,32 +8467,6 @@ public class ActivityManagerService extends IActivityManager.Stub } } - void setRunningRemoteAnimation(int pid, boolean runningRemoteAnimation) { - if (pid == Process.myPid()) { - Slog.wtf(TAG, "system can't run remote animation"); - return; - } - synchronized (ActivityManagerService.this) { - final ProcessRecord pr; - synchronized (mPidsSelfLocked) { - pr = mPidsSelfLocked.get(pid); - if (pr == null) { - Slog.w(TAG, "setRunningRemoteAnimation called on unknown pid: " + pid); - return; - } - } - if (pr.runningRemoteAnimation == runningRemoteAnimation) { - return; - } - pr.runningRemoteAnimation = runningRemoteAnimation; - if (DEBUG_OOM_ADJ) { - Slog.i(TAG, "Setting runningRemoteAnimation=" + pr.runningRemoteAnimation - + " for pid=" + pid); - } - updateOomAdjLocked(pr, true, OomAdjuster.OOM_ADJ_REASON_UI_VISIBILITY); - } - } - public final void enterSafeMode() { synchronized(this) { // It only makes sense to do this before the system is ready @@ -17971,11 +17945,6 @@ public class ActivityManagerService extends IActivityManager.Stub } @Override - public void setRunningRemoteAnimation(int pid, boolean runningRemoteAnimation) { - ActivityManagerService.this.setRunningRemoteAnimation(pid, runningRemoteAnimation); - } - - @Override public List<ProcessMemoryState> getMemoryStateForProcesses() { List<ProcessMemoryState> processMemoryStates = new ArrayList<>(); synchronized (mPidsSelfLocked) { diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java index cba9674d7360..26b3f435dea1 100644 --- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java +++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java @@ -510,12 +510,12 @@ final class ActivityManagerShellCommand extends ShellCommand { options.setLockTaskEnabled(true); } if (mWaitOption) { - result = mInternal.startActivityAndWait(null, null, intent, mimeType, + result = mInternal.startActivityAndWait(null, SHELL_PACKAGE_NAME, intent, mimeType, null, null, 0, mStartFlags, profilerInfo, options != null ? options.toBundle() : null, mUserId); res = result.result; } else { - res = mInternal.startActivityAsUser(null, null, intent, mimeType, + res = mInternal.startActivityAsUser(null, SHELL_PACKAGE_NAME, intent, mimeType, null, null, 0, mStartFlags, profilerInfo, options != null ? options.toBundle() : null, mUserId); } diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java index bcfe71b82a6a..dbf8acf74dbd 100644 --- a/services/core/java/com/android/server/am/OomAdjuster.java +++ b/services/core/java/com/android/server/am/OomAdjuster.java @@ -34,6 +34,7 @@ import static android.os.Process.THREAD_GROUP_BG_NONINTERACTIVE; import static android.os.Process.THREAD_GROUP_DEFAULT; import static android.os.Process.THREAD_GROUP_RESTRICTED; import static android.os.Process.THREAD_GROUP_TOP_APP; +import static android.os.Process.THREAD_PRIORITY_DISPLAY; import static android.os.Process.setProcessGroup; import static android.os.Process.setThreadPriority; import static android.os.Process.setThreadScheduler; @@ -1803,7 +1804,6 @@ public final class OomAdjuster { if (app.renderThreadTid != 0) { setThreadScheduler(app.renderThreadTid, SCHED_OTHER, 0); - setThreadPriority(app.renderThreadTid, -4); } } catch (IllegalArgumentException e) { Slog.w(TAG, @@ -1815,9 +1815,10 @@ public final class OomAdjuster { } else { // Reset priority for top app UI and render threads setThreadPriority(app.pid, 0); - if (app.renderThreadTid != 0) { - setThreadPriority(app.renderThreadTid, 0); - } + } + + if (app.renderThreadTid != 0) { + setThreadPriority(app.renderThreadTid, THREAD_PRIORITY_DISPLAY); } } } catch (Exception e) { diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java index 563b2f3bfb32..ea3084274ae0 100644 --- a/services/core/java/com/android/server/am/ProcessRecord.java +++ b/services/core/java/com/android/server/am/ProcessRecord.java @@ -20,6 +20,7 @@ import static android.app.ActivityManager.PROCESS_STATE_NONEXISTENT; import static com.android.server.Watchdog.NATIVE_STACKS_OF_INTEREST; import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ANR; +import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_OOM_ADJ; import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM; import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.am.ActivityManagerService.MY_PID; @@ -1348,6 +1349,25 @@ class ProcessRecord implements WindowProcessListener { } } + @Override + public void setRunningRemoteAnimation(boolean runningRemoteAnimation) { + if (pid == Process.myPid()) { + Slog.wtf(TAG, "system can't run remote animation"); + return; + } + synchronized (mService) { + if (this.runningRemoteAnimation == runningRemoteAnimation) { + return; + } + this.runningRemoteAnimation = runningRemoteAnimation; + if (DEBUG_OOM_ADJ) { + Slog.i(TAG, "Setting runningRemoteAnimation=" + runningRemoteAnimation + + " for pid=" + pid); + } + mService.updateOomAdjLocked(this, true, OomAdjuster.OOM_ADJ_REASON_UI_VISIBILITY); + } + } + public long getInputDispatchingTimeout() { return mWindowProcessController.getInputDispatchingTimeout(); } diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java index 350df11621e6..3a75eebaa4ca 100644 --- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java +++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java @@ -15,9 +15,6 @@ */ package com.android.server.audio; -import static com.android.server.audio.AudioService.CONNECTION_STATE_CONNECTED; -import static com.android.server.audio.AudioService.CONNECTION_STATE_DISCONNECTED; - import android.annotation.NonNull; import android.bluetooth.BluetoothA2dp; import android.bluetooth.BluetoothDevice; @@ -93,13 +90,28 @@ import com.android.internal.annotations.GuardedBy; /*package*/ AudioDeviceBroker(@NonNull Context context, @NonNull AudioService service) { mContext = context; mAudioService = service; - setupMessaging(context); mBtHelper = new BtHelper(this); mDeviceInventory = new AudioDeviceInventory(this); + init(); + } + + /** for test purposes only, inject AudioDeviceInventory */ + AudioDeviceBroker(@NonNull Context context, @NonNull AudioService service, + @NonNull AudioDeviceInventory mockDeviceInventory) { + mContext = context; + mAudioService = service; + mBtHelper = new BtHelper(this); + mDeviceInventory = mockDeviceInventory; + + init(); + } + + private void init() { + setupMessaging(mContext); + mForcedUseForComm = AudioSystem.FORCE_NONE; mForcedUseForCommExt = mForcedUseForComm; - } /*package*/ Context getContext() { @@ -230,17 +242,42 @@ import com.android.internal.annotations.GuardedBy; mSupprNoisy = suppressNoisyIntent; mVolume = vol; } + + // redefine equality op so we can match messages intended for this device + @Override + public boolean equals(Object o) { + return mDevice.equals(o); + } } + /*package*/ void postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent( @NonNull BluetoothDevice device, @AudioService.BtProfileConnectionState int state, int profile, boolean suppressNoisyIntent, int a2dpVolume) { final BtDeviceConnectionInfo info = new BtDeviceConnectionInfo(device, state, profile, suppressNoisyIntent, a2dpVolume); - // TODO add a check to try to remove unprocessed messages for the same device (the old - // check didn't work), and make sure it doesn't conflict with config change message - sendLMsgNoDelay(MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT, SENDMSG_QUEUE, info); + // when receiving a request to change the connection state of a device, this last request + // is the source of truth, so cancel all previous requests + removeAllA2dpConnectionEvents(device); + + sendLMsgNoDelay( + state == BluetoothProfile.STATE_CONNECTED + ? MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_CONNECTION + : MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_DISCONNECTION, + SENDMSG_QUEUE, info); + } + + /** remove all previously scheduled connection and disconnection events for the given device */ + private void removeAllA2dpConnectionEvents(@NonNull BluetoothDevice device) { + mBrokerHandler.removeMessages(MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_DISCONNECTION, + device); + mBrokerHandler.removeMessages(MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_CONNECTION, + device); + mBrokerHandler.removeMessages(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_CONNECTED, + device); + mBrokerHandler.removeMessages(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_DISCONNECTED, + device); } private static final class HearingAidDeviceConnectionInfo { @@ -428,13 +465,16 @@ import com.android.internal.annotations.GuardedBy; sendMsgNoDelay(MSG_BROADCAST_AUDIO_BECOMING_NOISY, SENDMSG_REPLACE); } - /*package*/ void postA2dpSinkConnection(int state, + /*package*/ void postA2dpSinkConnection(@AudioService.BtProfileConnectionState int state, @NonNull BtHelper.BluetoothA2dpDeviceInfo btDeviceInfo, int delay) { - sendILMsg(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE, SENDMSG_QUEUE, + sendILMsg(state == BluetoothA2dp.STATE_CONNECTED + ? MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_CONNECTED + : MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_DISCONNECTED, + SENDMSG_QUEUE, state, btDeviceInfo, delay); } - /*package*/ void postA2dpSourceConnection(int state, + /*package*/ void postA2dpSourceConnection(@AudioService.BtProfileConnectionState int state, @NonNull BtHelper.BluetoothA2dpDeviceInfo btDeviceInfo, int delay) { sendILMsg(MSG_IL_SET_A2DP_SOURCE_CONNECTION_STATE, SENDMSG_QUEUE, state, btDeviceInfo, delay); @@ -520,25 +560,6 @@ import com.android.internal.annotations.GuardedBy; } } - @GuardedBy("mDeviceStateLock") - /*package*/ void handleSetA2dpSinkConnectionState(@BluetoothProfile.BtProfileState int state, - @NonNull BtHelper.BluetoothA2dpDeviceInfo btDeviceInfo) { - final int intState = (state == BluetoothA2dp.STATE_CONNECTED) - ? CONNECTION_STATE_CONNECTED : CONNECTION_STATE_DISCONNECTED; - final int delay = mDeviceInventory.checkSendBecomingNoisyIntent( - AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, intState, - AudioSystem.DEVICE_NONE); - final String addr = btDeviceInfo == null ? "null" : btDeviceInfo.getBtDevice().getAddress(); - - if (AudioService.DEBUG_DEVICES) { - Log.d(TAG, "handleSetA2dpSinkConnectionState btDevice= " + btDeviceInfo - + " state= " + state - + " is dock: " + btDeviceInfo.getBtDevice().isBluetoothDock()); - } - sendILMsg(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE, SENDMSG_QUEUE, - state, btDeviceInfo, delay); - } - /*package*/ void postSetA2dpSourceConnectionState(@BluetoothProfile.BtProfileState int state, @NonNull BtHelper.BluetoothA2dpDeviceInfo btDeviceInfo) { final int intState = (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0; @@ -573,8 +594,10 @@ import com.android.internal.annotations.GuardedBy; // must be called synchronized on mConnectedDevices /*package*/ boolean hasScheduledA2dpSinkConnectionState(BluetoothDevice btDevice) { - return mBrokerHandler.hasMessages(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE, - new BtHelper.BluetoothA2dpDeviceInfo(btDevice)); + return (mBrokerHandler.hasMessages(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_CONNECTED, + new BtHelper.BluetoothA2dpDeviceInfo(btDevice)) + || mBrokerHandler.hasMessages(MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_DISCONNECTED, + new BtHelper.BluetoothA2dpDeviceInfo(btDevice))); } /*package*/ void setA2dpDockTimeout(String address, int a2dpCodec, int delayMs) { @@ -700,7 +723,8 @@ import com.android.internal.annotations.GuardedBy; mDeviceInventory.onReportNewRoutes(); } break; - case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE: + case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_CONNECTED: + case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_DISCONNECTED: synchronized (mDeviceStateLock) { mDeviceInventory.onSetA2dpSinkConnectionState( (BtHelper.BluetoothA2dpDeviceInfo) msg.obj, msg.arg1); @@ -825,7 +849,8 @@ import com.android.internal.annotations.GuardedBy; } } break; - case MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT: { + case MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_CONNECTION: + case MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_DISCONNECTION: { final BtDeviceConnectionInfo info = (BtDeviceConnectionInfo) msg.obj; AudioService.sDeviceLogger.log((new AudioEventLogger.StringEvent( "setBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent " @@ -876,7 +901,7 @@ import com.android.internal.annotations.GuardedBy; private static final int MSG_I_BROADCAST_BT_CONNECTION_STATE = 3; private static final int MSG_IIL_SET_FORCE_USE = 4; private static final int MSG_IIL_SET_FORCE_BT_A2DP_USE = 5; - private static final int MSG_IL_SET_A2DP_SINK_CONNECTION_STATE = 6; + private static final int MSG_TOGGLE_HDMI = 6; private static final int MSG_IL_SET_A2DP_SOURCE_CONNECTION_STATE = 7; private static final int MSG_IL_SET_HEARING_AID_CONNECTION_STATE = 8; private static final int MSG_BT_HEADSET_CNCT_FAILED = 9; @@ -887,7 +912,6 @@ import com.android.internal.annotations.GuardedBy; private static final int MSG_II_SET_HEARING_AID_VOLUME = 14; private static final int MSG_I_SET_AVRCP_ABSOLUTE_VOLUME = 15; private static final int MSG_I_DISCONNECT_BT_SCO = 16; - private static final int MSG_TOGGLE_HDMI = 17; private static final int MSG_L_A2DP_ACTIVE_DEVICE_CHANGE = 18; private static final int MSG_DISCONNECT_A2DP = 19; private static final int MSG_DISCONNECT_A2DP_SINK = 20; @@ -897,25 +921,30 @@ import com.android.internal.annotations.GuardedBy; private static final int MSG_L_BT_SERVICE_CONNECTED_PROFILE_A2DP_SINK = 24; private static final int MSG_L_BT_SERVICE_CONNECTED_PROFILE_HEARING_AID = 25; private static final int MSG_L_BT_SERVICE_CONNECTED_PROFILE_HEADSET = 26; + private static final int MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_CONNECTED = 27; + private static final int MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_DISCONNECTED = 28; // process external command to (dis)connect an A2DP device - private static final int MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT = 27; + private static final int MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_CONNECTION = 29; + private static final int MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_DISCONNECTION = 30; // process external command to (dis)connect a hearing aid device - private static final int MSG_L_HEARING_AID_DEVICE_CONNECTION_CHANGE_EXT = 28; + private static final int MSG_L_HEARING_AID_DEVICE_CONNECTION_CHANGE_EXT = 31; // a ScoClient died in BtHelper - private static final int MSG_L_SCOCLIENT_DIED = 29; + private static final int MSG_L_SCOCLIENT_DIED = 32; private static boolean isMessageHandledUnderWakelock(int msgId) { switch(msgId) { case MSG_L_SET_WIRED_DEVICE_CONNECTION_STATE: - case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE: + case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_CONNECTED: + case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_DISCONNECTED: case MSG_IL_SET_A2DP_SOURCE_CONNECTION_STATE: case MSG_IL_SET_HEARING_AID_CONNECTION_STATE: case MSG_IL_BTA2DP_DOCK_TIMEOUT: case MSG_L_A2DP_DEVICE_CONFIG_CHANGE: case MSG_TOGGLE_HDMI: case MSG_L_A2DP_ACTIVE_DEVICE_CHANGE: - case MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT: + case MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_CONNECTION: + case MSG_L_A2DP_DEVICE_CONNECTION_CHANGE_EXT_DISCONNECTION: case MSG_L_HEARING_AID_DEVICE_CONNECTION_CHANGE_EXT: return true; default: @@ -996,7 +1025,8 @@ import com.android.internal.annotations.GuardedBy; switch (msg) { case MSG_IL_SET_A2DP_SOURCE_CONNECTION_STATE: - case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE: + case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_CONNECTED: + case MSG_IL_SET_A2DP_SINK_CONNECTION_STATE_DISCONNECTED: case MSG_IL_SET_HEARING_AID_CONNECTION_STATE: case MSG_L_SET_WIRED_DEVICE_CONNECTION_STATE: case MSG_IL_BTA2DP_DOCK_TIMEOUT: diff --git a/services/core/java/com/android/server/audio/AudioDeviceInventory.java b/services/core/java/com/android/server/audio/AudioDeviceInventory.java index a9a8ef2f7e12..90973a888a9d 100644 --- a/services/core/java/com/android/server/audio/AudioDeviceInventory.java +++ b/services/core/java/com/android/server/audio/AudioDeviceInventory.java @@ -41,14 +41,16 @@ import android.util.Log; import android.util.Slog; import com.android.internal.annotations.GuardedBy; +import com.android.internal.annotations.VisibleForTesting; import java.util.ArrayList; /** * Class to manage the inventory of all connected devices. * This class is thread-safe. + * (non final for mocking/spying) */ -public final class AudioDeviceInventory { +public class AudioDeviceInventory { private static final String TAG = "AS.AudioDeviceInventory"; @@ -56,11 +58,7 @@ public final class AudioDeviceInventory { // Key for map created from DeviceInfo.makeDeviceListKey() private final ArrayMap<String, DeviceInfo> mConnectedDevices = new ArrayMap<>(); - private final @NonNull AudioDeviceBroker mDeviceBroker; - - AudioDeviceInventory(@NonNull AudioDeviceBroker broker) { - mDeviceBroker = broker; - } + private @NonNull AudioDeviceBroker mDeviceBroker; // cache of the address of the last dock the device was connected to private String mDockAddress; @@ -70,6 +68,20 @@ public final class AudioDeviceInventory { final RemoteCallbackList<IAudioRoutesObserver> mRoutesObservers = new RemoteCallbackList<IAudioRoutesObserver>(); + /*package*/ AudioDeviceInventory(@NonNull AudioDeviceBroker broker) { + mDeviceBroker = broker; + } + + //----------------------------------------------------------- + /** for mocking only */ + /*package*/ AudioDeviceInventory() { + mDeviceBroker = null; + } + + /*package*/ void setDeviceBroker(@NonNull AudioDeviceBroker broker) { + mDeviceBroker = broker; + } + //------------------------------------------------------------ /** * Class to store info about connected devices. @@ -146,8 +158,10 @@ public final class AudioDeviceInventory { } } + // only public for mocking/spying @GuardedBy("AudioDeviceBroker.mDeviceStateLock") - /*package*/ void onSetA2dpSinkConnectionState(@NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo, + @VisibleForTesting + public void onSetA2dpSinkConnectionState(@NonNull BtHelper.BluetoothA2dpDeviceInfo btInfo, @AudioService.BtProfileConnectionState int state) { final BluetoothDevice btDevice = btInfo.getBtDevice(); int a2dpVolume = btInfo.getVolume(); @@ -159,30 +173,40 @@ public final class AudioDeviceInventory { if (!BluetoothAdapter.checkBluetoothAddress(address)) { address = ""; } + + final int a2dpCodec = btInfo.getCodec(); + AudioService.sDeviceLogger.log(new AudioEventLogger.StringEvent( "A2DP sink connected: device addr=" + address + " state=" + state + + " codec=" + a2dpCodec + " vol=" + a2dpVolume)); - final int a2dpCodec = btInfo.getCodec(); - synchronized (mConnectedDevices) { final String key = DeviceInfo.makeDeviceListKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, btDevice.getAddress()); final DeviceInfo di = mConnectedDevices.get(key); boolean isConnected = di != null; - if (isConnected && state != BluetoothProfile.STATE_CONNECTED) { - if (btDevice.isBluetoothDock()) { - if (state == BluetoothProfile.STATE_DISCONNECTED) { - // introduction of a delay for transient disconnections of docks when - // power is rapidly turned off/on, this message will be canceled if - // we reconnect the dock under a preset delay - makeA2dpDeviceUnavailableLater(address, - AudioDeviceBroker.BTA2DP_DOCK_TIMEOUT_MS); - // the next time isConnected is evaluated, it will be false for the dock + if (isConnected) { + if (state == BluetoothProfile.STATE_CONNECTED) { + // device is already connected, but we are receiving a connection again, + // it could be for a codec change + if (a2dpCodec != di.mDeviceCodecFormat) { + mDeviceBroker.postBluetoothA2dpDeviceConfigChange(btDevice); } } else { - makeA2dpDeviceUnavailableNow(address, di.mDeviceCodecFormat); + if (btDevice.isBluetoothDock()) { + if (state == BluetoothProfile.STATE_DISCONNECTED) { + // introduction of a delay for transient disconnections of docks when + // power is rapidly turned off/on, this message will be canceled if + // we reconnect the dock under a preset delay + makeA2dpDeviceUnavailableLater(address, + AudioDeviceBroker.BTA2DP_DOCK_TIMEOUT_MS); + // the next time isConnected is evaluated, it will be false for the dock + } + } else { + makeA2dpDeviceUnavailableNow(address, di.mDeviceCodecFormat); + } } } else if (!isConnected && state == BluetoothProfile.STATE_CONNECTED) { if (btDevice.isBluetoothDock()) { @@ -282,11 +306,9 @@ public final class AudioDeviceInventory { + " event=" + BtHelper.a2dpDeviceEventToString(event))); synchronized (mConnectedDevices) { - //TODO original CL is not consistent between BluetoothDevice and BluetoothA2dpDeviceInfo - // for this type of message if (mDeviceBroker.hasScheduledA2dpSinkConnectionState(btDevice)) { AudioService.sDeviceLogger.log(new AudioEventLogger.StringEvent( - "A2dp config change ignored")); + "A2dp config change ignored (scheduled connection change)")); return; } final String key = DeviceInfo.makeDeviceListKey( @@ -534,8 +556,10 @@ public final class AudioDeviceInventory { return mCurAudioRoutes; } + // only public for mocking/spying @GuardedBy("AudioDeviceBroker.mDeviceStateLock") - /*package*/ void setBluetoothA2dpDeviceConnectionState( + @VisibleForTesting + public void setBluetoothA2dpDeviceConnectionState( @NonNull BluetoothDevice device, @AudioService.BtProfileConnectionState int state, int profile, boolean suppressNoisyIntent, int musicDevice, int a2dpVolume) { int delay; @@ -544,9 +568,12 @@ public final class AudioDeviceInventory { } synchronized (mConnectedDevices) { if (profile == BluetoothProfile.A2DP && !suppressNoisyIntent) { - int intState = (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0; + @AudioService.ConnectionState int asState = + (state == BluetoothA2dp.STATE_CONNECTED) + ? AudioService.CONNECTION_STATE_CONNECTED + : AudioService.CONNECTION_STATE_DISCONNECTED; delay = checkSendBecomingNoisyIntentInt(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, - intState, musicDevice); + asState, musicDevice); } else { delay = 0; } @@ -785,7 +812,7 @@ public final class AudioDeviceInventory { return 0; } mDeviceBroker.postBroadcastBecomingNoisy(); - delay = 1000; + delay = AudioService.BECOMING_NOISY_DELAY_MS; } return delay; @@ -943,4 +970,21 @@ public final class AudioDeviceInventory { intent.putExtra(AudioManager.EXTRA_MAX_CHANNEL_COUNT, maxChannels); } } + + //---------------------------------------------------------- + // For tests only + + /** + * Check if device is in the list of connected devices + * @param device + * @return true if connected + */ + @VisibleForTesting + public boolean isA2dpDeviceConnected(@NonNull BluetoothDevice device) { + final String key = DeviceInfo.makeDeviceListKey(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, + device.getAddress()); + synchronized (mConnectedDevices) { + return (mConnectedDevices.get(key) != null); + } + } } diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 7e2dcae658af..6c56f8e5dbf6 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -134,6 +134,7 @@ import android.view.accessibility.AccessibilityManager; import android.widget.Toast; import com.android.internal.annotations.GuardedBy; +import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.DumpUtils; import com.android.internal.util.Preconditions; import com.android.internal.util.XmlUtils; @@ -201,6 +202,13 @@ public class AudioService extends IAudioService.Stub private static final int UNMUTE_STREAM_DELAY = 350; /** + * Delay before disconnecting a device that would cause BECOMING_NOISY intent to be sent, + * to give a chance to applications to pause. + */ + @VisibleForTesting + public static final int BECOMING_NOISY_DELAY_MS = 1000; + + /** * Only used in the result from {@link #checkForRingerModeChange(int, int, int)} */ private static final int FLAG_ADJUST_VOLUME = 1; @@ -4123,7 +4131,9 @@ public class AudioService extends IAudioService.Stub || adjust == AudioManager.ADJUST_TOGGLE_MUTE; } - /*package*/ boolean isInCommunication() { + /** only public for mocking/spying, do not call outside of AudioService */ + @VisibleForTesting + public boolean isInCommunication() { boolean IsInCall = false; TelecomManager telecomManager = @@ -4292,7 +4302,9 @@ public class AudioService extends IAudioService.Stub return false; } - /*package*/ int getDeviceForStream(int stream) { + /** only public for mocking/spying, do not call outside of AudioService */ + @VisibleForTesting + public int getDeviceForStream(int stream) { int device = getDevicesForStream(stream); if ((device & (device - 1)) != 0) { // Multiple device selection is either: @@ -4337,7 +4349,9 @@ public class AudioService extends IAudioService.Stub } } - /*package*/ void postObserveDevicesForAllStreams() { + /** only public for mocking/spying, do not call outside of AudioService */ + @VisibleForTesting + public void postObserveDevicesForAllStreams() { sendMsg(mAudioHandler, MSG_OBSERVE_DEVICES_FOR_ALL_STREAMS, SENDMSG_QUEUE, 0 /*arg1*/, 0 /*arg2*/, null /*obj*/, @@ -4448,7 +4462,9 @@ public class AudioService extends IAudioService.Stub AudioSystem.DEVICE_OUT_ALL_USB | AudioSystem.DEVICE_OUT_HDMI; - /*package*/ void postAccessoryPlugMediaUnmute(int newDevice) { + /** only public for mocking/spying, do not call outside of AudioService */ + @VisibleForTesting + public void postAccessoryPlugMediaUnmute(int newDevice) { sendMsg(mAudioHandler, MSG_ACCESSORY_PLUG_MEDIA_UNMUTE, SENDMSG_QUEUE, newDevice, 0, null, 0); } @@ -4998,7 +5014,9 @@ public class AudioService extends IAudioService.Stub } } - /*package*/ void postSetVolumeIndexOnDevice(int streamType, int vssVolIndex, int device, + /** only public for mocking/spying, do not call outside of AudioService */ + @VisibleForTesting + public void postSetVolumeIndexOnDevice(int streamType, int vssVolIndex, int device, String caller) { sendMsg(mAudioHandler, MSG_SET_DEVICE_STREAM_VOLUME, @@ -5579,7 +5597,9 @@ public class AudioService extends IAudioService.Stub * @return true if there is currently a registered dynamic mixing policy that affects media * and is not a render + loopback policy */ - /*package*/ boolean hasMediaDynamicPolicy() { + // only public for mocking/spying + @VisibleForTesting + public boolean hasMediaDynamicPolicy() { synchronized (mAudioPolicies) { if (mAudioPolicies.isEmpty()) { return false; @@ -5912,7 +5932,9 @@ public class AudioService extends IAudioService.Stub return mMediaFocusControl.getFocusRampTimeMs(focusGain, attr); } - /*package*/ boolean hasAudioFocusUsers() { + /** only public for mocking/spying, do not call outside of AudioService */ + @VisibleForTesting + public boolean hasAudioFocusUsers() { return mMediaFocusControl.hasAudioFocusUsers(); } diff --git a/services/core/java/com/android/server/audio/BtHelper.java b/services/core/java/com/android/server/audio/BtHelper.java index 1a63f8f51ee3..9f1a6bd15ac3 100644 --- a/services/core/java/com/android/server/audio/BtHelper.java +++ b/services/core/java/com/android/server/audio/BtHelper.java @@ -139,6 +139,12 @@ public class BtHelper { public int getCodec() { return mCodec; } + + // redefine equality op so we can match messages intended for this device + @Override + public boolean equals(Object o) { + return mBtDevice.equals(o); + } } // A2DP device events @@ -441,9 +447,9 @@ public class BtHelper { return; } final BluetoothDevice btDevice = deviceList.get(0); - final @BluetoothProfile.BtProfileState int state = mA2dp.getConnectionState(btDevice); - mDeviceBroker.handleSetA2dpSinkConnectionState( - state, new BluetoothA2dpDeviceInfo(btDevice)); + // the device is guaranteed CONNECTED + mDeviceBroker.postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(btDevice, + BluetoothA2dp.STATE_CONNECTED, BluetoothProfile.A2DP_SINK, true, -1); } /*package*/ synchronized void onA2dpSinkProfileConnected(BluetoothProfile profile) { diff --git a/services/core/java/com/android/server/biometrics/BiometricService.java b/services/core/java/com/android/server/biometrics/BiometricService.java index bd3cd5439b32..af2f24f959b4 100644 --- a/services/core/java/com/android/server/biometrics/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/BiometricService.java @@ -789,6 +789,23 @@ public class BiometricService extends SystemService { return error; } + @Override + public boolean hasEnrolledBiometrics(int userId) { + checkInternalPermission(); + + final long ident = Binder.clearCallingIdentity(); + try { + for (int i = 0; i < mAuthenticators.size(); i++) { + if (mAuthenticators.get(i).mAuthenticator.hasEnrolledTemplates(userId)) { + return true; + } + } + } finally { + Binder.restoreCallingIdentity(ident); + } + return false; + } + @Override // Binder call public void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback) throws RemoteException { diff --git a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java index 20eb6180832c..f3f9754bd32b 100644 --- a/services/core/java/com/android/server/biometrics/BiometricServiceBase.java +++ b/services/core/java/com/android/server/biometrics/BiometricServiceBase.java @@ -282,10 +282,10 @@ public abstract class BiometricServiceBase extends SystemService public EnrollClientImpl(Context context, DaemonWrapper daemon, long halDeviceId, IBinder token, ServiceListener listener, int userId, int groupId, byte[] cryptoToken, boolean restricted, String owner, - final int[] disabledFeatures) { + final int[] disabledFeatures, int timeoutSec) { super(context, getConstants(), daemon, halDeviceId, token, listener, userId, groupId, cryptoToken, restricted, owner, getBiometricUtils(), - disabledFeatures); + disabledFeatures, timeoutSec); } @Override @@ -912,8 +912,12 @@ public abstract class BiometricServiceBase extends SystemService } protected void setActiveUserInternal(int userId) { - // Do not put on handler, since it should finish before returning to caller. - updateActiveGroup(userId, null /* clientPackage */); + mHandler.post(() -> { + if (DEBUG) { + Slog.d(getTag(), "setActiveUser(" + userId + ")"); + } + updateActiveGroup(userId, null /* clientPackage */); + }); } protected void removeInternal(RemovalClient client) { diff --git a/services/core/java/com/android/server/biometrics/EnrollClient.java b/services/core/java/com/android/server/biometrics/EnrollClient.java index 854528f0654d..7ebb7c059b4c 100644 --- a/services/core/java/com/android/server/biometrics/EnrollClient.java +++ b/services/core/java/com/android/server/biometrics/EnrollClient.java @@ -31,11 +31,11 @@ import java.util.Arrays; * A class to keep track of the enrollment state for a given client. */ public abstract class EnrollClient extends ClientMonitor { - private static final long MS_PER_SEC = 1000; - private static final int ENROLLMENT_TIMEOUT_MS = 60 * 1000; // 1 minute private final byte[] mCryptoToken; private final BiometricUtils mBiometricUtils; private final int[] mDisabledFeatures; + private final int mTimeoutSec; + private long mEnrollmentStartTimeMs; public abstract boolean shouldVibrate(); @@ -44,12 +44,13 @@ public abstract class EnrollClient extends ClientMonitor { BiometricServiceBase.DaemonWrapper daemon, long halDeviceId, IBinder token, BiometricServiceBase.ServiceListener listener, int userId, int groupId, byte[] cryptoToken, boolean restricted, String owner, BiometricUtils utils, - final int[] disabledFeatures) { + final int[] disabledFeatures, int timeoutSec) { super(context, constants, daemon, halDeviceId, token, listener, userId, groupId, restricted, owner, 0 /* cookie */); mBiometricUtils = utils; mCryptoToken = Arrays.copyOf(cryptoToken, cryptoToken.length); mDisabledFeatures = Arrays.copyOf(disabledFeatures, disabledFeatures.length); + mTimeoutSec = timeoutSec; } @Override @@ -94,14 +95,13 @@ public abstract class EnrollClient extends ClientMonitor { @Override public int start() { mEnrollmentStartTimeMs = System.currentTimeMillis(); - final int timeout = (int) (ENROLLMENT_TIMEOUT_MS / MS_PER_SEC); try { final ArrayList<Integer> disabledFeatures = new ArrayList<>(); for (int i = 0; i < mDisabledFeatures.length; i++) { disabledFeatures.add(mDisabledFeatures[i]); } - final int result = getDaemonWrapper().enroll(mCryptoToken, getGroupId(), timeout, + final int result = getDaemonWrapper().enroll(mCryptoToken, getGroupId(), mTimeoutSec, disabledFeatures); if (result != 0) { Slog.w(getLogTag(), "startEnroll failed, result=" + result); diff --git a/services/core/java/com/android/server/biometrics/LoggableMonitor.java b/services/core/java/com/android/server/biometrics/LoggableMonitor.java index 6c7cbc166241..ecf3864e3362 100644 --- a/services/core/java/com/android/server/biometrics/LoggableMonitor.java +++ b/services/core/java/com/android/server/biometrics/LoggableMonitor.java @@ -93,7 +93,7 @@ public abstract class LoggableMonitor { statsAction(), statsClient(), acquiredInfo, - 0 /* vendorCode */, // Don't log vendorCode for now + vendorCode, Utils.isDebugEnabled(context, targetUserId)); } diff --git a/services/core/java/com/android/server/biometrics/face/FaceService.java b/services/core/java/com/android/server/biometrics/face/FaceService.java index a38abdc1bed0..a7065216f6a3 100644 --- a/services/core/java/com/android/server/biometrics/face/FaceService.java +++ b/services/core/java/com/android/server/biometrics/face/FaceService.java @@ -329,6 +329,7 @@ public class FaceService extends BiometricServiceBase { * Receives the incoming binder calls from FaceManager. */ private final class FaceServiceWrapper extends IFaceService.Stub { + private static final int ENROLL_TIMEOUT_SEC = 75; /** * The following methods contain common code which is shared in biometrics/common. @@ -343,16 +344,19 @@ public class FaceService extends BiometricServiceBase { @Override // Binder call public int revokeChallenge(IBinder token) { checkPermission(MANAGE_BIOMETRIC); - // TODO(b/137106905): Schedule binder calls in FaceService to avoid deadlocks. - if (getCurrentClient() == null) { - // if we aren't handling any other HIDL calls (mCurrentClient == null), revoke the - // challenge right away. - return startRevokeChallenge(token); - } else { - // postpone revoking the challenge until we finish processing the current HIDL call. - mRevokeChallengePending = true; - return Status.OK; - } + mHandler.post(() -> { + // TODO(b/137106905): Schedule binder calls in FaceService to avoid deadlocks. + if (getCurrentClient() == null) { + // if we aren't handling any other HIDL calls (mCurrentClient == null), revoke + // the challenge right away. + startRevokeChallenge(token); + } else { + // postpone revoking the challenge until we finish processing the current HIDL + // call. + mRevokeChallengePending = true; + } + }); + return Status.OK; } @Override // Binder call @@ -368,7 +372,8 @@ public class FaceService extends BiometricServiceBase { final boolean restricted = isRestricted(); final EnrollClientImpl client = new EnrollClientImpl(getContext(), mDaemonWrapper, mHalDeviceId, token, new ServiceListenerImpl(receiver), mCurrentUserId, - 0 /* groupId */, cryptoToken, restricted, opPackageName, disabledFeatures) { + 0 /* groupId */, cryptoToken, restricted, opPackageName, disabledFeatures, + ENROLL_TIMEOUT_SEC) { @Override public int[] getAcquireIgnorelist() { @@ -609,27 +614,32 @@ public class FaceService extends BiometricServiceBase { public void resetLockout(byte[] token) { checkPermission(MANAGE_BIOMETRIC); - if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) { - Slog.w(TAG, "Ignoring lockout reset, no templates enrolled"); - return; - } + mHandler.post(() -> { + if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) { + Slog.w(TAG, "Ignoring lockout reset, no templates enrolled"); + return; + } - Slog.d(TAG, "Resetting lockout for user: " + mCurrentUserId); + Slog.d(TAG, "Resetting lockout for user: " + mCurrentUserId); - try { - mDaemonWrapper.resetLockout(token); - } catch (RemoteException e) { - Slog.e(getTag(), "Unable to reset lockout", e); - } + try { + mDaemonWrapper.resetLockout(token); + } catch (RemoteException e) { + Slog.e(getTag(), "Unable to reset lockout", e); + } + }); } @Override public void setFeature(int userId, int feature, boolean enabled, final byte[] token, IFaceServiceReceiver receiver, final String opPackageName) { checkPermission(MANAGE_BIOMETRIC); - updateActiveGroup(userId, opPackageName); mHandler.post(() -> { + if (DEBUG) { + Slog.d(TAG, "setFeature for user(" + userId + ")"); + } + updateActiveGroup(userId, opPackageName); if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) { Slog.e(TAG, "No enrolled biometrics while setting feature: " + feature); return; @@ -660,9 +670,12 @@ public class FaceService extends BiometricServiceBase { public void getFeature(int userId, int feature, IFaceServiceReceiver receiver, final String opPackageName) { checkPermission(MANAGE_BIOMETRIC); - updateActiveGroup(userId, opPackageName); mHandler.post(() -> { + if (DEBUG) { + Slog.d(TAG, "getFeature for user(" + userId + ")"); + } + updateActiveGroup(userId, opPackageName); // This should ideally return tri-state, but the user isn't shown settings unless // they are enrolled so it's fine for now. if (!FaceService.this.hasEnrolledBiometrics(mCurrentUserId)) { diff --git a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java index 28336f459863..320e1022873c 100644 --- a/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java +++ b/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java @@ -176,6 +176,7 @@ public class FingerprintService extends BiometricServiceBase { * Receives the incoming binder calls from FingerprintManager. */ private final class FingerprintServiceWrapper extends IFingerprintService.Stub { + private static final int ENROLL_TIMEOUT_SEC = 60; /** * The following methods contain common code which is shared in biometrics/common. @@ -203,7 +204,8 @@ public class FingerprintService extends BiometricServiceBase { final int groupId = userId; // default group for fingerprint enrollment final EnrollClientImpl client = new EnrollClientImpl(getContext(), mDaemonWrapper, mHalDeviceId, token, new ServiceListenerImpl(receiver), mCurrentUserId, groupId, - cryptoToken, restricted, opPackageName, new int[0] /* disabledFeatures */) { + cryptoToken, restricted, opPackageName, new int[0] /* disabledFeatures */, + ENROLL_TIMEOUT_SEC) { @Override public boolean shouldVibrate() { return true; diff --git a/services/core/java/com/android/server/camera/CameraServiceProxy.java b/services/core/java/com/android/server/camera/CameraServiceProxy.java index 8de259516890..b46f0348bd14 100644 --- a/services/core/java/com/android/server/camera/CameraServiceProxy.java +++ b/services/core/java/com/android/server/camera/CameraServiceProxy.java @@ -15,6 +15,7 @@ */ package com.android.server.camera; +import android.annotation.IntDef; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -44,6 +45,8 @@ import com.android.server.ServiceThread; import com.android.server.SystemService; import com.android.server.wm.WindowManagerInternal; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -100,7 +103,26 @@ public class CameraServiceProxy extends SystemService private static final String NFC_SERVICE_BINDER_NAME = "nfc"; private static final IBinder nfcInterfaceToken = new Binder(); - private final boolean mNotifyNfc; + // Valid values for NFC_NOTIFICATION_PROP + // Do not disable active NFC for any camera use + private static final int NFC_NOTIFY_NONE = 0; + // Always disable active NFC for any camera use + private static final int NFC_NOTIFY_ALL = 1; + // Disable active NFC only for back-facing cameras + private static final int NFC_NOTIFY_BACK = 2; + // Disable active NFC only for front-facing cameras + private static final int NFC_NOTIFY_FRONT = 3; + + @Retention(RetentionPolicy.SOURCE) + @IntDef(prefix = {"NFC_"}, value = + {NFC_NOTIFY_NONE, + NFC_NOTIFY_ALL, + NFC_NOTIFY_BACK, + NFC_NOTIFY_FRONT}) + private @interface NfcNotifyState {}; + + private final @NfcNotifyState int mNotifyNfc; + private boolean mLastNfcPollState = true; /** * Structure to track camera usage @@ -202,8 +224,12 @@ public class CameraServiceProxy extends SystemService mHandlerThread.start(); mHandler = new Handler(mHandlerThread.getLooper(), this); - mNotifyNfc = SystemProperties.getInt(NFC_NOTIFICATION_PROP, 0) > 0; - if (DEBUG) Slog.v(TAG, "Notify NFC behavior is " + (mNotifyNfc ? "active" : "disabled")); + int notifyNfc = SystemProperties.getInt(NFC_NOTIFICATION_PROP, 0); + if (notifyNfc < NFC_NOTIFY_NONE || notifyNfc > NFC_NOTIFY_FRONT) { + notifyNfc = NFC_NOTIFY_NONE; + } + mNotifyNfc = notifyNfc; + if (DEBUG) Slog.v(TAG, "Notify NFC state is " + nfcNotifyToString(mNotifyNfc)); } @Override @@ -270,12 +296,10 @@ public class CameraServiceProxy extends SystemService mCameraServiceRaw = null; // All cameras reset to idle on camera service death - boolean wasEmpty = mActiveCameraUsage.isEmpty(); mActiveCameraUsage.clear(); - if ( mNotifyNfc && !wasEmpty ) { - notifyNfcService(/*enablePolling*/ true); - } + // Ensure NFC is back on + notifyNfcService(/*enablePolling*/ true); } } @@ -474,14 +498,32 @@ public class CameraServiceProxy extends SystemService break; } - boolean isEmpty = mActiveCameraUsage.isEmpty(); - if ( mNotifyNfc && (wasEmpty != isEmpty) ) { - notifyNfcService(isEmpty); + switch (mNotifyNfc) { + case NFC_NOTIFY_NONE: + break; + case NFC_NOTIFY_ALL: + notifyNfcService(mActiveCameraUsage.isEmpty()); + break; + case NFC_NOTIFY_BACK: + case NFC_NOTIFY_FRONT: + boolean enablePolling = true; + int targetFacing = mNotifyNfc == NFC_NOTIFY_BACK + ? ICameraServiceProxy.CAMERA_FACING_BACK : + ICameraServiceProxy.CAMERA_FACING_FRONT; + for (int i = 0; i < mActiveCameraUsage.size(); i++) { + if (mActiveCameraUsage.valueAt(i).mCameraFacing == targetFacing) { + enablePolling = false; + break; + } + } + notifyNfcService(enablePolling); + break; } } } private void notifyNfcService(boolean enablePolling) { + if (enablePolling == mLastNfcPollState) return; IBinder nfcServiceBinder = getBinderService(NFC_SERVICE_BINDER_NAME); if (nfcServiceBinder == null) { @@ -490,9 +532,14 @@ public class CameraServiceProxy extends SystemService } INfcAdapter nfcAdapterRaw = INfcAdapter.Stub.asInterface(nfcServiceBinder); int flags = enablePolling ? ENABLE_POLLING_FLAGS : DISABLE_POLLING_FLAGS; - if (DEBUG) Slog.v(TAG, "Setting NFC reader mode to flags " + flags); + if (DEBUG) { + Slog.v(TAG, "Setting NFC reader mode to flags " + flags + + " to turn polling " + enablePolling); + } + try { nfcAdapterRaw.setReaderMode(nfcInterfaceToken, null, flags, null); + mLastNfcPollState = enablePolling; } catch (RemoteException e) { Slog.w(TAG, "Could not notify NFC service, remote exception: " + e); } @@ -529,4 +576,13 @@ public class CameraServiceProxy extends SystemService return "CAMERA_FACING_UNKNOWN"; } + private static String nfcNotifyToString(@NfcNotifyState int nfcNotifyState) { + switch (nfcNotifyState) { + case NFC_NOTIFY_NONE: return "NFC_NOTIFY_NONE"; + case NFC_NOTIFY_ALL: return "NFC_NOTIFY_ALL"; + case NFC_NOTIFY_BACK: return "NFC_NOTIFY_BACK"; + case NFC_NOTIFY_FRONT: return "NFC_NOTIFY_FRONT"; + } + return "UNKNOWN_NFC_NOTIFY"; + } } diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java index 4957eed21c70..73d160d8c444 100644 --- a/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java @@ -772,7 +772,6 @@ public class Tethering extends BaseNetworkObserver { case WifiManager.WIFI_AP_STATE_FAILED: default: disableWifiIpServingLocked(ifname, curState); - mEntitlementMgr.stopProvisioningIfNeeded(TETHERING_WIFI); break; } } diff --git a/services/core/java/com/android/server/display/ColorFade.java b/services/core/java/com/android/server/display/ColorFade.java index 36d9c0e4478e..f61306405daa 100644 --- a/services/core/java/com/android/server/display/ColorFade.java +++ b/services/core/java/com/android/server/display/ColorFade.java @@ -29,6 +29,7 @@ import android.opengl.GLES11Ext; import android.opengl.GLES20; import android.os.IBinder; import android.util.Slog; +import android.view.Display; import android.view.DisplayInfo; import android.view.Surface; import android.view.Surface.OutOfResourcesException; @@ -72,6 +73,9 @@ final class ColorFade { // See code for details. private static final int DEJANK_FRAMES = 3; + private static final int EGL_GL_COLORSPACE_KHR = 0x309D; + private static final int EGL_GL_COLORSPACE_DISPLAY_P3_PASSTHROUGH_EXT = 0x3490; + private final int mDisplayId; // Set to true when the animation context has been fully prepared. @@ -93,6 +97,7 @@ final class ColorFade { private EGLSurface mEglSurface; private boolean mSurfaceVisible; private float mSurfaceAlpha; + private boolean mIsWideColor; // Texture names. We only use one texture, which contains the screenshot. private final int[] mTexNames = new int[1]; @@ -482,6 +487,8 @@ final class ColorFade { return false; } + mIsWideColor = SurfaceControl.getActiveColorMode(token) + == Display.COLOR_MODE_DISPLAY_P3; SurfaceControl.screenshot(token, s); st.updateTexImage(); st.getTransformMatrix(mTexMatrix); @@ -608,8 +615,16 @@ final class ColorFade { private boolean createEglSurface() { if (mEglSurface == null) { int[] eglSurfaceAttribList = new int[] { + EGL14.EGL_NONE, + EGL14.EGL_NONE, EGL14.EGL_NONE }; + + // If the current display is in wide color, then so is the screenshot. + if (mIsWideColor) { + eglSurfaceAttribList[0] = EGL_GL_COLORSPACE_KHR; + eglSurfaceAttribList[1] = EGL_GL_COLORSPACE_DISPLAY_P3_PASSTHROUGH_EXT; + } // turn our SurfaceControl into a Surface mEglSurface = EGL14.eglCreateWindowSurface(mEglDisplay, mEglConfig, mSurface, eglSurfaceAttribList, 0); diff --git a/services/core/java/com/android/server/display/DisplayModeDirector.java b/services/core/java/com/android/server/display/DisplayModeDirector.java index 78a48dac6fb5..c45a314e39cc 100644 --- a/services/core/java/com/android/server/display/DisplayModeDirector.java +++ b/services/core/java/com/android/server/display/DisplayModeDirector.java @@ -728,6 +728,7 @@ public class DisplayModeDirector { private SensorManager mSensorManager; private Sensor mLightSensor; + private LightSensorEventListener mLightSensorListener = new LightSensorEventListener(); // Take it as low brightness before valid sensor data comes private float mAmbientLux = -1.0f; private AmbientFilter mAmbientFilter; @@ -907,19 +908,40 @@ public class DisplayModeDirector { mSensorManager.registerListener(mLightSensorListener, mLightSensor, LIGHT_SENSOR_RATE_MS * 1000, mHandler); } else { + mLightSensorListener.removeCallbacks(); mSensorManager.unregisterListener(mLightSensorListener); } } - private final SensorEventListener mLightSensorListener = new SensorEventListener() { + private final class LightSensorEventListener implements SensorEventListener { + final private static int INJECT_EVENTS_INTERVAL_MS = LIGHT_SENSOR_RATE_MS; + private float mLastSensorData; + @Override public void onSensorChanged(SensorEvent event) { + mLastSensorData = event.values[0]; + if (DEBUG) { + Slog.d(TAG, "On sensor changed: " + mLastSensorData); + } + + boolean zoneChanged = isDifferentZone(mLastSensorData, mAmbientLux); + if (zoneChanged && mLastSensorData < mAmbientLux) { + // Easier to see flicker at lower brightness environment. Forget the history to + // get immediate response. + mAmbientFilter.clear(); + } + long now = SystemClock.uptimeMillis(); - mAmbientFilter.addValue(now, event.values[0]); - mAmbientLux = mAmbientFilter.getEstimate(now); + mAmbientFilter.addValue(now, mLastSensorData); - synchronized (mLock) { - onBrightnessChangedLocked(); + mHandler.removeCallbacks(mInjectSensorEventRunnable); + processSensorData(now); + + if (zoneChanged && mLastSensorData > mAmbientLux) { + // Sensor may not report new event if there is no brightness change. + // Need to keep querying the temporal filter for the latest estimation, + // until enter in higher lux zone or is interrupted by a new sensor event. + mHandler.postDelayed(mInjectSensorEventRunnable, INJECT_EVENTS_INTERVAL_MS); } } @@ -927,6 +949,47 @@ public class DisplayModeDirector { public void onAccuracyChanged(Sensor sensor, int accuracy) { // Not used. } + + public void removeCallbacks() { + mHandler.removeCallbacks(mInjectSensorEventRunnable); + } + + private void processSensorData(long now) { + mAmbientLux = mAmbientFilter.getEstimate(now); + + synchronized (mLock) { + onBrightnessChangedLocked(); + } + } + + private boolean isDifferentZone(float lux1, float lux2) { + for (int z = 0; z < mAmbientBrightnessThresholds.length; z++) { + final float boundary = mAmbientBrightnessThresholds[z]; + + // Test each boundary. See if the current value and the new value are at + // different sides. + if ((lux1 <= boundary && lux2 > boundary) + || (lux1 > boundary && lux2 <= boundary)) { + return true; + } + } + + return false; + } + + private Runnable mInjectSensorEventRunnable = new Runnable() { + @Override + public void run() { + long now = SystemClock.uptimeMillis(); + // No need to really inject the last event into a temporal filter. + processSensorData(now); + + // Inject next event if there is a possible zone change. + if (isDifferentZone(mLastSensorData, mAmbientLux)) { + mHandler.postDelayed(mInjectSensorEventRunnable, INJECT_EVENTS_INTERVAL_MS); + } + } + }; }; private final class ScreenStateReceiver extends BroadcastReceiver { diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java index 433ce811c8d7..9510db09aa25 100644 --- a/services/core/java/com/android/server/locksettings/LockSettingsService.java +++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java @@ -446,7 +446,7 @@ public class LockSettingsService extends ILockSettings.Stub { public boolean hasEnrolledBiometrics(int userId) { BiometricManager bm = mContext.getSystemService(BiometricManager.class); - return bm.canAuthenticate(userId) == BiometricManager.BIOMETRIC_SUCCESS; + return bm.hasEnrolledBiometrics(userId); } public int binderGetCallingUid() { diff --git a/services/core/java/com/android/server/locksettings/LockSettingsStorage.java b/services/core/java/com/android/server/locksettings/LockSettingsStorage.java index f0e431ee0354..84ae7c790a74 100644 --- a/services/core/java/com/android/server/locksettings/LockSettingsStorage.java +++ b/services/core/java/com/android/server/locksettings/LockSettingsStorage.java @@ -48,6 +48,8 @@ import java.io.DataOutputStream; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; +import java.nio.channels.FileChannel; +import java.nio.file.StandardOpenOption; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -390,6 +392,17 @@ class LockSettingsStorage { return stored; } + private void fsyncDirectory(File directory) { + try { + try (FileChannel file = FileChannel.open(directory.toPath(), + StandardOpenOption.READ)) { + file.force(true); + } + } catch (IOException e) { + Slog.e(TAG, "Error syncing directory: " + directory, e); + } + } + private void writeFile(String name, byte[] hash) { synchronized (mFileWriteLock) { RandomAccessFile raf = null; @@ -406,6 +419,7 @@ class LockSettingsStorage { raf.write(hash, 0, hash.length); } raf.close(); + fsyncDirectory((new File(name)).getAbsoluteFile().getParentFile()); } catch (IOException e) { Slog.e(TAG, "Error writing to file " + e); } finally { diff --git a/services/core/java/com/android/server/locksettings/recoverablekeystore/PlatformKeyManager.java b/services/core/java/com/android/server/locksettings/recoverablekeystore/PlatformKeyManager.java index c54bfc01e031..0ad6c2a69556 100644 --- a/services/core/java/com/android/server/locksettings/recoverablekeystore/PlatformKeyManager.java +++ b/services/core/java/com/android/server/locksettings/recoverablekeystore/PlatformKeyManager.java @@ -19,6 +19,7 @@ package com.android.server.locksettings.recoverablekeystore; import android.app.KeyguardManager; import android.content.Context; import android.os.RemoteException; +import android.os.UserHandle; import android.security.GateKeeper; import android.security.keystore.AndroidKeyStoreSecretKey; import android.security.keystore.KeyPermanentlyInvalidatedException; @@ -437,25 +438,31 @@ public class PlatformKeyManager { // so it may live in memory for some time. SecretKey secretKey = generateAesKey(); - long secureUserId = getGateKeeperService().getSecureUserId(userId); - // TODO(b/124095438): Propagate this failure instead of silently failing. - if (secureUserId == GateKeeper.INVALID_SECURE_USER_ID) { - Log.e(TAG, "No SID available for user " + userId); - return; - } - - // Store decryption key first since it is more likely to fail. - mKeyStore.setEntry( - decryptAlias, - new KeyStore.SecretKeyEntry(secretKey), + KeyProtection.Builder decryptionKeyProtection = new KeyProtection.Builder(KeyProperties.PURPOSE_DECRYPT) .setUserAuthenticationRequired(true) .setUserAuthenticationValidityDurationSeconds( USER_AUTHENTICATION_VALIDITY_DURATION_SECONDS) .setBlockModes(KeyProperties.BLOCK_MODE_GCM) - .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE) + .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE); + if (userId != UserHandle.USER_SYSTEM) { + // Bind decryption key to secondary profile lock screen secret. + long secureUserId = getGateKeeperService().getSecureUserId(userId); + // TODO(b/124095438): Propagate this failure instead of silently failing. + if (secureUserId == GateKeeper.INVALID_SECURE_USER_ID) { + Log.e(TAG, "No SID available for user " + userId); + return; + } + decryptionKeyProtection .setBoundToSpecificSecureUserId(secureUserId) - .build()); + // Ignore caller uid which always belongs to the primary profile. + .setCriticalToDeviceEncryption(true); + } + // Store decryption key first since it is more likely to fail. + mKeyStore.setEntry( + decryptAlias, + new KeyStore.SecretKeyEntry(secretKey), + decryptionKeyProtection.build()); mKeyStore.setEntry( encryptAlias, new KeyStore.SecretKeyEntry(secretKey), diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java index c2e559a8a96b..3c2169a446a1 100644 --- a/services/core/java/com/android/server/notification/NotificationRecord.java +++ b/services/core/java/com/android/server/notification/NotificationRecord.java @@ -34,11 +34,8 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; -import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManagerInternal; -import android.content.res.Resources; import android.graphics.Bitmap; -import android.graphics.drawable.Icon; import android.media.AudioAttributes; import android.media.AudioSystem; import android.metrics.LogMaker; @@ -453,16 +450,11 @@ public final class NotificationRecord { void dump(PrintWriter pw, String prefix, Context baseContext, boolean redact) { final Notification notification = sbn.getNotification(); - final Icon icon = notification.getSmallIcon(); - String iconStr = String.valueOf(icon); - if (icon != null && icon.getType() == Icon.TYPE_RESOURCE) { - iconStr += " / " + idDebugString(baseContext, icon.getResPackage(), icon.getResId()); - } pw.println(prefix + this); prefix = prefix + " "; pw.println(prefix + "uid=" + sbn.getUid() + " userId=" + sbn.getUserId()); pw.println(prefix + "opPkg=" + sbn.getOpPkg()); - pw.println(prefix + "icon=" + iconStr); + pw.println(prefix + "icon=" + notification.getSmallIcon()); pw.println(prefix + "flags=0x" + Integer.toHexString(notification.flags)); pw.println(prefix + "pri=" + notification.priority); pw.println(prefix + "key=" + sbn.getKey()); @@ -592,28 +584,6 @@ public final class NotificationRecord { pw.println(prefix + "mAdjustments=" + mAdjustments); } - - static String idDebugString(Context baseContext, String packageName, int id) { - Context c; - - if (packageName != null) { - try { - c = baseContext.createPackageContext(packageName, 0); - } catch (NameNotFoundException e) { - c = baseContext; - } - } else { - c = baseContext; - } - - Resources r = c.getResources(); - try { - return r.getResourceName(id); - } catch (Resources.NotFoundException e) { - return "<name unknown>"; - } - } - @Override public final String toString() { return String.format( diff --git a/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java b/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java index 6f28675d051b..934511bf88d1 100644 --- a/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java +++ b/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java @@ -296,22 +296,12 @@ final class OverlayManagerServiceImpl { */ private void updateAndRefreshOverlaysForTarget(@NonNull final String targetPackageName, final int userId, final int flags) { - final List<OverlayInfo> ois = new ArrayList<>(); - - // Framework overlays added first because order matters when resolving a resource - if (!"android".equals(targetPackageName)) { - ois.addAll(mSettings.getOverlaysForTarget("android", userId)); - } - - // Then add the targeted, non-framework overlays which have higher priority - ois.addAll(mSettings.getOverlaysForTarget(targetPackageName, userId)); - - final List<String> enabledBaseCodePaths = new ArrayList<>(ois.size()); + final List<OverlayInfo> targetOverlays = mSettings.getOverlaysForTarget(targetPackageName, + userId); + // Update the state for any overlay that targets this package. boolean modified = false; - final int n = ois.size(); - for (int i = 0; i < n; i++) { - final OverlayInfo oi = ois.get(i); + for (final OverlayInfo oi : targetOverlays) { final PackageInfo overlayPackage = mPackageManager.getPackageInfo(oi.packageName, userId); if (overlayPackage == null) { @@ -324,25 +314,39 @@ final class OverlayManagerServiceImpl { Slog.e(TAG, "failed to update settings", e); modified |= mSettings.remove(oi.packageName, userId); } - - if (oi.isEnabled() && overlayPackage.applicationInfo != null) { - enabledBaseCodePaths.add(overlayPackage.applicationInfo.getBaseCodePath()); - } } } if (!modified) { + // Update the overlay paths of the target within package manager if necessary. + final List<String> enabledOverlayPaths = new ArrayList<>(targetOverlays.size()); + + // Framework overlays are first in the overlay paths of a package within PackageManager. + for (final OverlayInfo oi : mSettings.getOverlaysForTarget("android", userId)) { + if (oi.isEnabled()) { + enabledOverlayPaths.add(oi.baseCodePath); + } + } + + for (final OverlayInfo oi : targetOverlays) { + if (oi.isEnabled()) { + enabledOverlayPaths.add(oi.baseCodePath); + } + } + + // TODO(): Use getEnabledOverlayPaths(userId, targetPackageName) instead of + // resourceDirs if in the future resourceDirs contains APKs other than overlays PackageInfo packageInfo = mPackageManager.getPackageInfo(targetPackageName, userId); ApplicationInfo appInfo = packageInfo == null ? null : packageInfo.applicationInfo; String[] resourceDirs = appInfo == null ? null : appInfo.resourceDirs; // If the lists aren't the same length, the enabled overlays have changed - if (ArrayUtils.size(resourceDirs) != enabledBaseCodePaths.size()) { + if (ArrayUtils.size(resourceDirs) != enabledOverlayPaths.size()) { modified = true; } else if (resourceDirs != null) { // If any element isn't equal, an overlay or the order of overlays has changed for (int index = 0; index < resourceDirs.length; index++) { - if (!resourceDirs[index].equals(enabledBaseCodePaths.get(index))) { + if (!resourceDirs[index].equals(enabledOverlayPaths.get(index))) { modified = true; break; } diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 7fce4453b768..7cbf919b3d00 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -319,6 +319,8 @@ import com.android.server.pm.permission.PermissionManagerService; import com.android.server.pm.permission.PermissionManagerServiceInternal; import com.android.server.pm.permission.PermissionManagerServiceInternal.PermissionCallback; import com.android.server.pm.permission.PermissionsState; +import com.android.server.policy.PermissionPolicyInternal; +import com.android.server.policy.PermissionPolicyInternal.OnInitializedCallback; import com.android.server.security.VerityUtils; import com.android.server.storage.DeviceStorageMonitorInternal; import com.android.server.wm.ActivityTaskManagerInternal; @@ -17035,11 +17037,6 @@ public class PackageManagerService extends IPackageManager.Stub commitPackagesLocked(commitRequest); success = true; } finally { - for (PrepareResult result : prepareResults.values()) { - if (result.freezer != null) { - result.freezer.close(); - } - } Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER); } } @@ -19865,6 +19862,9 @@ public class PackageManagerService extends IPackageManager.Stub } }; + final AppOpsManager appOpsManager = mContext.getSystemService(AppOpsManager.class); + final int uid = UserHandle.getUid(userId, ps.pkg.applicationInfo.uid); + final int permissionCount = ps.pkg.requestedPermissions.size(); for (int i = 0; i < permissionCount; i++) { final String permName = ps.pkg.requestedPermissions.get(i); @@ -19924,6 +19924,14 @@ public class PackageManagerService extends IPackageManager.Stub if ((oldFlags & FLAG_PERMISSION_GRANTED_BY_DEFAULT) != 0) { mPermissionManager.grantRuntimePermission(permName, packageName, false, Process.SYSTEM_UID, userId, delayingPermCallback); + // Allow app op later as we are holding mPackages + // PermissionPolicyService will handle the app op for foreground/background + // permissions. + String appOp = AppOpsManager.permissionToOp(permName); + if (appOp != null) { + mHandler.post(() -> appOpsManager.setUidMode(appOp, uid, + AppOpsManager.MODE_ALLOWED)); + } // If permission review is enabled the permissions for a legacy apps // are represented as constantly granted runtime ones, so don't revoke. } else if ((flags & FLAG_PERMISSION_REVIEW_REQUIRED) == 0) { @@ -21633,6 +21641,17 @@ public class PackageManagerService extends IPackageManager.Stub mPermissionManager.updateAllPermissions( StorageManager.UUID_PRIVATE_INTERNAL, false, mPackages.values(), mPermissionCallback); + + final PermissionPolicyInternal permissionPolicyInternal = + LocalServices.getService(PermissionPolicyInternal.class); + permissionPolicyInternal.setOnInitializedCallback(userId -> { + // The SDK updated case is already handled when we run during the ctor. + synchronized (mPackages) { + mPermissionManager.updateAllPermissions( + StorageManager.UUID_PRIVATE_INTERNAL, false /*sdkUpdated*/, + mPackages.values(), mPermissionCallback); + } + }); } // Watch for external volumes that come and go over time diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java index f8c4f6b2cdba..4550446f88c5 100644 --- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java +++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java @@ -1170,6 +1170,11 @@ public final class DefaultPermissionGrantPolicy { final int flags = mContext.getPackageManager().getPermissionFlags( permission, pkg.packageName, user); + // If we are trying to grant as system fixed and already system fixed + // then the system can change the system fixed grant state. + final boolean changingGrantForSystemFixed = systemFixed + && (flags & PackageManager.FLAG_PERMISSION_SYSTEM_FIXED) != 0; + // Certain flags imply that the permission's current state by the system or // device/profile owner or the user. In these cases we do not want to clobber the // current state. @@ -1177,7 +1182,8 @@ public final class DefaultPermissionGrantPolicy { // Unless the caller wants to override user choices. The override is // to make sure we can grant the needed permission to the default // sms and phone apps after the user chooses this in the UI. - if (!isFixedOrUserSet(flags) || ignoreSystemPackage) { + if (!isFixedOrUserSet(flags) || ignoreSystemPackage + || changingGrantForSystemFixed) { // Never clobber policy fixed permissions. // We must allow the grant of a system-fixed permission because // system-fixed is sticky, but the permission itself may be revoked. @@ -1196,6 +1202,14 @@ public final class DefaultPermissionGrantPolicy { PackageManager.FLAG_PERMISSION_RESTRICTION_SYSTEM_EXEMPT, user); } + // If the system tries to change a system fixed permission from one fixed + // state to another we need to drop the fixed flag to allow the grant. + if (changingGrantForSystemFixed) { + mContext.getPackageManager().updatePermissionFlags(permission, + pkg.packageName, flags, + flags & ~PackageManager.FLAG_PERMISSION_SYSTEM_FIXED, user); + } + if (pm.checkPermission(permission, pkg.packageName) != PackageManager.PERMISSION_GRANTED) { mContext.getPackageManager() diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java index d3e5df5d62d1..899f8022dc8d 100644 --- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java +++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java @@ -97,6 +97,7 @@ import com.android.server.pm.SharedUserSetting; import com.android.server.pm.UserManagerService; import com.android.server.pm.permission.PermissionManagerServiceInternal.PermissionCallback; import com.android.server.pm.permission.PermissionsState.PermissionState; +import com.android.server.policy.PermissionPolicyInternal; import com.android.server.policy.SoftRestrictedPermissionPolicy; import libcore.util.EmptyArray; @@ -197,6 +198,9 @@ public class PermissionManagerService { @GuardedBy("mLock") private boolean mSystemReady; + @GuardedBy("mLock") + private PermissionPolicyInternal mPermissionPolicyInternal; + /** * For each foreground/background permission the mapping: * Background permission -> foreground permissions @@ -1080,6 +1084,13 @@ public class PermissionManagerService { boolean softRestricted = bp.isSoftRestricted(); for (int userId : currentUserIds) { + // If permission policy is not ready we don't deal with restricted + // permissions as the policy may whitelist some permissions. Once + // the policy is initialized we would re-evaluate permissions. + final boolean permissionPolicyInitialized = + mPermissionPolicyInternal != null + && mPermissionPolicyInternal.isInitialized(userId); + PermissionState permState = origPermissions .getRuntimePermissionState(perm, userId); int flags = permState != null ? permState.getFlags() : 0; @@ -1094,7 +1105,7 @@ public class PermissionManagerService { if (appSupportsRuntimePermissions) { // If hard restricted we don't allow holding it - if (hardRestricted) { + if (permissionPolicyInitialized && hardRestricted) { if (!restrictionExempt) { if (permState != null && permState.isGranted() && permissionsState.revokeRuntimePermission( @@ -1107,7 +1118,7 @@ public class PermissionManagerService { } } // If soft restricted we allow holding in a restricted form - } else if (softRestricted) { + } else if (permissionPolicyInitialized && softRestricted) { // Regardless if granted set the restriction flag as it // may affect app treatment based on this permission. if (!restrictionExempt && !restrictionApplied) { @@ -1126,7 +1137,8 @@ public class PermissionManagerService { flags &= ~FLAG_PERMISSION_REVOKE_ON_UPGRADE; wasChanged = true; // Hard restricted permissions cannot be held. - } else if (!hardRestricted || restrictionExempt) { + } else if (!permissionPolicyInitialized + || (!hardRestricted || restrictionExempt)) { if (permState != null && permState.isGranted()) { if (permissionsState.grantRuntimePermission(bp, userId) == PERMISSION_OPERATION_FAILURE) { @@ -1155,33 +1167,28 @@ public class PermissionManagerService { // If legacy app always grant the permission but if restricted // and not exempt take a note a restriction should be applied. - if ((hardRestricted || softRestricted) - && !restrictionExempt && !restrictionApplied) { + if (permissionPolicyInitialized + && (hardRestricted || softRestricted) + && !restrictionExempt && !restrictionApplied) { flags |= FLAG_PERMISSION_APPLY_RESTRICTION; wasChanged = true; } } // If unrestricted or restriction exempt, don't apply restriction. - if (!(hardRestricted || softRestricted) || restrictionExempt) { - if (restrictionApplied) { - flags &= ~FLAG_PERMISSION_APPLY_RESTRICTION; - // Dropping restriction on a legacy app requires a review. - if (!appSupportsRuntimePermissions) { - flags |= FLAG_PERMISSION_REVIEW_REQUIRED; + if (permissionPolicyInitialized) { + if (!(hardRestricted || softRestricted) || restrictionExempt) { + if (restrictionApplied) { + flags &= ~FLAG_PERMISSION_APPLY_RESTRICTION; + // Dropping restriction on a legacy app implies a review + if (!appSupportsRuntimePermissions) { + flags |= FLAG_PERMISSION_REVIEW_REQUIRED; + } + wasChanged = true; } - wasChanged = true; } } - if (hardRestricted && !restrictionExempt - && (flags & FLAG_PERMISSION_SYSTEM_FIXED) != 0) { - // Applying a hard restriction implies revoking it. This might - // lead to a system-fixed, revoked permission. - flags &= ~FLAG_PERMISSION_SYSTEM_FIXED; - wasChanged = true; - } - if (wasChanged) { updatedUserIds = ArrayUtils.appendInt(updatedUserIds, userId); } @@ -1216,6 +1223,13 @@ public class PermissionManagerService { boolean softRestricted = bp.isSoftRestricted(); for (int userId : currentUserIds) { + // If permission policy is not ready we don't deal with restricted + // permissions as the policy may whitelist some permissions. Once + // the policy is initialized we would re-evaluate permissions. + final boolean permissionPolicyInitialized = + mPermissionPolicyInternal != null + && mPermissionPolicyInternal.isInitialized(userId); + boolean wasChanged = false; boolean restrictionExempt = @@ -1226,7 +1240,7 @@ public class PermissionManagerService { if (appSupportsRuntimePermissions) { // If hard restricted we don't allow holding it - if (hardRestricted) { + if (permissionPolicyInitialized && hardRestricted) { if (!restrictionExempt) { if (permState != null && permState.isGranted() && permissionsState.revokeRuntimePermission( @@ -1239,7 +1253,7 @@ public class PermissionManagerService { } } // If soft restricted we allow holding in a restricted form - } else if (softRestricted) { + } else if (permissionPolicyInitialized && softRestricted) { // Regardless if granted set the restriction flag as it // may affect app treatment based on this permission. if (!restrictionExempt && !restrictionApplied) { @@ -1258,7 +1272,8 @@ public class PermissionManagerService { flags &= ~FLAG_PERMISSION_REVOKE_ON_UPGRADE; wasChanged = true; // Hard restricted permissions cannot be held. - } else if (!hardRestricted || restrictionExempt) { + } else if (!permissionPolicyInitialized || + (!hardRestricted || restrictionExempt)) { if (permissionsState.grantRuntimePermission(bp, userId) != PERMISSION_OPERATION_FAILURE) { wasChanged = true; @@ -1274,22 +1289,25 @@ public class PermissionManagerService { // If legacy app always grant the permission but if restricted // and not exempt take a note a restriction should be applied. - if ((hardRestricted || softRestricted) - && !restrictionExempt && !restrictionApplied) { + if (permissionPolicyInitialized + && (hardRestricted || softRestricted) + && !restrictionExempt && !restrictionApplied) { flags |= FLAG_PERMISSION_APPLY_RESTRICTION; wasChanged = true; } } // If unrestricted or restriction exempt, don't apply restriction. - if (!(hardRestricted || softRestricted) || restrictionExempt) { - if (restrictionApplied) { - flags &= ~FLAG_PERMISSION_APPLY_RESTRICTION; - // Dropping restriction on a legacy app requires a review. - if (!appSupportsRuntimePermissions) { - flags |= FLAG_PERMISSION_REVIEW_REQUIRED; + if (permissionPolicyInitialized) { + if (!(hardRestricted || softRestricted) || restrictionExempt) { + if (restrictionApplied) { + flags &= ~FLAG_PERMISSION_APPLY_RESTRICTION; + // Dropping restriction on a legacy app implies a review + if (!appSupportsRuntimePermissions) { + flags |= FLAG_PERMISSION_REVIEW_REQUIRED; + } + wasChanged = true; } - wasChanged = true; } } @@ -2080,7 +2098,8 @@ public class PermissionManagerService { final PackageParser.Package pkg = mPackageManagerInt.getPackage(packageName); if (pkg == null || pkg.mExtras == null) { - throw new IllegalArgumentException("Unknown package: " + packageName); + Log.e(TAG, "Unknown package: " + packageName); + return; } final BasePermission bp; synchronized(mLock) { @@ -2221,7 +2240,8 @@ public class PermissionManagerService { final PackageParser.Package pkg = mPackageManagerInt.getPackage(packageName); if (pkg == null || pkg.mExtras == null) { - throw new IllegalArgumentException("Unknown package: " + packageName); + Log.e(TAG, "Unknown package: " + packageName); + return; } if (mPackageManagerInt.filterAppAccess(pkg, Binder.getCallingUid(), userId)) { throw new IllegalArgumentException("Unknown package: " + packageName); @@ -2900,6 +2920,7 @@ public class PermissionManagerService { } mPermissionControllerManager = mContext.getSystemService(PermissionControllerManager.class); + mPermissionPolicyInternal = LocalServices.getService(PermissionPolicyInternal.class); } private static String getVolumeUuidForPackage(PackageParser.Package pkg) { diff --git a/services/core/java/com/android/server/policy/PermissionPolicyInternal.java b/services/core/java/com/android/server/policy/PermissionPolicyInternal.java index 7760c1edd9e6..6084c6718577 100644 --- a/services/core/java/com/android/server/policy/PermissionPolicyInternal.java +++ b/services/core/java/com/android/server/policy/PermissionPolicyInternal.java @@ -18,6 +18,7 @@ package com.android.server.policy; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UserIdInt; import android.content.Intent; /** @@ -26,6 +27,19 @@ import android.content.Intent; public abstract class PermissionPolicyInternal { /** + * Callback for initializing the permission policy service. + */ + public interface OnInitializedCallback { + + /** + * Called when initialized for the given user. + * + * @param userId The initialized user. + */ + void onInitialized(@UserIdInt int userId); + } + + /** * Check whether an activity should be started. * * @param intent the {@link Intent} for the activity start @@ -36,4 +50,17 @@ public abstract class PermissionPolicyInternal { */ public abstract boolean checkStartActivity(@NonNull Intent intent, int callingUid, @Nullable String callingPackage); + + /** + * @return Whether the policy is initialized for a user. + */ + public abstract boolean isInitialized(@UserIdInt int userId); + + /** + * Set a callback for users being initialized. If the user is already + * initialized the callback will not be invoked. + * + * @param callback The callback to register. + */ + public abstract void setOnInitializedCallback(@NonNull OnInitializedCallback callback); } diff --git a/services/core/java/com/android/server/policy/PermissionPolicyService.java b/services/core/java/com/android/server/policy/PermissionPolicyService.java index a569bffef141..3d543c96aacc 100644 --- a/services/core/java/com/android/server/policy/PermissionPolicyService.java +++ b/services/core/java/com/android/server/policy/PermissionPolicyService.java @@ -66,6 +66,7 @@ import com.android.server.LocalServices; import com.android.server.SystemService; import com.android.server.pm.permission.PermissionManagerServiceInternal; +import com.android.server.policy.PermissionPolicyInternal.OnInitializedCallback; import java.util.ArrayList; import java.util.concurrent.CountDownLatch; @@ -86,6 +87,10 @@ public final class PermissionPolicyService extends SystemService { @GuardedBy("mLock") private final SparseBooleanArray mIsStarted = new SparseBooleanArray(); + /** Callbacks for when a user is initialized */ + @GuardedBy("mLock") + private OnInitializedCallback mOnInitializedCallback; + /** * Whether an async {@link #synchronizePackagePermissionsAndAppOpsForUser} is currently * scheduled for a package/user. @@ -240,12 +245,20 @@ public final class PermissionPolicyService extends SystemService { grantOrUpgradeDefaultRuntimePermissionsIfNeeded(userId); + final OnInitializedCallback callback; + synchronized (mLock) { mIsStarted.put(userId, true); + callback = mOnInitializedCallback; } // Force synchronization as permissions might have changed synchronizePermissionsAndAppOpsForUser(userId); + + // Tell observers we are initialized for this user. + if (callback != null) { + callback.onInitialized(userId); + } } @Override @@ -807,6 +820,18 @@ public final class PermissionPolicyService extends SystemService { return true; } + @Override + public boolean isInitialized(int userId) { + return isStarted(userId); + } + + @Override + public void setOnInitializedCallback(@NonNull OnInitializedCallback callback) { + synchronized (mLock) { + mOnInitializedCallback = callback; + } + } + /** * Check if the intent action is removed for the calling package (often based on target SDK * version). If the action is removed, we'll silently cancel the activity launch. diff --git a/services/core/java/com/android/server/power/AttentionDetector.java b/services/core/java/com/android/server/power/AttentionDetector.java index 56d839633ab5..4e9b724f528d 100644 --- a/services/core/java/com/android/server/power/AttentionDetector.java +++ b/services/core/java/com/android/server/power/AttentionDetector.java @@ -161,7 +161,7 @@ public class AttentionDetector { context.getContentResolver().registerContentObserver(Settings.System.getUriFor( Settings.System.ADAPTIVE_SLEEP), - false, new ContentObserver(new Handler()) { + false, new ContentObserver(new Handler(context.getMainLooper())) { @Override public void onChange(boolean selfChange) { updateEnabledFromSettings(context); diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index cfd3ae6ef594..aa49ba62f48b 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -2724,6 +2724,14 @@ public final class PowerManagerService extends SystemService return true; } } + + if (mDisplayPowerRequest.policy == DisplayPowerRequest.POLICY_DOZE + && mDisplayPowerRequest.dozeScreenState == Display.STATE_ON) { + // Although we are in DOZE and would normally allow the device to suspend, + // the doze service has explicitly requested the display to remain in the ON + // state which means we should hold the display suspend blocker. + return true; + } if (mScreenBrightnessBoostInProgress) { return true; } @@ -4858,7 +4866,8 @@ public final class PowerManagerService extends SystemService } } - private final class LocalService extends PowerManagerInternal { + @VisibleForTesting + final class LocalService extends PowerManagerInternal { @Override public void setScreenBrightnessOverrideFromWindowManager(int screenBrightness) { if (screenBrightness < PowerManager.BRIGHTNESS_DEFAULT diff --git a/services/core/java/com/android/server/role/RoleManagerService.java b/services/core/java/com/android/server/role/RoleManagerService.java index c6a1867fa1e9..d66803b2cbe9 100644 --- a/services/core/java/com/android/server/role/RoleManagerService.java +++ b/services/core/java/com/android/server/role/RoleManagerService.java @@ -225,9 +225,10 @@ public class RoleManagerService extends SystemService implements RoleUserState.C //TODO gradually add more role migrations statements here for remaining roles // Make sure to implement LegacyRoleResolutionPolicy#getRoleHolders // for a given role before adding a migration statement for it here - migrateRoleIfNecessary(RoleManager.ROLE_SMS, userId); migrateRoleIfNecessary(RoleManager.ROLE_ASSISTANT, userId); + migrateRoleIfNecessary(RoleManager.ROLE_BROWSER, userId); migrateRoleIfNecessary(RoleManager.ROLE_DIALER, userId); + migrateRoleIfNecessary(RoleManager.ROLE_SMS, userId); migrateRoleIfNecessary(RoleManager.ROLE_EMERGENCY, userId); // Some vital packages state has changed since last role grant diff --git a/services/core/java/com/android/server/slice/PinnedSliceState.java b/services/core/java/com/android/server/slice/PinnedSliceState.java index e139ab86775d..4970862070bb 100644 --- a/services/core/java/com/android/server/slice/PinnedSliceState.java +++ b/services/core/java/com/android/server/slice/PinnedSliceState.java @@ -188,7 +188,7 @@ public class PinnedSliceState { b.putParcelable(SliceProvider.EXTRA_BIND_URI, mUri); try { client.call(SliceProvider.METHOD_PIN, null, b); - } catch (RemoteException e) { + } catch (Exception e) { Log.w(TAG, "Unable to contact " + mUri, e); } } @@ -201,7 +201,7 @@ public class PinnedSliceState { b.putParcelable(SliceProvider.EXTRA_BIND_URI, mUri); try { client.call(SliceProvider.METHOD_UNPIN, null, b); - } catch (RemoteException e) { + } catch (Exception e) { Log.w(TAG, "Unable to contact " + mUri, e); } } diff --git a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java index 4f91081e8acd..3550ebf9a03f 100644 --- a/services/core/java/com/android/server/wm/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/wm/ActivityStackSupervisor.java @@ -1202,8 +1202,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { final PackageInfo packageInfo; try { packageInfo = mService.mContext.getPackageManager() - .getPackageInfoAsUser(callingPackage, PackageManager.GET_PERMISSIONS, - UserHandle.getUserId(callingUid)); + .getPackageInfo(callingPackage, PackageManager.GET_PERMISSIONS); } catch (PackageManager.NameNotFoundException e) { Slog.i(TAG, "Cannot find package info for " + callingPackage); return ACTIVITY_RESTRICTION_NONE; diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index b0ca0af8fe88..5a1eed8897b6 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -187,6 +187,7 @@ class ActivityStarter { private boolean mNoAnimation; private boolean mKeepCurTransition; private boolean mAvoidMoveToFront; + private boolean mFrozeTaskList; // We must track when we deliver the new intent since multiple code paths invoke // {@link #deliverNewIntent}. This is due to early returns in the code path. This flag is used @@ -483,6 +484,7 @@ class ActivityStarter { mNoAnimation = starter.mNoAnimation; mKeepCurTransition = starter.mKeepCurTransition; mAvoidMoveToFront = starter.mAvoidMoveToFront; + mFrozeTaskList = starter.mFrozeTaskList; mVoiceSession = starter.mVoiceSession; mVoiceInteractor = starter.mVoiceInteractor; @@ -1093,6 +1095,14 @@ class ActivityStarter { void postStartActivityProcessing(ActivityRecord r, int result, ActivityStack startedActivityStack) { + if (!ActivityManager.isStartResultSuccessful(result)) { + if (mFrozeTaskList) { + // If we specifically froze the task list as part of starting an activity, then + // reset the frozen list state if it failed to start. This is normally otherwise + // called when the freeze-timeout has elapsed. + mSupervisor.mRecentTasks.resetFreezeTaskListReorderingOnTimeout(); + } + } if (ActivityManager.isStartResultFatalError(result)) { return; } @@ -1485,6 +1495,14 @@ class ActivityStarter { mLaunchParams.hasPreferredDisplay() ? mLaunchParams.mPreferredDisplayId : DEFAULT_DISPLAY; + // If requested, freeze the task list + if (mOptions != null && mOptions.freezeRecentTasksReordering() + && mSupervisor.mRecentTasks.isCallerRecents(r.launchedFromUid) + && !mSupervisor.mRecentTasks.isFreezeTaskListReorderingSet()) { + mFrozeTaskList = true; + mSupervisor.mRecentTasks.setFreezeTaskListReordering(); + } + // Do not start home activity if it cannot be launched on preferred display. We are not // doing this in ActivityStackSupervisor#canPlaceEntityOnDisplay because it might // fallback to launch on other displays. @@ -1775,6 +1793,7 @@ class ActivityStarter { mNoAnimation = false; mKeepCurTransition = false; mAvoidMoveToFront = false; + mFrozeTaskList = false; mVoiceSession = null; mVoiceInteractor = null; diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java index 7186ed169f5d..747837bc933f 100644 --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java @@ -1015,7 +1015,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { public final int startActivities(IApplicationThread caller, String callingPackage, Intent[] intents, String[] resolvedTypes, IBinder resultTo, Bundle bOptions, int userId) { - assertPackageMatchesCallingUid(callingPackage); final String reason = "startActivities"; enforceNotIsolatedCaller(reason); userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, reason); @@ -1035,11 +1034,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { true /*validateIncomingUser*/); } - private int startActivityAsUser(IApplicationThread caller, String callingPackage, + int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions, int userId, boolean validateIncomingUser) { - assertPackageMatchesCallingUid(callingPackage); enforceNotIsolatedCaller("startActivityAsUser"); userId = getActivityStartController().checkTargetUser(userId, validateIncomingUser, @@ -1212,7 +1210,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { public final WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions, int userId) { - assertPackageMatchesCallingUid(callingPackage); final WaitResult res = new WaitResult(); synchronized (mGlobalLock) { enforceNotIsolatedCaller("startActivityAndWait"); @@ -1240,7 +1237,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { public final int startActivityWithConfig(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, Configuration config, Bundle bOptions, int userId) { - assertPackageMatchesCallingUid(callingPackage); synchronized (mGlobalLock) { enforceNotIsolatedCaller("startActivityWithConfig"); userId = handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, @@ -1290,7 +1286,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions, IBinder permissionToken, boolean ignoreTargetSecurity, int userId) { - assertPackageMatchesCallingUid(callingPackage); // This is very dangerous -- it allows you to perform a start activity (including // permission grants) as any app that may launch one of your own activities. So we only // allow this in two cases: @@ -1420,7 +1415,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { Intent intent, String resolvedType, IVoiceInteractionSession session, IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions, int userId) { - assertPackageMatchesCallingUid(callingPackage); mAmInternal.enforceCallingPermission(BIND_VOICE_INTERACTION, "startVoiceActivity()"); if (session == null || interactor == null) { throw new NullPointerException("null session or interactor"); @@ -1444,7 +1438,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @Override public int startAssistantActivity(String callingPackage, int callingPid, int callingUid, Intent intent, String resolvedType, Bundle bOptions, int userId) { - assertPackageMatchesCallingUid(callingPackage); mAmInternal.enforceCallingPermission(BIND_VOICE_INTERACTION, "startAssistantActivity()"); userId = handleIncomingUser(callingPid, callingUid, userId, "startAssistantActivity"); @@ -1469,16 +1462,18 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @Nullable IRecentsAnimationRunner recentsAnimationRunner) { enforceCallerIsRecentsOrHasPermission(MANAGE_ACTIVITY_STACKS, "startRecentsActivity()"); final int callingPid = Binder.getCallingPid(); + final int callingUid = Binder.getCallingUid(); final long origId = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { final ComponentName recentsComponent = mRecentTasks.getRecentsComponent(); final int recentsUid = mRecentTasks.getRecentsComponentUid(); + final WindowProcessController caller = getProcessController(callingPid, callingUid); // Start a new recents animation final RecentsAnimation anim = new RecentsAnimation(this, mStackSupervisor, getActivityStartController(), mWindowManager, intent, recentsComponent, - recentsUid, callingPid); + recentsUid, caller); if (recentsAnimationRunner == null) { anim.preloadRecentsActivity(); } else { @@ -2370,9 +2365,15 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { void moveTaskToFrontLocked(@Nullable IApplicationThread appThread, @Nullable String callingPackage, int taskId, int flags, SafeActivityOptions options, boolean fromRecents) { + final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); - assertPackageMatchesCallingUid(callingPackage); + if (!isSameApp(callingUid, callingPackage)) { + String msg = "Permission Denial: moveTaskToFrontLocked() from pid=" + + Binder.getCallingPid() + " as package " + callingPackage; + Slog.w(TAG, msg); + throw new SecurityException(msg); + } if (!checkAppSwitchAllowedLocked(callingPid, callingUid, -1, -1, "Task to front")) { SafeActivityOptions.abort(options); return; @@ -2424,7 +2425,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { /** * Return true if callingUid is system, or packageName belongs to that callingUid. */ - private boolean isSameApp(int callingUid, @Nullable String packageName) { + boolean isSameApp(int callingUid, @Nullable String packageName) { try { if (callingUid != 0 && callingUid != SYSTEM_UID) { if (packageName == null) { @@ -2441,21 +2442,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { return true; } - /** - * Checks that the provided package name matches the current calling UID, throws a security - * exception if it doesn't. - */ - void assertPackageMatchesCallingUid(@Nullable String packageName) { - final int callingUid = Binder.getCallingUid(); - if (isSameApp(callingUid, packageName)) { - return; - } - final String msg = "Permission Denial: package=" + packageName - + " does not belong to uid=" + callingUid; - Slog.w(TAG, msg); - throw new SecurityException(msg); - } - boolean checkAppSwitchAllowedLocked(int sourcePid, int sourceUid, int callingPid, int callingUid, String name) { if (mAppSwitchesAllowedTime < SystemClock.uptimeMillis()) { @@ -2989,7 +2975,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @Override public List<IBinder> getAppTasks(String callingPackage) { int callingUid = Binder.getCallingUid(); - assertPackageMatchesCallingUid(callingPackage); long ident = Binder.clearCallingIdentity(); try { synchronized (mGlobalLock) { @@ -4667,7 +4652,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { public void registerRemoteAnimations(IBinder token, RemoteAnimationDefinition definition) { mAmInternal.enforceCallingPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS, "registerRemoteAnimations"); - definition.setCallingPid(Binder.getCallingPid()); + definition.setCallingPidUid(Binder.getCallingPid(), Binder.getCallingUid()); synchronized (mGlobalLock) { final ActivityRecord r = ActivityRecord.isInStackLocked(token); if (r == null) { @@ -4687,7 +4672,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { RemoteAnimationAdapter adapter) { mAmInternal.enforceCallingPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS, "registerRemoteAnimationForNextActivityStart"); - adapter.setCallingPid(Binder.getCallingPid()); + adapter.setCallingPidUid(Binder.getCallingPid(), Binder.getCallingUid()); synchronized (mGlobalLock) { final long origId = Binder.clearCallingIdentity(); try { @@ -4704,7 +4689,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { RemoteAnimationDefinition definition) { mAmInternal.enforceCallingPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS, "registerRemoteAnimations"); - definition.setCallingPid(Binder.getCallingPid()); + definition.setCallingPidUid(Binder.getCallingPid(), Binder.getCallingUid()); synchronized (mGlobalLock) { final ActivityDisplay display = mRootActivityContainer.getActivityDisplay(displayId); if (display == null) { @@ -6210,7 +6195,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { SafeActivityOptions options, int userId, boolean validateIncomingUser, PendingIntentRecord originatingPendingIntent, boolean allowBackgroundActivityStart) { - assertPackageMatchesCallingUid(callingPackage); synchronized (mGlobalLock) { return getActivityStartController().startActivitiesInPackage(uid, realCallingPid, realCallingUid, callingPackage, intents, resolvedTypes, resultTo, options, @@ -6226,7 +6210,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { int userId, TaskRecord inTask, String reason, boolean validateIncomingUser, PendingIntentRecord originatingPendingIntent, boolean allowBackgroundActivityStart) { - assertPackageMatchesCallingUid(callingPackage); synchronized (mGlobalLock) { return getActivityStartController().startActivityInPackage(uid, realCallingPid, realCallingUid, callingPackage, intent, resolvedType, resultTo, resultWho, diff --git a/services/core/java/com/android/server/wm/AppTaskImpl.java b/services/core/java/com/android/server/wm/AppTaskImpl.java index a8f7768efc87..1eb7455135c7 100644 --- a/services/core/java/com/android/server/wm/AppTaskImpl.java +++ b/services/core/java/com/android/server/wm/AppTaskImpl.java @@ -27,6 +27,7 @@ import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import android.os.UserHandle; +import android.util.Slog; /** * An implementation of IAppTask, that allows an app to manage its own tasks via @@ -96,7 +97,12 @@ class AppTaskImpl extends IAppTask.Stub { // Will bring task to front if it already has a root activity. final int callingPid = Binder.getCallingPid(); final int callingUid = Binder.getCallingUid(); - mService.assertPackageMatchesCallingUid(callingPackage); + if (!mService.isSameApp(callingUid, callingPackage)) { + String msg = "Permission Denial: moveToFront() from pid=" + + Binder.getCallingPid() + " as package " + callingPackage; + Slog.w(TAG, msg); + throw new SecurityException(msg); + } final long origId = Binder.clearCallingIdentity(); try { synchronized (mService.mGlobalLock) { @@ -128,7 +134,6 @@ class AppTaskImpl extends IAppTask.Stub { public int startActivity(IBinder whoThread, String callingPackage, Intent intent, String resolvedType, Bundle bOptions) { checkCaller(); - mService.assertPackageMatchesCallingUid(callingPackage); int callingUser = UserHandle.getCallingUserId(); TaskRecord tr; diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index eab5e0dd270e..f1a9e60d18aa 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -206,6 +206,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree boolean removed; // Information about an application starting window if displayed. + // Note: these are de-referenced before the starting window animates away. StartingData mStartingData; WindowState startingWindow; StartingSurface startingSurface; @@ -1243,6 +1244,21 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return true; } + /** + * @return {@code true} if starting window is in app's hierarchy. + */ + boolean hasStartingWindow() { + if (startingDisplayed || mStartingData != null) { + return true; + } + for (int i = mChildren.size() - 1; i >= 0; i--) { + if (getChildAt(i).mAttrs.type == TYPE_APPLICATION_STARTING) { + return true; + } + } + return false; + } + @Override void addWindow(WindowState w) { super.addWindow(w); @@ -2477,7 +2493,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree // transformed the task. final RecentsAnimationController controller = mWmService.getRecentsAnimationController(); if (controller != null && controller.isAnimatingTask(getTask()) - && controller.shouldCancelWithDeferredScreenshot()) { + && controller.shouldDeferCancelUntilNextTransition()) { return false; } diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index a1b87605ac1f..e099a4f0c91c 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -67,6 +67,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_DRAWN_APPLICATION; import static android.view.WindowManager.LayoutParams.TYPE_DREAM; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG; +import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR; import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG; import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; @@ -137,6 +138,8 @@ import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREEN import static com.android.server.wm.WindowManagerService.WINDOW_FREEZE_TIMEOUT_DURATION; import static com.android.server.wm.WindowManagerService.dipToPixel; import static com.android.server.wm.WindowManagerService.logSurface; +import static com.android.server.wm.WindowState.EXCLUSION_LEFT; +import static com.android.server.wm.WindowState.EXCLUSION_RIGHT; import static com.android.server.wm.WindowState.RESIZE_HANDLE_WIDTH_IN_DP; import static com.android.server.wm.WindowStateAnimator.DRAW_PENDING; import static com.android.server.wm.WindowStateAnimator.READY_TO_SHOW; @@ -330,6 +333,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo private final RemoteCallbackList<ISystemGestureExclusionListener> mSystemGestureExclusionListeners = new RemoteCallbackList<>(); private final Region mSystemGestureExclusion = new Region(); + private boolean mSystemGestureExclusionWasRestricted = false; + private final Region mSystemGestureExclusionUnrestricted = new Region(); private int mSystemGestureExclusionLimit; /** @@ -4845,9 +4850,13 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo // // In the case where we have no IME target we assign it where it's base layer would // place it in the AboveAppWindowContainers. - if (imeTarget != null && !(imeTarget.inSplitScreenWindowingMode() - || imeTarget.mToken.isAppAnimating()) - && (imeTarget.getSurfaceControl() != null)) { + // + // Keep IME window in mAboveAppWindowsContainers as long as app's starting window exists + // so it get's layered above the starting window. + if (imeTarget != null + && !(imeTarget.mAppToken != null && imeTarget.mAppToken.hasStartingWindow()) + && (!(imeTarget.inSplitScreenWindowingMode() || imeTarget.mToken.isAppAnimating()) + && (imeTarget.getSurfaceControl() != null))) { mImeWindowsContainers.assignRelativeLayer(t, imeTarget.getSurfaceControl(), // TODO: We need to use an extra level on the app surface to ensure // this is always above SurfaceView but always below attached window. @@ -5135,16 +5144,21 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo return false; } - final Region systemGestureExclusion = calculateSystemGestureExclusion(); + final Region systemGestureExclusion = Region.obtain(); + mSystemGestureExclusionWasRestricted = calculateSystemGestureExclusion( + systemGestureExclusion, mSystemGestureExclusionUnrestricted); try { if (mSystemGestureExclusion.equals(systemGestureExclusion)) { return false; } mSystemGestureExclusion.set(systemGestureExclusion); + final Region unrestrictedOrNull = mSystemGestureExclusionWasRestricted + ? mSystemGestureExclusionUnrestricted : null; for (int i = mSystemGestureExclusionListeners.beginBroadcast() - 1; i >= 0; --i) { try { mSystemGestureExclusionListeners.getBroadcastItem(i) - .onSystemGestureExclusionChanged(mDisplayId, systemGestureExclusion); + .onSystemGestureExclusionChanged(mDisplayId, systemGestureExclusion, + unrestrictedOrNull); } catch (RemoteException e) { Slog.e(TAG, "Failed to notify SystemGestureExclusionListener", e); } @@ -5156,8 +5170,22 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } } + /** + * Calculates the system gesture exclusion. + * + * @param outExclusion will be set to the gesture exclusion region + * @param outExclusionUnrestricted will be set to the gesture exclusion region without + * any restrictions applied. + * @return whether any restrictions were applied, i.e. outExclusion and outExclusionUnrestricted + * differ. + */ @VisibleForTesting - Region calculateSystemGestureExclusion() { + boolean calculateSystemGestureExclusion(Region outExclusion, @Nullable + Region outExclusionUnrestricted) { + outExclusion.setEmpty(); + if (outExclusionUnrestricted != null) { + outExclusionUnrestricted.setEmpty(); + } final Region unhandled = Region.obtain(); unhandled.set(0, 0, mDisplayFrames.mDisplayWidth, mDisplayFrames.mDisplayHeight); @@ -5166,7 +5194,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo final Rect rightEdge = mInsetsStateController.getSourceProvider(TYPE_RIGHT_GESTURES) .getSource().getFrame(); - final Region global = Region.obtain(); final Region touchableRegion = Region.obtain(); final Region local = Region.obtain(); final int[] remainingLeftRight = @@ -5204,28 +5231,39 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo if (needsGestureExclusionRestrictions(w, mLastDispatchedSystemUiVisibility)) { // Processes the region along the left edge. - remainingLeftRight[0] = addToGlobalAndConsumeLimit(local, global, leftEdge, - remainingLeftRight[0]); + remainingLeftRight[0] = addToGlobalAndConsumeLimit(local, outExclusion, leftEdge, + remainingLeftRight[0], w, EXCLUSION_LEFT); // Processes the region along the right edge. - remainingLeftRight[1] = addToGlobalAndConsumeLimit(local, global, rightEdge, - remainingLeftRight[1]); + remainingLeftRight[1] = addToGlobalAndConsumeLimit(local, outExclusion, rightEdge, + remainingLeftRight[1], w, EXCLUSION_RIGHT); // Adds the middle (unrestricted area) final Region middle = Region.obtain(local); middle.op(leftEdge, Op.DIFFERENCE); middle.op(rightEdge, Op.DIFFERENCE); - global.op(middle, Op.UNION); + outExclusion.op(middle, Op.UNION); middle.recycle(); } else { - global.op(local, Op.UNION); + boolean loggable = needsGestureExclusionRestrictions(w, 0 /* lastSysUiVis */); + if (loggable) { + addToGlobalAndConsumeLimit(local, outExclusion, leftEdge, + Integer.MAX_VALUE, w, EXCLUSION_LEFT); + addToGlobalAndConsumeLimit(local, outExclusion, rightEdge, + Integer.MAX_VALUE, w, EXCLUSION_RIGHT); + } + outExclusion.op(local, Op.UNION); + } + if (outExclusionUnrestricted != null) { + outExclusionUnrestricted.op(local, Op.UNION); } unhandled.op(touchableRegion, Op.DIFFERENCE); }, true /* topToBottom */); local.recycle(); touchableRegion.recycle(); unhandled.recycle(); - return global; + return remainingLeftRight[0] < mSystemGestureExclusionLimit + || remainingLeftRight[1] < mSystemGestureExclusionLimit; } /** @@ -5243,31 +5281,57 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } /** + * @return Whether gesture exclusion area should be logged for the given window + */ + static boolean logsGestureExclusionRestrictions(WindowState win) { + if (win.mWmService.mSystemGestureExclusionLogDebounceTimeoutMillis <= 0) { + return false; + } + final WindowManager.LayoutParams attrs = win.getAttrs(); + final int type = attrs.type; + return type != TYPE_WALLPAPER + && type != TYPE_APPLICATION_STARTING + && type != TYPE_NAVIGATION_BAR + && (attrs.flags & FLAG_NOT_TOUCHABLE) == 0 + && needsGestureExclusionRestrictions(win, 0 /* sysUiVisibility */) + && win.getDisplayContent().mDisplayPolicy.hasSideGestures(); + } + + /** * Adds a local gesture exclusion area to the global area while applying a limit per edge. * * @param local The gesture exclusion area to add. * @param global The destination. * @param edge Only processes the part in that region. * @param limit How much limit in pixels we have. - * @return How much of the limit are remaining. + * @param win The WindowState that is being processed + * @param side The side that is being processed, either {@link WindowState#EXCLUSION_LEFT} or + * {@link WindowState#EXCLUSION_RIGHT} + * @return How much of the limit is remaining. */ private static int addToGlobalAndConsumeLimit(Region local, Region global, Rect edge, - int limit) { + int limit, WindowState win, int side) { final Region r = Region.obtain(local); r.op(edge, Op.INTERSECT); final int[] remaining = {limit}; + final int[] requestedExclusion = {0}; forEachRectReverse(r, rect -> { if (remaining[0] <= 0) { return; } final int height = rect.height(); + requestedExclusion[0] += height; if (height > remaining[0]) { rect.top = rect.bottom - remaining[0]; } remaining[0] -= height; global.op(rect, Op.UNION); }); + + final int grantedExclusion = limit - remaining[0]; + win.setLastExclusionHeights(side, requestedExclusion[0], grantedExclusion); + r.recycle(); return remaining[0]; } @@ -5282,10 +5346,13 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo } if (!changed) { + final Region unrestrictedOrNull = mSystemGestureExclusionWasRestricted + ? mSystemGestureExclusionUnrestricted : null; // If updateSystemGestureExclusion changed the exclusion, it will already have // notified the listener. Otherwise, we'll do it here. try { - listener.onSystemGestureExclusionChanged(mDisplayId, mSystemGestureExclusion); + listener.onSystemGestureExclusionChanged(mDisplayId, mSystemGestureExclusion, + unrestrictedOrNull); } catch (RemoteException e) { Slog.e(TAG, "Failed to notify SystemGestureExclusionListener during register", e); } diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index cf87203893cf..ed7dbd05853a 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -478,9 +478,10 @@ public class DisplayPolicy { @Override public void onSwipeFromRight() { - final Region excludedRegion; + final Region excludedRegion = Region.obtain(); synchronized (mLock) { - excludedRegion = mDisplayContent.calculateSystemGestureExclusion(); + mDisplayContent.calculateSystemGestureExclusion( + excludedRegion, null /* outUnrestricted */); } final boolean sideAllowed = mNavigationBarAlwaysShowOnSideGesture || mNavigationBarPosition == NAV_BAR_RIGHT; @@ -488,13 +489,15 @@ public class DisplayPolicy { && !mSystemGestures.currentGestureStartedInRegion(excludedRegion)) { requestTransientBars(mNavigationBar); } + excludedRegion.recycle(); } @Override public void onSwipeFromLeft() { - final Region excludedRegion; + final Region excludedRegion = Region.obtain(); synchronized (mLock) { - excludedRegion = mDisplayContent.calculateSystemGestureExclusion(); + mDisplayContent.calculateSystemGestureExclusion( + excludedRegion, null /* outUnrestricted */); } final boolean sideAllowed = mNavigationBarAlwaysShowOnSideGesture || mNavigationBarPosition == NAV_BAR_LEFT; @@ -502,6 +505,7 @@ public class DisplayPolicy { && !mSystemGestures.currentGestureStartedInRegion(excludedRegion)) { requestTransientBars(mNavigationBar); } + excludedRegion.recycle(); } @Override @@ -674,6 +678,10 @@ public class DisplayPolicy { return mHasStatusBar; } + boolean hasSideGestures() { + return mHasNavigationBar && mSideGestureInset > 0; + } + public boolean navigationBarCanMove() { return mNavigationBarCanMove; } diff --git a/services/core/java/com/android/server/wm/RecentsAnimation.java b/services/core/java/com/android/server/wm/RecentsAnimation.java index bf627ec5680c..036bef755a87 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimation.java +++ b/services/core/java/com/android/server/wm/RecentsAnimation.java @@ -33,6 +33,7 @@ import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_O import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_TOP; import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RECENTS_ANIMATIONS; +import android.annotation.Nullable; import android.app.ActivityOptions; import android.content.ComponentName; import android.content.Intent; @@ -60,7 +61,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks, private final Intent mTargetIntent; private final ComponentName mRecentsComponent; private final int mRecentsUid; - private final int mCallingPid; + private final @Nullable WindowProcessController mCaller; private final int mUserId; private final int mTargetActivityType; @@ -76,7 +77,8 @@ class RecentsAnimation implements RecentsAnimationCallbacks, RecentsAnimation(ActivityTaskManagerService atm, ActivityStackSupervisor stackSupervisor, ActivityStartController activityStartController, WindowManagerService wm, - Intent targetIntent, ComponentName recentsComponent, int recentsUid, int callingPid) { + Intent targetIntent, ComponentName recentsComponent, int recentsUid, + @Nullable WindowProcessController caller) { mService = atm; mStackSupervisor = stackSupervisor; mDefaultDisplay = mService.mRootActivityContainer.getDefaultDisplay(); @@ -85,7 +87,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks, mTargetIntent = targetIntent; mRecentsComponent = recentsComponent; mRecentsUid = recentsUid; - mCallingPid = callingPid; + mCaller = caller; mUserId = atm.getCurrentUserId(); mTargetActivityType = targetIntent.getComponent() != null && recentsComponent.equals(targetIntent.getComponent()) @@ -190,7 +192,9 @@ class RecentsAnimation implements RecentsAnimationCallbacks, mStackSupervisor.getActivityMetricsLogger().notifyActivityLaunching(mTargetIntent); - mService.mH.post(() -> mService.mAmInternal.setRunningRemoteAnimation(mCallingPid, true)); + if (mCaller != null) { + mCaller.setRunningRecentsAnimation(true); + } mWindowManager.deferSurfaceLayout(); try { @@ -286,8 +290,9 @@ class RecentsAnimation implements RecentsAnimationCallbacks, mService.stopAppSwitches(); } - mService.mH.post( - () -> mService.mAmInternal.setRunningRemoteAnimation(mCallingPid, false)); + if (mCaller != null) { + mCaller.setRunningRecentsAnimation(false); + } mWindowManager.inSurfaceTransaction(() -> { Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, @@ -355,7 +360,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks, // launch-behind state is restored. That also prevents the next transition // type being disturbed if the visibility is updated after setting the next // transition (the target activity will be one of closing apps). - if (!controller.shouldCancelWithDeferredScreenshot() + if (!controller.shouldDeferCancelWithScreenshot() && !targetStack.isFocusedStackOnDisplay()) { targetStack.ensureActivitiesVisibleLocked(null /* starting */, 0 /* starting */, false /* preserveWindows */); @@ -415,16 +420,18 @@ class RecentsAnimation implements RecentsAnimationCallbacks, final DisplayContent dc = mService.mRootActivityContainer.getDefaultDisplay().mDisplayContent; dc.mBoundsAnimationController.setAnimationType( - controller.shouldCancelWithDeferredScreenshot() ? FADE_IN : BOUNDS); + controller.shouldDeferCancelUntilNextTransition() ? FADE_IN : BOUNDS); - // Cancel running recents animation and screenshot previous task when the next - // transition starts in below cases: - // 1) The next launching task is not in recents animation task. + // We defer canceling the recents animation until the next app transition in the following + // cases: + // 1) The next launching task is not being animated by the recents animation // 2) The next task is home activity. (i.e. pressing home key to back home in recents). if ((!controller.isAnimatingTask(stack.getTaskStack().getTopChild()) || controller.isTargetApp(stack.getTopActivity().mAppWindowToken)) - && controller.shouldCancelWithDeferredScreenshot()) { - controller.cancelOnNextTransitionStart(); + && controller.shouldDeferCancelUntilNextTransition()) { + // Always prepare an app transition since we rely on the transition callbacks to cleanup + mWindowManager.prepareAppTransition(TRANSIT_NONE, false); + controller.setCancelOnNextTransitionStart(); } else { // Just cancel directly to unleash from launcher when the next launching task is the // current top task. @@ -451,7 +458,7 @@ class RecentsAnimation implements RecentsAnimationCallbacks, /** * Called only when the animation should be canceled prior to starting. */ - private void notifyAnimationCancelBeforeStart(IRecentsAnimationRunner recentsAnimationRunner) { + static void notifyAnimationCancelBeforeStart(IRecentsAnimationRunner recentsAnimationRunner) { try { recentsAnimationRunner.onAnimationCanceled(false /* deferredWithScreenshot */); } catch (RemoteException e) { diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java index c03dabe660ad..a8b00838577f 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimationController.java +++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java @@ -96,10 +96,9 @@ public class RecentsAnimationController implements DeathRecipient { private final Runnable mFailsafeRunnable = () -> cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION, "failSafeRunnable"); - final Object mLock = new Object(); - // The recents component app token that is shown behind the visibile tasks private AppWindowToken mTargetAppToken; + private DisplayContent mDisplayContent; private int mTargetActivityType; private Rect mMinimizedHomeBounds = new Rect(); @@ -123,25 +122,47 @@ public class RecentsAnimationController implements DeathRecipient { private boolean mLinkedToDeathOfRunner; - private boolean mCancelWithDeferredScreenshot; - + // Whether to try to defer canceling from a stack order change until the next transition + private boolean mRequestDeferCancelUntilNextTransition; + // Whether to actually defer canceling until the next transition private boolean mCancelOnNextTransitionStart; + // Whether to take a screenshot when handling a deferred cancel + private boolean mCancelDeferredWithScreenshot; /** * Animates the screenshot of task that used to be controlled by RecentsAnimation. - * @see {@link #cancelOnNextTransitionStart} + * @see {@link #setCancelOnNextTransitionStart} */ SurfaceAnimator mRecentScreenshotAnimator; + /** + * An app transition listener to cancel the recents animation only after the app transition + * starts or is canceled. + */ final AppTransitionListener mAppTransitionListener = new AppTransitionListener() { @Override public int onAppTransitionStartingLocked(int transit, long duration, long statusBarAnimationStartTime, long statusBarAnimationDuration) { - onTransitionStart(); - mService.mRoot.getDisplayContent(mDisplayId).mAppTransition - .unregisterListener(this); + continueDeferredCancel(); return 0; } + + @Override + public void onAppTransitionCancelledLocked(int transit) { + continueDeferredCancel(); + } + + private void continueDeferredCancel() { + mDisplayContent.mAppTransition.unregisterListener(this); + if (mCanceled) { + return; + } + + if (mCancelOnNextTransitionStart) { + mCancelOnNextTransitionStart = false; + cancelAnimationWithScreenshot(mCancelDeferredWithScreenshot); + } + } }; public interface RecentsAnimationCallbacks { @@ -201,8 +222,7 @@ public class RecentsAnimationController implements DeathRecipient { ? REORDER_MOVE_TO_TOP : REORDER_MOVE_TO_ORIGINAL_POSITION, true /* runSynchronously */, sendUserLeaveHint); - final DisplayContent dc = mService.mRoot.getDisplayContent(mDisplayId); - dc.mBoundsAnimationController.setAnimationType(FADE_IN); + mDisplayContent.mBoundsAnimationController.setAnimationType(FADE_IN); } finally { Binder.restoreCallingIdentity(token); } @@ -239,8 +259,7 @@ public class RecentsAnimationController implements DeathRecipient { } mInputConsumerEnabled = enabled; - final InputMonitor inputMonitor = - mService.mRoot.getDisplayContent(mDisplayId).getInputMonitor(); + final InputMonitor inputMonitor = mDisplayContent.getInputMonitor(); inputMonitor.updateInputWindowsLw(true /*force*/); mService.scheduleAnimationLocked(); } @@ -281,15 +300,23 @@ public class RecentsAnimationController implements DeathRecipient { } @Override + @Deprecated public void setCancelWithDeferredScreenshot(boolean screenshot) { - synchronized (mLock) { - setCancelWithDeferredScreenshotLocked(screenshot); + synchronized (mService.mGlobalLock) { + setDeferredCancel(true /* deferred */, screenshot); + } + } + + @Override + public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) { + synchronized (mService.mGlobalLock) { + setDeferredCancel(defer, screenshot); } } @Override public void cleanupScreenshot() { - synchronized (mLock) { + synchronized (mService.mGlobalLock) { if (mRecentScreenshotAnimator != null) { mRecentScreenshotAnimator.cancelAnimation(); mRecentScreenshotAnimator = null; @@ -311,10 +338,7 @@ public class RecentsAnimationController implements DeathRecipient { mCallbacks = callbacks; mDisplayId = displayId; mStatusBar = LocalServices.getService(StatusBarManagerInternal.class); - } - - public void initialize(int targetActivityType, SparseBooleanArray recentTaskIds) { - initialize(mService.mRoot.getDisplayContent(mDisplayId), targetActivityType, recentTaskIds); + mDisplayContent = service.mRoot.getDisplayContent(displayId); } /** @@ -322,15 +346,15 @@ public class RecentsAnimationController implements DeathRecipient { * because it may call cancelAnimation() which needs to properly clean up the controller * in the window manager. */ - @VisibleForTesting - void initialize(DisplayContent dc, int targetActivityType, SparseBooleanArray recentTaskIds) { + public void initialize(int targetActivityType, SparseBooleanArray recentTaskIds) { mTargetActivityType = targetActivityType; - dc.mAppTransition.registerListenerLocked(mAppTransitionListener); + mDisplayContent.mAppTransition.registerListenerLocked(mAppTransitionListener); // Make leashes for each of the visible/target tasks and add it to the recents animation to // be started - final ArrayList<Task> visibleTasks = dc.getVisibleTasks(); - final TaskStack targetStack = dc.getStack(WINDOWING_MODE_UNDEFINED, targetActivityType); + final ArrayList<Task> visibleTasks = mDisplayContent.getVisibleTasks(); + final TaskStack targetStack = mDisplayContent.getStack(WINDOWING_MODE_UNDEFINED, + targetActivityType); if (targetStack != null) { for (int i = targetStack.getChildCount() - 1; i >= 0; i--) { final Task t = targetStack.getChildAt(i); @@ -364,29 +388,31 @@ public class RecentsAnimationController implements DeathRecipient { } // Adjust the wallpaper visibility for the showing target activity - final AppWindowToken recentsComponentAppToken = dc.getStack(WINDOWING_MODE_UNDEFINED, - targetActivityType).getTopChild().getTopFullscreenAppToken(); + final AppWindowToken recentsComponentAppToken = + targetStack.getTopChild().getTopFullscreenAppToken(); if (recentsComponentAppToken != null) { if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "setHomeApp(" + recentsComponentAppToken.getName() + ")"); mTargetAppToken = recentsComponentAppToken; if (recentsComponentAppToken.windowsCanBeWallpaperTarget()) { - dc.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; - dc.setLayoutNeeded(); + mDisplayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER; + mDisplayContent.setLayoutNeeded(); } } // Save the minimized home height - final TaskStack dockedStack = dc.getSplitScreenPrimaryStackIgnoringVisibility(); - dc.getDockedDividerController().getHomeStackBoundsInDockedMode( - dc.getConfiguration(), + final TaskStack dockedStack = mDisplayContent.getSplitScreenPrimaryStackIgnoringVisibility(); + mDisplayContent.getDockedDividerController().getHomeStackBoundsInDockedMode( + mDisplayContent.getConfiguration(), dockedStack == null ? DOCKED_INVALID : dockedStack.getDockSide(), mMinimizedHomeBounds); mService.mWindowPlacerLocked.performSurfacePlacement(); // Notify that the animation has started - mStatusBar.onRecentsAnimationStateChanged(true /* running */); + if (mStatusBar != null) { + mStatusBar.onRecentsAnimationStateChanged(true /* running */); + } } @VisibleForTesting @@ -440,8 +466,7 @@ public class RecentsAnimationController implements DeathRecipient { // Perform layout if it was scheduled before to make sure that we get correct content // insets for the target app window after a rotation - final DisplayContent displayContent = mService.mRoot.getDisplayContent(mDisplayId); - displayContent.performLayout(false /* initial */, false /* updateInputWindows */); + mDisplayContent.performLayout(false /* initial */, false /* updateInputWindows */); final Rect minimizedHomeBounds = mTargetAppToken != null && mTargetAppToken.inSplitScreenSecondaryWindowingMode() @@ -479,9 +504,8 @@ public class RecentsAnimationController implements DeathRecipient { cancelAnimation(reorderMode, true /* runSynchronously */, false /* screenshot */, reason); } - void cancelAnimationWithScreenShot() { - cancelAnimation(REORDER_KEEP_IN_PLACE, true /* sync */, true /* screenshot */, - "stackOrderChanged"); + void cancelAnimationWithScreenshot(boolean screenshot) { + cancelAnimation(REORDER_KEEP_IN_PLACE, true /* sync */, screenshot, "stackOrderChanged"); } private void cancelAnimation(@ReorderMode int reorderMode, boolean runSynchronously, @@ -495,21 +519,29 @@ public class RecentsAnimationController implements DeathRecipient { } mService.mH.removeCallbacks(mFailsafeRunnable); mCanceled = true; - try { - if (screenshot) { - // Screen shot previous task when next task starts transition. - final Task task = mPendingAnimations.get(0).mTask; - screenshotRecentTask(task, reorderMode, runSynchronously); + + if (screenshot) { + // Screen shot previous task when next task starts transition and notify the runner. + // We will actually finish the animation once the runner calls cleanUpScreenshot(). + final Task task = mPendingAnimations.get(0).mTask; + screenshotRecentTask(task, reorderMode, runSynchronously); + try { mRunner.onAnimationCanceled(true /* deferredWithScreenshot */); - return; + } catch (RemoteException e) { + Slog.e(TAG, "Failed to cancel recents animation", e); + } + } else { + // Otherwise, notify the runner and clean up the animation immediately + // Note: In the fallback case, this can trigger multiple onAnimationCancel() calls + // to the runner if we this actually triggers cancel twice on the caller + try { + mRunner.onAnimationCanceled(false /* deferredWithScreenshot */); + } catch (RemoteException e) { + Slog.e(TAG, "Failed to cancel recents animation", e); } - mRunner.onAnimationCanceled(false /* deferredWithScreenshot */); - } catch (RemoteException e) { - Slog.e(TAG, "Failed to cancel recents animation", e); + mCallbacks.onAnimationFinished(reorderMode, runSynchronously, + false /* sendUserLeaveHint */); } - // Clean up and return to the previous app - mCallbacks.onAnimationFinished(reorderMode, runSynchronously, - false /* sendUserLeaveHint */); } } @@ -522,27 +554,36 @@ public class RecentsAnimationController implements DeathRecipient { * screenshot, so that Launcher can still control the leash lifecycle & make the next app * transition animate smoothly without flickering. */ - void cancelOnNextTransitionStart() { + void setCancelOnNextTransitionStart() { mCancelOnNextTransitionStart = true; } - void setCancelWithDeferredScreenshotLocked(boolean screenshot) { - mCancelWithDeferredScreenshot = screenshot; + /** + * Requests that we attempt to defer the cancel until the next app transition if we are + * canceling from a stack order change. If {@param screenshot} is specified, then the system + * will replace the contents of the leash with a screenshot, which must be cleaned up when the + * runner calls cleanUpScreenshot(). + */ + void setDeferredCancel(boolean defer, boolean screenshot) { + mRequestDeferCancelUntilNextTransition = defer; + mCancelDeferredWithScreenshot = screenshot; } - boolean shouldCancelWithDeferredScreenshot() { - return mCancelWithDeferredScreenshot; + /** + * @return Whether we should defer the cancel from a stack order change until the next app + * transition. + */ + boolean shouldDeferCancelUntilNextTransition() { + return mRequestDeferCancelUntilNextTransition; } - void onTransitionStart() { - if (mCanceled) { - return; - } - - if (mCancelOnNextTransitionStart) { - mCancelOnNextTransitionStart = false; - cancelAnimationWithScreenShot(); - } + /** + * @return Whether we should both defer the cancel from a stack order change until the next + * app transition, and also that the deferred cancel should replace the contents of the leash + * with a screenshot. + */ + boolean shouldDeferCancelWithScreenshot() { + return mRequestDeferCancelUntilNextTransition && mCancelDeferredWithScreenshot; } void screenshotRecentTask(Task task, @ReorderMode int reorderMode, boolean runSynchronously) { @@ -575,6 +616,7 @@ public class RecentsAnimationController implements DeathRecipient { // Clear any pending failsafe runnables mService.mH.removeCallbacks(mFailsafeRunnable); + mDisplayContent.mAppTransition.unregisterListener(mAppTransitionListener); // Clear references to the runner unlinkToDeathOfRunner(); @@ -588,21 +630,22 @@ public class RecentsAnimationController implements DeathRecipient { } // Update the input windows after the animation is complete - final InputMonitor inputMonitor = - mService.mRoot.getDisplayContent(mDisplayId).getInputMonitor(); + final InputMonitor inputMonitor = mDisplayContent.getInputMonitor(); inputMonitor.updateInputWindowsLw(true /*force*/); // We have deferred all notifications to the target app as a part of the recents animation, // so if we are actually transitioning there, notify again here if (mTargetAppToken != null) { if (reorderMode == REORDER_MOVE_TO_TOP || reorderMode == REORDER_KEEP_IN_PLACE) { - mService.mRoot.getDisplayContent(mDisplayId) - .mAppTransition.notifyAppTransitionFinishedLocked(mTargetAppToken.token); + mDisplayContent.mAppTransition.notifyAppTransitionFinishedLocked( + mTargetAppToken.token); } } // Notify that the animation has ended - mStatusBar.onRecentsAnimationStateChanged(false /* running */); + if (mStatusBar != null) { + mStatusBar.onRecentsAnimationStateChanged(false /* running */); + } } void scheduleFailsafe() { @@ -629,8 +672,7 @@ public class RecentsAnimationController implements DeathRecipient { synchronized (mService.getWindowManagerLock()) { // Clear associated input consumers on runner death - final InputMonitor inputMonitor = - mService.mRoot.getDisplayContent(mDisplayId).getInputMonitor(); + final InputMonitor inputMonitor = mDisplayContent.getInputMonitor(); inputMonitor.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION); } } @@ -826,5 +868,11 @@ public class RecentsAnimationController implements DeathRecipient { pw.print(innerPrefix); pw.println("mSplitScreenMinimized=" + mSplitScreenMinimized); pw.print(innerPrefix); pw.println("mTargetAppToken=" + mTargetAppToken); pw.print(innerPrefix); pw.println("isTargetOverWallpaper=" + isTargetOverWallpaper()); + pw.print(innerPrefix); pw.println("mRequestDeferCancelUntilNextTransition=" + + mRequestDeferCancelUntilNextTransition); + pw.print(innerPrefix); pw.println("mCancelOnNextTransitionStart=" + + mCancelOnNextTransitionStart); + pw.print(innerPrefix); pw.println("mCancelDeferredWithScreenshot=" + + mCancelDeferredWithScreenshot); } } diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java index b4bfedda94c7..a1bc406c4550 100644 --- a/services/core/java/com/android/server/wm/RemoteAnimationController.java +++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java @@ -129,7 +129,7 @@ class RemoteAnimationController implements DeathRecipient { writeStartDebugStatement(); } }); - sendRunningRemoteAnimation(true); + setRunningRemoteAnimation(true); } void cancelAnimation(String reason) { @@ -216,7 +216,7 @@ class RemoteAnimationController implements DeathRecipient { mService.closeSurfaceTransaction("RemoteAnimationController#finished"); } } - sendRunningRemoteAnimation(false); + setRunningRemoteAnimation(false); if (DEBUG_REMOTE_ANIMATIONS) Slog.i(TAG, "Finishing remote animation"); } @@ -235,12 +235,18 @@ class RemoteAnimationController implements DeathRecipient { } } - private void sendRunningRemoteAnimation(boolean running) { + private void setRunningRemoteAnimation(boolean running) { final int pid = mRemoteAnimationAdapter.getCallingPid(); + final int uid = mRemoteAnimationAdapter.getCallingUid(); if (pid == 0) { throw new RuntimeException("Calling pid of remote animation was null"); } - mService.sendSetRunningRemoteAnimation(pid, running); + final WindowProcessController wpc = mService.mAtmService.getProcessController(pid, uid); + if (wpc == null) { + Slog.w(TAG, "Unable to find process with pid=" + pid + " uid=" + uid); + return; + } + wpc.setRunningRemoteAnimation(running); } private void linkToDeathOfRunner() throws RemoteException { @@ -417,7 +423,7 @@ class RemoteAnimationController implements DeathRecipient { mHandler.removeCallbacks(mTimeoutRunnable); releaseFinishedCallback(); invokeAnimationCancelled(); - sendRunningRemoteAnimation(false); + setRunningRemoteAnimation(false); } } diff --git a/services/core/java/com/android/server/wm/SafeActivityOptions.java b/services/core/java/com/android/server/wm/SafeActivityOptions.java index ac9028329023..a7b53688dbdc 100644 --- a/services/core/java/com/android/server/wm/SafeActivityOptions.java +++ b/services/core/java/com/android/server/wm/SafeActivityOptions.java @@ -122,17 +122,20 @@ public class SafeActivityOptions { if (mOriginalOptions != null) { checkPermissions(intent, aInfo, callerApp, supervisor, mOriginalOptions, mOriginalCallingPid, mOriginalCallingUid); - setCallingPidForRemoteAnimationAdapter(mOriginalOptions, mOriginalCallingPid); + setCallingPidUidForRemoteAnimationAdapter(mOriginalOptions, mOriginalCallingPid, + mOriginalCallingUid); } if (mCallerOptions != null) { checkPermissions(intent, aInfo, callerApp, supervisor, mCallerOptions, mRealCallingPid, mRealCallingUid); - setCallingPidForRemoteAnimationAdapter(mCallerOptions, mRealCallingPid); + setCallingPidUidForRemoteAnimationAdapter(mCallerOptions, mRealCallingPid, + mRealCallingUid); } return mergeActivityOptions(mOriginalOptions, mCallerOptions); } - private void setCallingPidForRemoteAnimationAdapter(ActivityOptions options, int callingPid) { + private void setCallingPidUidForRemoteAnimationAdapter(ActivityOptions options, + int callingPid, int callingUid) { final RemoteAnimationAdapter adapter = options.getRemoteAnimationAdapter(); if (adapter == null) { return; @@ -141,7 +144,7 @@ public class SafeActivityOptions { Slog.wtf(TAG, "Safe activity options constructed after clearing calling id"); return; } - adapter.setCallingPid(callingPid); + adapter.setCallingPidUid(callingPid, callingUid); } /** diff --git a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java index 6fd802d10e98..0be9736e9d76 100644 --- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java +++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java @@ -937,6 +937,7 @@ class ScreenRotationAnimation { } } + t.setEarlyWakeup(); setSnapshotTransform(t, mSnapshotFinalMatrix, mExitTransformation.getAlpha()); } diff --git a/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java b/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java index cb504607420c..85176bee67df 100644 --- a/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java +++ b/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java @@ -193,7 +193,9 @@ class SurfaceAnimationRunner { public void onAnimationStart(Animator animation) { synchronized (mCancelLock) { if (!a.mCancelled) { - mFrameTransaction.show(a.mLeash); + // TODO: change this back to use show instead of alpha when b/138459974 is + // fixed. + mFrameTransaction.setAlpha(a.mLeash, 1); } } } diff --git a/services/core/java/com/android/server/wm/SurfaceAnimator.java b/services/core/java/com/android/server/wm/SurfaceAnimator.java index 3d9dfeb4ecec..cd211a28a908 100644 --- a/services/core/java/com/android/server/wm/SurfaceAnimator.java +++ b/services/core/java/com/android/server/wm/SurfaceAnimator.java @@ -324,9 +324,9 @@ class SurfaceAnimator { .setName(surface + " - animation-leash"); final SurfaceControl leash = builder.build(); t.setWindowCrop(leash, width, height); - if (!hidden) { - t.show(leash); - } + t.show(leash); + // TODO: change this back to use show instead of alpha when b/138459974 is fixed. + t.setAlpha(leash, hidden ? 0 : 1); t.reparent(surface, leash); return leash; } diff --git a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java index bb1570e1ecb1..c0877a0a6752 100644 --- a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java +++ b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java @@ -28,7 +28,7 @@ import android.view.SurfaceSession; * Class used by {@link RecentsAnimationController} to create a surface control with taking * screenshot of task when canceling recents animation. * - * @see {@link RecentsAnimationController#cancelOnNextTransitionStart} + * @see {@link RecentsAnimationController#setCancelOnNextTransitionStart} */ class TaskScreenshotAnimatable implements SurfaceAnimator.Animatable { private static final String TAG = "TaskScreenshotAnim"; diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index f356b51ebb7b..c108752c951a 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -34,6 +34,7 @@ import static android.os.Process.myPid; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.provider.DeviceConfig.WindowManager.KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE; import static android.provider.DeviceConfig.WindowManager.KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP; +import static android.provider.DeviceConfig.WindowManager.KEY_SYSTEM_GESTURE_EXCLUSION_LOG_DEBOUNCE_MILLIS; import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.INVALID_DISPLAY; @@ -847,6 +848,16 @@ public class WindowManagerService extends IWindowManager.Stub int mSystemGestureExclusionLimitDp; boolean mSystemGestureExcludedByPreQStickyImmersive; + /** + * The minimum duration between gesture exclusion logging for a given window in + * milliseconds. + * + * Events that happen in-between will be silently dropped. + * + * A non-positive value disables logging. + */ + public long mSystemGestureExclusionLogDebounceTimeoutMillis; + public interface WindowChangeListener { public void windowsChanged(); public void focusChanged(); @@ -1146,6 +1157,9 @@ public class WindowManagerService extends IWindowManager.Stub mSystemGestureExclusionLimitDp = Math.max(MIN_GESTURE_EXCLUSION_LIMIT_DP, DeviceConfig.getInt(DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_SYSTEM_GESTURE_EXCLUSION_LIMIT_DP, 0)); + mSystemGestureExclusionLogDebounceTimeoutMillis = + DeviceConfig.getInt(DeviceConfig.NAMESPACE_WINDOW_MANAGER, + KEY_SYSTEM_GESTURE_EXCLUSION_LOG_DEBOUNCE_MILLIS, 0); mSystemGestureExcludedByPreQStickyImmersive = DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_WINDOW_MANAGER, KEY_SYSTEM_GESTURES_EXCLUDED_BY_PRE_Q_STICKY_IMMERSIVE, false); @@ -1163,6 +1177,10 @@ public class WindowManagerService extends IWindowManager.Stub mSystemGestureExcludedByPreQStickyImmersive = excludedByPreQSticky; mRoot.forAllDisplays(DisplayContent::updateSystemGestureExclusionLimit); } + + mSystemGestureExclusionLogDebounceTimeoutMillis = + DeviceConfig.getInt(DeviceConfig.NAMESPACE_WINDOW_MANAGER, + KEY_SYSTEM_GESTURE_EXCLUSION_LOG_DEBOUNCE_MILLIS, 0); } }); @@ -2004,6 +2022,7 @@ public class WindowManagerService extends IWindowManager.Stub int attrChanges = 0; int flagChanges = 0; + int privateFlagChanges = 0; if (attrs != null) { displayPolicy.adjustWindowParamsLw(win, attrs, pid, uid); // if they don't have the permission, mask out the status bar bits @@ -2032,6 +2051,7 @@ public class WindowManagerService extends IWindowManager.Stub } flagChanges = win.mAttrs.flags ^= attrs.flags; + privateFlagChanges = win.mAttrs.privateFlags ^ attrs.privateFlags; attrChanges = win.mAttrs.copyFrom(attrs); if ((attrChanges & (WindowManager.LayoutParams.LAYOUT_CHANGED | WindowManager.LayoutParams.SYSTEM_UI_VISIBILITY_CHANGED)) != 0) { @@ -2049,7 +2069,7 @@ public class WindowManagerService extends IWindowManager.Stub mAccessibilityController.onSomeWindowResizedOrMovedLocked(); } - if ((flagChanges & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != 0) { + if ((privateFlagChanges & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != 0) { updateNonSystemOverlayWindowsVisibilityIfNeeded( win, win.mWinAnimator.getShown()); } @@ -4554,7 +4574,6 @@ public class WindowManagerService extends IWindowManager.Stub public static final int SEAMLESS_ROTATION_TIMEOUT = 54; public static final int RESTORE_POINTER_ICON = 55; public static final int SET_HAS_OVERLAY_UI = 58; - public static final int SET_RUNNING_REMOTE_ANIMATION = 59; public static final int ANIMATION_FAILSAFE = 60; public static final int RECOMPUTE_FOCUS = 61; public static final int ON_POINTER_DOWN_OUTSIDE_FOCUS = 62; @@ -4933,10 +4952,6 @@ public class WindowManagerService extends IWindowManager.Stub mAmInternal.setHasOverlayUi(msg.arg1, msg.arg2 == 1); break; } - case SET_RUNNING_REMOTE_ANIMATION: { - mAmInternal.setRunningRemoteAnimation(msg.arg1, msg.arg2 == 1); - break; - } case ANIMATION_FAILSAFE: { synchronized (mGlobalLock) { if (mRecentsAnimationController != null) { @@ -7592,7 +7607,7 @@ public class WindowManagerService extends IWindowManager.Stub return; } final boolean systemAlertWindowsHidden = !mHidingNonSystemOverlayWindows.isEmpty(); - if (surfaceShown) { + if (surfaceShown && win.hideNonSystemOverlayWindowsWhenVisible()) { if (!mHidingNonSystemOverlayWindows.contains(win)) { mHidingNonSystemOverlayWindows.add(win); } @@ -7623,11 +7638,6 @@ public class WindowManagerService extends IWindowManager.Stub return mSurfaceBuilderFactory.make(s); } - void sendSetRunningRemoteAnimation(int pid, boolean runningRemoteAnimation) { - mH.obtainMessage(H.SET_RUNNING_REMOTE_ANIMATION, pid, runningRemoteAnimation ? 1 : 0) - .sendToTarget(); - } - void startSeamlessRotation() { // We are careful to reset this in case a window was removed before it finished // seamless rotation. @@ -7688,10 +7698,12 @@ public class WindowManagerService extends IWindowManager.Stub isDown = motionEvent.getAction() == MotionEvent.ACTION_DOWN; isUp = motionEvent.getAction() == MotionEvent.ACTION_UP; } + final boolean isMouseEvent = ev.getSource() == InputDevice.SOURCE_MOUSE; // For ACTION_DOWN, syncInputTransactions before injecting input. + // For all mouse events, also sync before injecting. // For ACTION_UP, sync after injecting. - if (isDown) { + if (isDown || isMouseEvent) { syncInputTransactions(); } final boolean result = diff --git a/services/core/java/com/android/server/wm/WindowProcessController.java b/services/core/java/com/android/server/wm/WindowProcessController.java index bc5e32823547..4cb546f107c7 100644 --- a/services/core/java/com/android/server/wm/WindowProcessController.java +++ b/services/core/java/com/android/server/wm/WindowProcessController.java @@ -56,6 +56,7 @@ import android.util.ArraySet; import android.util.Log; import android.util.Slog; import android.util.proto.ProtoOutputStream; +import android.view.IRemoteAnimationRunner; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.app.HeavyWeightSwitcherActivity; @@ -176,6 +177,12 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio // Registered display id as a listener to override config change private int mDisplayId; + /** Whether our process is currently running a {@link RecentsAnimation} */ + private boolean mRunningRecentsAnimation; + + /** Whether our process is currently running a {@link IRemoteAnimationRunner} */ + private boolean mRunningRemoteAnimation; + public WindowProcessController(ActivityTaskManagerService atm, ApplicationInfo info, String name, int uid, int userId, Object owner, WindowProcessListener listener) { mInfo = info; @@ -565,7 +572,8 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio * activities are allowed to be resumed per process. * @return {@code true} if the activity is allowed to be resumed by compatibility * restrictions, which the activity was the topmost visible activity in process or the app is - * targeting after Q. + * targeting after Q. Note that non-focusable activity, in picture-in-picture mode for instance, + * does not count as a topmost activity. */ boolean updateTopResumingActivityInProcessIfNeeded(@NonNull ActivityRecord activity) { if (mInfo.targetSdkVersion >= Q || mPreQTopResumedActivity == activity) { @@ -581,9 +589,13 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio boolean canUpdate = false; final ActivityDisplay topDisplay = mPreQTopResumedActivity != null ? mPreQTopResumedActivity.getDisplay() : null; - // Update the topmost activity if current top activity was not on any display or no - // longer visible. - if (topDisplay == null || !mPreQTopResumedActivity.visible) { + // Update the topmost activity if current top activity is + // - not on any display OR + // - no longer visible OR + // - not focusable (in PiP mode for instance) + if (topDisplay == null + || !mPreQTopResumedActivity.visible + || !mPreQTopResumedActivity.isFocusable()) { canUpdate = true; } @@ -1074,6 +1086,30 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio } } + void setRunningRecentsAnimation(boolean running) { + if (mRunningRecentsAnimation == running) { + return; + } + mRunningRecentsAnimation = running; + updateRunningRemoteOrRecentsAnimation(); + } + + void setRunningRemoteAnimation(boolean running) { + if (mRunningRemoteAnimation == running) { + return; + } + mRunningRemoteAnimation = running; + updateRunningRemoteOrRecentsAnimation(); + } + + private void updateRunningRemoteOrRecentsAnimation() { + + // Posting on handler so WM lock isn't held when we call into AM. + mAtm.mH.sendMessage(PooledLambda.obtainMessage( + WindowProcessListener::setRunningRemoteAnimation, mListener, + mRunningRecentsAnimation || mRunningRemoteAnimation)); + } + @Override public String toString() { return mOwner != null ? mOwner.toString() : null; diff --git a/services/core/java/com/android/server/wm/WindowProcessListener.java b/services/core/java/com/android/server/wm/WindowProcessListener.java index 527d54a40d03..23d7a6a9d293 100644 --- a/services/core/java/com/android/server/wm/WindowProcessListener.java +++ b/services/core/java/com/android/server/wm/WindowProcessListener.java @@ -17,6 +17,8 @@ package com.android.server.wm; import android.util.proto.ProtoOutputStream; +import android.view.IRemoteAnimationRunner; +import android.view.RemoteAnimationAdapter; /** * Interface used by the owner/creator of a process that owns windows to listen to changes from the @@ -60,4 +62,14 @@ public interface WindowProcessListener { /** App died :(...oh well */ void appDied(); void writeToProto(ProtoOutputStream proto, long fieldId); + + /** + * Sets if the process is currently running a remote animation, which is taken a signal for + * determining oom adjustment and scheduling behavior. + * + * @param runningRemoteAnimation True if the process is running a remote animation, false + * otherwise. + * @see RemoteAnimationAdapter + */ + void setRunningRemoteAnimation(boolean runningRemoteAnimation); } diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index f68d7c077e72..18cdc943b8c8 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -20,6 +20,8 @@ import static android.app.ActivityTaskManager.INVALID_STACK_ID; import static android.app.AppOpsManager.MODE_ALLOWED; import static android.app.AppOpsManager.MODE_DEFAULT; import static android.app.AppOpsManager.OP_NONE; +import static android.app.WindowConfiguration.isSplitScreenWindowingMode; +import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; import static android.os.PowerManager.DRAW_WAKE_LOCK; import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER; import static android.view.Display.DEFAULT_DISPLAY; @@ -80,6 +82,7 @@ import static com.android.server.policy.WindowManagerPolicy.TRANSIT_ENTER; import static com.android.server.policy.WindowManagerPolicy.TRANSIT_EXIT; import static com.android.server.policy.WindowManagerPolicy.TRANSIT_PREVIEW_DONE; import static com.android.server.wm.AnimationSpecProto.MOVE; +import static com.android.server.wm.DisplayContent.logsGestureExclusionRestrictions; import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_DOCKED_DIVIDER; import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_FREEFORM; import static com.android.server.wm.IdentifierProto.HASH_CODE; @@ -174,6 +177,7 @@ import android.util.ArraySet; import android.util.DisplayMetrics; import android.util.MergedConfiguration; import android.util.Slog; +import android.util.StatsLog; import android.util.TimeUtils; import android.util.proto.ProtoOutputStream; import android.view.Display; @@ -227,6 +231,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // to capture touch events in that area. static final int RESIZE_HANDLE_WIDTH_IN_DP = 30; + static final int EXCLUSION_LEFT = 0; + static final int EXCLUSION_RIGHT = 1; + final WindowManagerPolicy mPolicy; final Context mContext; final Session mSession; @@ -397,6 +404,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP */ private final List<Rect> mExclusionRects = new ArrayList<>(); + // 0 = left, 1 = right + private final int[] mLastRequestedExclusionHeight = {0, 0}; + private final int[] mLastGrantedExclusionHeight = {0, 0}; + private final long[] mLastExclusionLogUptimeMillis = {0, 0}; + + private boolean mLastShownChangedReported; + // If a window showing a wallpaper: the requested offset for the // wallpaper; if a wallpaper window: the currently applied offset. float mWallpaperX = -1; @@ -679,6 +693,20 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP && mAppToken != null && mAppToken.mTargetSdk < Build.VERSION_CODES.Q; } + void setLastExclusionHeights(int side, int requested, int granted) { + boolean changed = mLastGrantedExclusionHeight[side] != granted + || mLastRequestedExclusionHeight[side] != requested; + + if (changed) { + if (mLastShownChangedReported) { + logExclusionRestrictions(side); + } + + mLastGrantedExclusionHeight[side] = granted; + mLastRequestedExclusionHeight[side] = requested; + } + } + interface PowerManagerWrapper { void wakeUp(long time, @WakeReason int reason, String details); @@ -2957,6 +2985,49 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP mAnimatingExit = false; } + void onSurfaceShownChanged(boolean shown) { + if (mLastShownChangedReported == shown) { + return; + } + mLastShownChangedReported = shown; + + if (shown) { + initExclusionRestrictions(); + } else { + logExclusionRestrictions(EXCLUSION_LEFT); + logExclusionRestrictions(EXCLUSION_RIGHT); + } + } + + private void logExclusionRestrictions(int side) { + if (!logsGestureExclusionRestrictions(this) + || SystemClock.uptimeMillis() < mLastExclusionLogUptimeMillis[side] + + mWmService.mSystemGestureExclusionLogDebounceTimeoutMillis) { + // Drop the log if we have just logged; this is okay, because what we would have logged + // was true only for a short duration. + return; + } + + final long now = SystemClock.uptimeMillis(); + final long duration = now - mLastExclusionLogUptimeMillis[side]; + mLastExclusionLogUptimeMillis[side] = now; + + final int requested = mLastRequestedExclusionHeight[side]; + final int granted = mLastGrantedExclusionHeight[side]; + + StatsLog.write(StatsLog.EXCLUSION_RECT_STATE_CHANGED, + mAttrs.packageName, requested, requested - granted /* rejected */, + side + 1 /* Sides are 1-indexed in atoms.proto */, + (getConfiguration().orientation == ORIENTATION_LANDSCAPE), + isSplitScreenWindowingMode(getWindowingMode()), (int) duration); + } + + private void initExclusionRestrictions() { + final long now = SystemClock.uptimeMillis(); + mLastExclusionLogUptimeMillis[EXCLUSION_LEFT] = now; + mLastExclusionLogUptimeMillis[EXCLUSION_RIGHT] = now; + } + @Override public boolean isDefaultDisplay() { final DisplayContent displayContent = getDisplayContent(); diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java index bef0f81e4dc1..53bbd7010b5d 100644 --- a/services/core/java/com/android/server/wm/WindowSurfaceController.java +++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java @@ -507,6 +507,8 @@ class WindowSurfaceController { mService.updateNonSystemOverlayWindowsVisibilityIfNeeded(mAnimator.mWin, surfaceShown); + mAnimator.mWin.onSurfaceShownChanged(surfaceShown); + if (mWindowSession != null) { mWindowSession.onWindowSurfaceVisibilityChanged(this, mSurfaceShown, mWindowType); } diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 3a7cbf8cc06a..133b82f72746 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -1973,6 +1973,11 @@ public final class SystemServer { } traceEnd(); + // Permission policy service + traceBeginAndSlog("StartPermissionPolicyService"); + mSystemServiceManager.startService(PermissionPolicyService.class); + traceEnd(); + traceBeginAndSlog("MakePackageManagerServiceReady"); mPackageManagerService.systemReady(); traceEnd(); @@ -2007,11 +2012,6 @@ public final class SystemServer { mSystemServiceManager.startBootPhase(SystemService.PHASE_DEVICE_SPECIFIC_SERVICES_READY); traceEnd(); - // Permission policy service - traceBeginAndSlog("StartPermissionPolicyService"); - mSystemServiceManager.startService(PermissionPolicyService.class); - traceEnd(); - // These are needed to propagate to the runnable below. final NetworkManagementService networkManagementF = networkManagement; final NetworkStatsService networkStatsF = networkStats; diff --git a/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java b/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java index cc64323e51c7..1d082c735d09 100644 --- a/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java +++ b/services/robotests/backup/src/com/android/server/backup/keyvalue/KeyValueBackupTaskTest.java @@ -94,7 +94,6 @@ import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.ParcelFileDescriptor; -import android.os.PowerManager; import android.os.RemoteException; import android.platform.test.annotations.Presubmit; import android.util.Pair; @@ -184,7 +183,7 @@ public class KeyValueBackupTaskTest { private TransportData mTransport; private ShadowLooper mShadowBackupLooper; private Handler mBackupHandler; - private PowerManager.WakeLock mWakeLock; + private UserBackupManagerService.BackupWakeLock mWakeLock; private KeyValueBackupReporter mReporter; private PackageManager mPackageManager; private ShadowPackageManager mShadowPackageManager; diff --git a/services/robotests/backup/src/com/android/server/backup/restore/ActiveRestoreSessionTest.java b/services/robotests/backup/src/com/android/server/backup/restore/ActiveRestoreSessionTest.java index f4cea7ae86a6..3fc421dfb6e9 100644 --- a/services/robotests/backup/src/com/android/server/backup/restore/ActiveRestoreSessionTest.java +++ b/services/robotests/backup/src/com/android/server/backup/restore/ActiveRestoreSessionTest.java @@ -18,7 +18,7 @@ package com.android.server.backup.restore; import static com.android.server.backup.testing.BackupManagerServiceTestUtils.createBackupWakeLock; import static com.android.server.backup.testing.BackupManagerServiceTestUtils.setUpBackupManagerServiceBasics; -import static com.android.server.backup.testing.BackupManagerServiceTestUtils.startBackupThreadAndGetLooper; +import static com.android.server.backup.testing.BackupManagerServiceTestUtils.startBackupThread; import static com.android.server.backup.testing.TestUtils.assertEventLogged; import static com.android.server.backup.testing.TestUtils.assertEventNotLogged; import static com.android.server.backup.testing.TransportData.backupTransport; @@ -44,8 +44,8 @@ import android.app.backup.RestoreSet; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.os.Handler; +import android.os.HandlerThread; import android.os.Looper; -import android.os.PowerManager; import android.os.RemoteException; import android.platform.test.annotations.Presubmit; @@ -98,7 +98,7 @@ public class ActiveRestoreSessionTest { @Mock private IBackupManagerMonitor mMonitor; private ShadowLooper mShadowBackupLooper; private ShadowApplication mShadowApplication; - private PowerManager.WakeLock mWakeLock; + private UserBackupManagerService.BackupWakeLock mWakeLock; private TransportData mTransport; private RestoreSet mRestoreSet1; private RestoreSet mRestoreSet2; @@ -118,7 +118,8 @@ public class ActiveRestoreSessionTest { mShadowPackageManager = shadowOf(application.getPackageManager()); - Looper backupLooper = startBackupThreadAndGetLooper(); + HandlerThread handlerThread = startBackupThread(null); + Looper backupLooper = handlerThread.getLooper(); mShadowBackupLooper = shadowOf(backupLooper); Handler mainHandler = new Handler(Looper.getMainLooper()); @@ -129,7 +130,7 @@ public class ActiveRestoreSessionTest { // We need to mock BMS timeout parameters before initializing the BackupHandler since // the constructor of BackupHandler relies on it. when(mBackupManagerService.getAgentTimeoutParameters()).thenReturn(agentTimeoutParameters); - BackupHandler backupHandler = new BackupHandler(mBackupManagerService, backupLooper); + BackupHandler backupHandler = new BackupHandler(mBackupManagerService, handlerThread); mWakeLock = createBackupWakeLock(application); diff --git a/services/robotests/backup/src/com/android/server/backup/testing/BackupManagerServiceTestUtils.java b/services/robotests/backup/src/com/android/server/backup/testing/BackupManagerServiceTestUtils.java index 47abcc5a2dd1..392d182328a5 100644 --- a/services/robotests/backup/src/com/android/server/backup/testing/BackupManagerServiceTestUtils.java +++ b/services/robotests/backup/src/com/android/server/backup/testing/BackupManagerServiceTestUtils.java @@ -113,7 +113,7 @@ public class BackupManagerServiceTestUtils { TransportManager transportManager, PackageManager packageManager, Handler backupHandler, - PowerManager.WakeLock wakeLock, + UserBackupManagerService.BackupWakeLock wakeLock, BackupAgentTimeoutParameters agentTimeoutParameters) { when(backupManagerService.getContext()).thenReturn(application); @@ -161,10 +161,12 @@ public class BackupManagerServiceTestUtils { }); } - public static PowerManager.WakeLock createBackupWakeLock(Application application) { + public static UserBackupManagerService.BackupWakeLock createBackupWakeLock( + Application application) { PowerManager powerManager = (PowerManager) application.getSystemService(Context.POWER_SERVICE); - return powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*backup*"); + return new UserBackupManagerService.BackupWakeLock( + powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*backup*")); } /** diff --git a/services/tests/servicestests/AndroidManifest.xml b/services/tests/servicestests/AndroidManifest.xml index 25bd4ec489a9..178ae2533664 100644 --- a/services/tests/servicestests/AndroidManifest.xml +++ b/services/tests/servicestests/AndroidManifest.xml @@ -70,6 +70,8 @@ <uses-permission android:name="android.permission.WRITE_DEVICE_CONFIG" /> <uses-permission android:name="android.permission.HARDWARE_TEST"/> <uses-permission android:name="android.permission.MANAGE_APPOPS"/> + <uses-permission android:name="android.permission.BLUETOOTH"/> + <!-- Uses API introduced in O (26) --> <uses-sdk android:minSdkVersion="1" diff --git a/services/tests/servicestests/src/com/android/server/audio/AudioDeviceBrokerTest.java b/services/tests/servicestests/src/com/android/server/audio/AudioDeviceBrokerTest.java new file mode 100644 index 000000000000..5c2ad94720f0 --- /dev/null +++ b/services/tests/servicestests/src/com/android/server/audio/AudioDeviceBrokerTest.java @@ -0,0 +1,162 @@ +/* + * Copyright 2019 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.audio; + +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyInt; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.bluetooth.BluetoothAdapter; +import android.bluetooth.BluetoothDevice; +import android.bluetooth.BluetoothProfile; +import android.content.Context; +import android.media.AudioManager; +import android.media.AudioSystem; +import android.util.Log; + +import androidx.test.InstrumentationRegistry; +import androidx.test.filters.MediumTest; +import androidx.test.runner.AndroidJUnit4; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.Spy; + +@MediumTest +@RunWith(AndroidJUnit4.class) +public class AudioDeviceBrokerTest { + + private static final String TAG = "AudioDeviceBrokerTest"; + private static final int MAX_MESSAGE_HANDLING_DELAY_MS = 100; + + private Context mContext; + // the actual class under test + private AudioDeviceBroker mAudioDeviceBroker; + + @Mock private AudioService mMockAudioService; + @Spy private AudioDeviceInventory mSpyDevInventory; + + private BluetoothDevice mFakeBtDevice; + + @Before + public void setUp() throws Exception { + mContext = InstrumentationRegistry.getTargetContext(); + + mMockAudioService = mock(AudioService.class); + mSpyDevInventory = spy(new AudioDeviceInventory()); + mAudioDeviceBroker = new AudioDeviceBroker(mContext, mMockAudioService, mSpyDevInventory); + mSpyDevInventory.setDeviceBroker(mAudioDeviceBroker); + + BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter(); + mFakeBtDevice = adapter.getRemoteDevice("00:01:02:03:04:05"); + Assert.assertNotNull("invalid null BT device", mFakeBtDevice); + } + + @After + public void tearDown() throws Exception { } + + @Test + public void testSetUpAndTearDown() { } + + /** + * Verify call to postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent() for connection + * calls into AudioDeviceInventory with the right params + * @throws Exception + */ + @Test + public void testPostA2dpDeviceConnectionChange() throws Exception { + Log.i(TAG, "testPostA2dpDeviceConnectionChange"); + Assert.assertNotNull("invalid null BT device", mFakeBtDevice); + + mAudioDeviceBroker.postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(mFakeBtDevice, + BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP, true, 1); + Thread.sleep(MAX_MESSAGE_HANDLING_DELAY_MS); + verify(mSpyDevInventory, times(1)).setBluetoothA2dpDeviceConnectionState( + any(BluetoothDevice.class), + ArgumentMatchers.eq(BluetoothProfile.STATE_CONNECTED) /*state*/, + ArgumentMatchers.eq(BluetoothProfile.A2DP) /*profile*/, + ArgumentMatchers.eq(true) /*suppressNoisyIntent*/, anyInt() /*musicDevice*/, + ArgumentMatchers.eq(1) /*a2dpVolume*/ + ); + } + + /** + * Verify call to postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent() for + * connection > pause > disconnection > connection + * keeps the device connected + * @throws Exception + */ + @Test + public void testA2dpDeviceConnectionDisconnectionConnectionChange() throws Exception { + Log.i(TAG, "testA2dpDeviceConnectionDisconnectionConnectionChange"); + + doTestConnectionDisconnectionReconnection(0); + } + + /** + * Verify device disconnection and reconnection within the BECOMING_NOISY window + * @throws Exception + */ + @Test + public void testA2dpDeviceReconnectionWithinBecomingNoisyDelay() throws Exception { + Log.i(TAG, "testA2dpDeviceReconnectionWithinBecomingNoisyDelay"); + + doTestConnectionDisconnectionReconnection(AudioService.BECOMING_NOISY_DELAY_MS / 2); + } + + private void doTestConnectionDisconnectionReconnection(int delayAfterDisconnection) + throws Exception { + when(mMockAudioService.getDeviceForStream(AudioManager.STREAM_MUSIC)) + .thenReturn(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP); + when(mMockAudioService.isInCommunication()).thenReturn(false); + when(mMockAudioService.hasMediaDynamicPolicy()).thenReturn(false); + when(mMockAudioService.hasAudioFocusUsers()).thenReturn(false); + + // first connection + mAudioDeviceBroker.postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(mFakeBtDevice, + BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP, true, 1); + Thread.sleep(MAX_MESSAGE_HANDLING_DELAY_MS); + + // disconnection + mAudioDeviceBroker.postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(mFakeBtDevice, + BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.A2DP, false, -1); + if (delayAfterDisconnection > 0) { + Thread.sleep(delayAfterDisconnection); + } + + // reconnection + mAudioDeviceBroker.postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent(mFakeBtDevice, + BluetoothProfile.STATE_CONNECTED, BluetoothProfile.A2DP, true, 2); + Thread.sleep(AudioService.BECOMING_NOISY_DELAY_MS + MAX_MESSAGE_HANDLING_DELAY_MS); + + // Verify disconnection has been cancelled and we're seeing two connections attempts, + // with the device connected at the end of the test + verify(mSpyDevInventory, times(2)).onSetA2dpSinkConnectionState( + any(BtHelper.BluetoothA2dpDeviceInfo.class), + ArgumentMatchers.eq(BluetoothProfile.STATE_CONNECTED)); + Assert.assertTrue("Mock device not connected", + mSpyDevInventory.isA2dpDeviceConnected(mFakeBtDevice)); + } +} diff --git a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java index 1bda412f2f89..88de250e4b0d 100644 --- a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java @@ -23,7 +23,10 @@ import static android.os.PowerManagerInternal.WAKEFULNESS_DREAMING; import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.argThat; @@ -59,6 +62,7 @@ import android.os.SystemClock; import android.os.SystemProperties; import android.os.UserHandle; import android.provider.Settings; +import android.view.Display; import androidx.test.InstrumentationRegistry; @@ -157,6 +161,10 @@ public class PowerManagerServiceTest { mResourcesSpy = spy(mContextSpy.getResources()); when(mContextSpy.getResources()).thenReturn(mResourcesSpy); + when(mDisplayManagerInternalMock.requestPowerState(any(), anyBoolean())).thenReturn(true); + } + + private PowerManagerService createService() { mService = new PowerManagerService(mContextSpy, new Injector() { @Override Notifier createNotifier(Looper looper, Context context, IBatteryStats batteryStats, @@ -166,7 +174,7 @@ public class PowerManagerServiceTest { @Override SuspendBlocker createSuspendBlocker(PowerManagerService service, String name) { - return mock(SuspendBlocker.class); + return super.createSuspendBlocker(service, name); } @Override @@ -191,6 +199,7 @@ public class PowerManagerServiceTest { return mAmbientDisplayConfigurationMock; } }); + return mService; } @After @@ -262,6 +271,7 @@ public class PowerManagerServiceTest { @Test public void testUpdatePowerScreenPolicy_UpdateDisplayPowerRequest() { + createService(); mService.updatePowerRequestFromBatterySaverPolicy(mDisplayPowerRequest); assertThat(mDisplayPowerRequest.lowPowerMode).isEqualTo(BATTERY_SAVER_ENABLED); assertThat(mDisplayPowerRequest.screenLowPowerBrightnessFactor) @@ -270,6 +280,7 @@ public class PowerManagerServiceTest { @Test public void testGetLastShutdownReasonInternal() { + createService(); SystemProperties.set(TEST_LAST_REBOOT_PROPERTY, "shutdown,thermal"); int reason = mService.getLastShutdownReasonInternal(TEST_LAST_REBOOT_PROPERTY); SystemProperties.set(TEST_LAST_REBOOT_PROPERTY, ""); @@ -278,6 +289,7 @@ public class PowerManagerServiceTest { @Test public void testGetDesiredScreenPolicy_WithVR() throws Exception { + createService(); // Brighten up the screen mService.setWakefulnessLocked(WAKEFULNESS_AWAKE, PowerManager.WAKE_REASON_UNKNOWN, 0); assertThat(mService.getDesiredScreenPolicyLocked()).isEqualTo( @@ -307,11 +319,13 @@ public class PowerManagerServiceTest { @Test public void testWakefulnessAwake_InitialValue() throws Exception { + createService(); assertThat(mService.getWakefulness()).isEqualTo(WAKEFULNESS_AWAKE); } @Test public void testWakefulnessSleep_NoDozeSleepFlag() throws Exception { + createService(); // Start with AWAKE state startSystem(); assertThat(mService.getWakefulness()).isEqualTo(WAKEFULNESS_AWAKE); @@ -324,6 +338,7 @@ public class PowerManagerServiceTest { @Test public void testWakefulnessAwake_AcquireCausesWakeup() throws Exception { + createService(); startSystem(); forceSleep(); @@ -355,6 +370,7 @@ public class PowerManagerServiceTest { @Test public void testWakefulnessAwake_IPowerManagerWakeUp() throws Exception { + createService(); startSystem(); forceSleep(); mService.getBinderServiceInstance().wakeUp(SystemClock.uptimeMillis(), @@ -369,6 +385,8 @@ public class PowerManagerServiceTest { @Test public void testWakefulnessAwake_ShouldWakeUpWhenPluggedIn() throws Exception { boolean powerState; + + createService(); startSystem(); forceSleep(); @@ -444,6 +462,7 @@ public class PowerManagerServiceTest { @Test public void testWakefulnessDoze_goToSleep() throws Exception { + createService(); // Start with AWAKE state startSystem(); assertThat(mService.getWakefulness()).isEqualTo(WAKEFULNESS_AWAKE); @@ -457,6 +476,7 @@ public class PowerManagerServiceTest { @Test public void testWasDeviceIdleFor_true() { int interval = 1000; + createService(); mService.onUserActivity(); SystemClock.sleep(interval + 1 /* just a little more */); assertThat(mService.wasDeviceIdleForInternal(interval)).isTrue(); @@ -465,12 +485,14 @@ public class PowerManagerServiceTest { @Test public void testWasDeviceIdleFor_false() { int interval = 1000; + createService(); mService.onUserActivity(); assertThat(mService.wasDeviceIdleForInternal(interval)).isFalse(); } @Test public void testForceSuspend_putsDeviceToSleep() { + createService(); mService.systemReady(null); mService.onBootPhase(SystemService.PHASE_BOOT_COMPLETED); @@ -497,6 +519,8 @@ public class PowerManagerServiceTest { final int flags = PowerManager.PARTIAL_WAKE_LOCK; final String pkg = mContextSpy.getOpPackageName(); + createService(); + // Set up the Notification mock to keep track of the wakelocks that are currently // active or disabled. We'll use this to verify that wakelocks are disabled when // they should be. @@ -541,7 +565,54 @@ public class PowerManagerServiceTest { @Test public void testForceSuspend_forceSuspendFailurePropogated() { + createService(); when(mNativeWrapperMock.nativeForceSuspend()).thenReturn(false); assertThat(mService.getBinderServiceInstance().forceSuspend()).isFalse(); } + + @Test + public void testSetDozeOverrideFromDreamManager_triggersSuspendBlocker() throws Exception { + final String suspendBlockerName = "PowerManagerService.Display"; + final String tag = "acq_causes_wakeup"; + final String packageName = "pkg.name"; + final IBinder token = new Binder(); + + final boolean[] isAcquired = new boolean[1]; + doAnswer(inv -> { + if (suspendBlockerName.equals(inv.getArguments()[0])) { + isAcquired[0] = false; + } + return null; + }).when(mNativeWrapperMock).nativeReleaseSuspendBlocker(any()); + + doAnswer(inv -> { + if (suspendBlockerName.equals(inv.getArguments()[0])) { + isAcquired[0] = true; + } + return null; + }).when(mNativeWrapperMock).nativeAcquireSuspendBlocker(any()); + + // Need to create the service after we stub the mocks for this test because some of the + // mocks are used during the constructor. + createService(); + + // Start with AWAKE state + startSystem(); + assertThat(mService.getWakefulness()).isEqualTo(WAKEFULNESS_AWAKE); + assertTrue(isAcquired[0]); + + // Take a nap and verify we no longer hold the blocker + int flags = PowerManager.DOZE_WAKE_LOCK; + mService.getBinderServiceInstance().acquireWakeLock(token, flags, tag, packageName, + null /* workSource */, null /* historyTag */); + mService.getBinderServiceInstance().goToSleep(SystemClock.uptimeMillis(), + PowerManager.GO_TO_SLEEP_REASON_APPLICATION, 0); + assertThat(mService.getWakefulness()).isEqualTo(WAKEFULNESS_DOZING); + assertFalse(isAcquired[0]); + + // Override the display state by DreamManager and verify is reacquires the blocker. + mService.getLocalServiceInstance() + .setDozeOverrideFromDreamManager(Display.STATE_ON, PowerManager.BRIGHTNESS_DEFAULT); + assertTrue(isAcquired[0]); + } } diff --git a/services/tests/uiservicestests/src/com/android/server/slice/PinnedSliceStateTest.java b/services/tests/uiservicestests/src/com/android/server/slice/PinnedSliceStateTest.java index f5002ace6690..3b336eb7aec9 100644 --- a/services/tests/uiservicestests/src/com/android/server/slice/PinnedSliceStateTest.java +++ b/services/tests/uiservicestests/src/com/android/server/slice/PinnedSliceStateTest.java @@ -7,10 +7,12 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -159,4 +161,25 @@ public class PinnedSliceStateTest extends UiServiceTestCase { verify(mSliceService).removePinnedSlice(eq(TEST_URI)); assertFalse(mPinnedSliceManager.hasPinOrListener()); } + + @Test + public void testPinFailed() throws Exception { + // Throw exception when trying to pin + doAnswer(invocation -> { + throw new Exception("Pin failed"); + }).when(mIContentProvider).call( + anyString(), anyString(), anyString(), eq(null), any()); + + TestableLooper.get(this).processAllMessages(); + + // When pinned for the first time, a pinned message should be sent. + mPinnedSliceManager.pin("pkg", FIRST_SPECS, mToken); + TestableLooper.get(this).processAllMessages(); + + verify(mIContentProvider).call(anyString(), anyString(), eq(SliceProvider.METHOD_PIN), + eq(null), argThat(b -> { + assertEquals(TEST_URI, b.getParcelable(SliceProvider.EXTRA_BIND_URI)); + return true; + })); + } } diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java index a08923bafe28..3d944671ef25 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java @@ -842,4 +842,51 @@ public class ActivityStarterTests extends ActivityTestsBase { // Ensure the activity is moved to secondary display. assertEquals(secondaryDisplay, topActivity.getDisplay()); } + + /** + * This test ensures that starting an activity with the freeze-task-list activity option will + * actually freeze the task list + */ + @Test + public void testFreezeTaskListActivityOption() { + RecentTasks recentTasks = mock(RecentTasks.class); + mService.mStackSupervisor.setRecentTasks(recentTasks); + doReturn(true).when(recentTasks).isCallerRecents(anyInt()); + + final ActivityStarter starter = prepareStarter(0 /* flags */); + final ActivityOptions options = ActivityOptions.makeBasic(); + options.setFreezeRecentTasksReordering(); + + starter.setReason("testFreezeTaskListActivityOption") + .setActivityOptions(new SafeActivityOptions(options)) + .execute(); + + verify(recentTasks, times(1)).setFreezeTaskListReordering(); + verify(recentTasks, times(0)).resetFreezeTaskListReorderingOnTimeout(); + } + + /** + * This test ensures that if we froze the task list as a part of starting an activity that fails + * to start, that we also reset the task list. + */ + @Test + public void testFreezeTaskListActivityOptionFailedStart_expectResetFreezeTaskList() { + RecentTasks recentTasks = mock(RecentTasks.class); + mService.mStackSupervisor.setRecentTasks(recentTasks); + doReturn(true).when(recentTasks).isCallerRecents(anyInt()); + + final ActivityStarter starter = prepareStarter(0 /* flags */); + final ActivityOptions options = ActivityOptions.makeBasic(); + options.setFreezeRecentTasksReordering(); + + starter.setReason("testFreezeTaskListActivityOptionFailedStart") + .setActivityOptions(new SafeActivityOptions(options)) + .execute(); + + // Simulate a failed start + starter.postStartActivityProcessing(null, START_ABORTED, null); + + verify(recentTasks, times(1)).setFreezeTaskListReordering(); + verify(recentTasks, times(1)).resetFreezeTaskListReorderingOnTimeout(); + } } diff --git a/services/tests/wmtests/src/com/android/server/wm/AppTransitionTests.java b/services/tests/wmtests/src/com/android/server/wm/AppTransitionTests.java index f60241846044..d1dc38273a28 100644 --- a/services/tests/wmtests/src/com/android/server/wm/AppTransitionTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/AppTransitionTests.java @@ -207,7 +207,7 @@ public class AppTransitionTests extends WindowTestsBase { final RemoteAnimationAdapter adapter = new RemoteAnimationAdapter( runner, 100, 50, true /* changeNeedsSnapshot */); // RemoteAnimationController will tracking RemoteAnimationAdapter's caller with calling pid. - adapter.setCallingPid(123); + adapter.setCallingPidUid(123, 456); // Simulate activity finish flows to prepare app transition & set visibility, // make sure transition is set as expected. diff --git a/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java b/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java index 7f35dac9611a..d9566a3c871d 100644 --- a/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/AppWindowTokenTests.java @@ -504,6 +504,21 @@ public class AppWindowTokenTests extends WindowTestsBase { assertEquals(stackBounds, mToken.getAnimationBounds(STACK_CLIP_BEFORE_ANIM)); } + @Test + public void testHasStartingWindow() { + final WindowManager.LayoutParams attrs = + new WindowManager.LayoutParams(TYPE_APPLICATION_STARTING); + final WindowTestUtils.TestWindowState startingWindow = createWindowState(attrs, mToken); + mToken.startingDisplayed = true; + mToken.addWindow(startingWindow); + assertTrue("Starting window should be present", mToken.hasStartingWindow()); + mToken.startingDisplayed = false; + assertTrue("Starting window should be present", mToken.hasStartingWindow()); + + mToken.removeChild(startingWindow); + assertFalse("Starting window should not be present", mToken.hasStartingWindow()); + } + private void assertHasStartingWindow(AppWindowToken atoken) { assertNotNull(atoken.startingSurface); assertNotNull(atoken.mStartingData); diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java index 7cd097ebdc2b..6889086680d4 100644 --- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java @@ -756,7 +756,8 @@ public class DisplayContentTests extends WindowTestsBase { final ISystemGestureExclusionListener.Stub verifier = new ISystemGestureExclusionListener.Stub() { @Override - public void onSystemGestureExclusionChanged(int displayId, Region actual) { + public void onSystemGestureExclusionChanged(int displayId, Region actual, + Region unrestricted) { Region expected = Region.obtain(); expected.set(10, 20, 30, 40); assertEquals(expected, actual); @@ -790,7 +791,14 @@ public class DisplayContentTests extends WindowTestsBase { final Region expected = Region.obtain(); expected.set(20, 30, 40, 50); - assertEquals(expected, dc.calculateSystemGestureExclusion()); + assertEquals(expected, calculateSystemGestureExclusion(dc)); + } + + private Region calculateSystemGestureExclusion(DisplayContent dc) { + Region out = Region.obtain(); + Region unrestricted = Region.obtain(); + dc.calculateSystemGestureExclusion(out, unrestricted); + return out; } @Test @@ -814,7 +822,7 @@ public class DisplayContentTests extends WindowTestsBase { win2.setHasSurface(true); final Region expected = Region.obtain(); - assertEquals(expected, dc.calculateSystemGestureExclusion()); + assertEquals(expected, calculateSystemGestureExclusion(dc)); } @Test @@ -839,7 +847,7 @@ public class DisplayContentTests extends WindowTestsBase { final Region expected = Region.obtain(); expected.set(dc.getBounds()); - assertEquals(expected, dc.calculateSystemGestureExclusion()); + assertEquals(expected, calculateSystemGestureExclusion(dc)); win.setHasSurface(false); } diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java index 26cd63c62cc1..cd292b2494ff 100644 --- a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationControllerTest.java @@ -25,6 +25,7 @@ import static android.view.WindowManager.TRANSIT_ACTIVITY_CLOSE; import static com.android.dx.mockito.inline.extended.ExtendedMockito.atLeast; import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing; +import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verifyNoMoreInteractions; @@ -35,10 +36,12 @@ import static com.android.server.wm.RecentsAnimationController.REORDER_MOVE_TO_O import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import android.os.Binder; @@ -79,6 +82,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { // Hold the lock to protect the stubbing from being accessed by other threads. spyOn(mWm.mRoot); doNothing().when(mWm.mRoot).performSurfacePlacement(anyBoolean()); + doReturn(mDisplayContent).when(mWm.mRoot).getDisplayContent(anyInt()); } when(mMockRunner.asBinder()).thenReturn(new Binder()); mController = new RecentsAnimationController(mWm, mMockRunner, mAnimationCallbacks, @@ -135,7 +139,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { hiddenAppWindow.setHidden(true); mDisplayContent.getConfiguration().windowConfiguration.setRotation( mDisplayContent.getRotation()); - mController.initialize(mDisplayContent, ACTIVITY_TYPE_HOME, new SparseBooleanArray()); + mController.initialize(ACTIVITY_TYPE_HOME, new SparseBooleanArray()); // Ensure that we are animating the target activity as well assertTrue(mController.isAnimatingTask(homeAppWindow.getTask())); @@ -144,7 +148,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { } @Test - public void testCancelAnimationWithScreenShot() throws Exception { + public void testDeferCancelAnimation() throws Exception { mWm.setRecentsAnimationController(mController); final AppWindowToken appWindow = createAppWindowToken(mDisplayContent, WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD); @@ -156,8 +160,31 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { mController.addAnimation(appWindow.getTask(), false /* isRecentTaskInvisible */); assertTrue(mController.isAnimatingTask(appWindow.getTask())); - mController.setCancelWithDeferredScreenshotLocked(true); - mController.cancelAnimationWithScreenShot(); + mController.setDeferredCancel(true /* deferred */, false /* screenshot */); + mController.cancelAnimationWithScreenshot(false /* screenshot */); + verify(mMockRunner).onAnimationCanceled(false /* deferredWithScreenshot */); + assertNull(mController.mRecentScreenshotAnimator); + + // Simulate the app transition finishing + mController.mAppTransitionListener.onAppTransitionStartingLocked(0, 0, 0, 0); + verify(mAnimationCallbacks).onAnimationFinished(REORDER_KEEP_IN_PLACE, true, false); + } + + @Test + public void testDeferCancelAnimationWithScreenShot() throws Exception { + mWm.setRecentsAnimationController(mController); + final AppWindowToken appWindow = createAppWindowToken(mDisplayContent, + WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD); + final WindowState win1 = createWindow(null, TYPE_BASE_APPLICATION, appWindow, "win1"); + appWindow.addWindow(win1); + assertEquals(appWindow.getTask().getTopVisibleAppToken(), appWindow); + assertEquals(appWindow.findMainWindow(), win1); + + mController.addAnimation(appWindow.getTask(), false /* isRecentTaskInvisible */); + assertTrue(mController.isAnimatingTask(appWindow.getTask())); + + mController.setDeferredCancel(true /* deferred */, true /* screenshot */); + mController.cancelAnimationWithScreenshot(true /* screenshot */); verify(mMockRunner).onAnimationCanceled(true /* deferredWithScreenshot */); assertNotNull(mController.mRecentScreenshotAnimator); assertTrue(mController.mRecentScreenshotAnimator.isAnimating()); @@ -185,7 +212,7 @@ public class RecentsAnimationControllerTest extends WindowTestsBase { // Assume appWindow transition should animate when no // IRecentsAnimationController#setCancelWithDeferredScreenshot called. - assertFalse(mController.shouldCancelWithDeferredScreenshot()); + assertFalse(mController.shouldDeferCancelWithScreenshot()); assertTrue(appWindow.shouldAnimate(TRANSIT_ACTIVITY_CLOSE)); } diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationTest.java index 9630b7d46e3c..0e119e3cc375 100644 --- a/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/RecentsAnimationTest.java @@ -274,12 +274,13 @@ public class RecentsAnimationTest extends ActivityTestsBase { // Assume recents animation already started, set a state that cancel recents animation // with screenshot. - doReturn(true).when(mRecentsAnimationController).shouldCancelWithDeferredScreenshot(); + doReturn(true).when(mRecentsAnimationController).shouldDeferCancelUntilNextTransition(); + doReturn(true).when(mRecentsAnimationController).shouldDeferCancelWithScreenshot(); // Start another fullscreen activity. fullscreenStack2.moveToFront("Activity start"); - // Ensure that the recents animation was canceled by cancelOnNextTransitionStart(). - verify(mRecentsAnimationController, times(1)).cancelOnNextTransitionStart(); + // Ensure that the recents animation was canceled by setCancelOnNextTransitionStart(). + verify(mRecentsAnimationController, times(1)).setCancelOnNextTransitionStart(); } @Test @@ -315,7 +316,7 @@ public class RecentsAnimationTest extends ActivityTestsBase { // Ensure that the recents animation was NOT canceled verify(mService.mWindowManager, times(0)).cancelRecentsAnimationSynchronously( eq(REORDER_KEEP_IN_PLACE), any()); - verify(mRecentsAnimationController, times(0)).cancelOnNextTransitionStart(); + verify(mRecentsAnimationController, times(0)).setCancelOnNextTransitionStart(); } @Test diff --git a/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java index cb74c3e32252..74791e2ea97f 100644 --- a/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/RemoteAnimationControllerTest.java @@ -79,7 +79,7 @@ public class RemoteAnimationControllerTest extends WindowTestsBase { when(mMockRunner.asBinder()).thenReturn(new Binder()); mAdapter = new RemoteAnimationAdapter(mMockRunner, 100, 50, true /* changeNeedsSnapshot */); - mAdapter.setCallingPid(123); + mAdapter.setCallingPidUid(123, 456); mWm.mH.runWithScissors(() -> mHandler = new TestHandler(null, mClock), 0); mController = new RemoteAnimationController(mWm, mAdapter, mHandler); } diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowProcessControllerTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowProcessControllerTests.java index a7c84a1c28b4..8c56ffaa6314 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowProcessControllerTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowProcessControllerTests.java @@ -23,12 +23,18 @@ import static com.android.server.wm.ActivityDisplay.POSITION_TOP; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import android.content.pm.ApplicationInfo; import android.platform.test.annotations.Presubmit; +import org.junit.Before; import org.junit.Test; +import org.mockito.InOrder; +import org.mockito.Mockito; /** * Tests for the {@link WindowProcessController} class. @@ -39,43 +45,89 @@ import org.junit.Test; @Presubmit public class WindowProcessControllerTests extends ActivityTestsBase { + WindowProcessController mWpc; + WindowProcessListener mMockListener; + + @Before + public void setUp() { + mMockListener = mock(WindowProcessListener.class); + mWpc = new WindowProcessController( + mService, mock(ApplicationInfo.class), null, 0, -1, null, mMockListener); + } + @Test public void testDisplayConfigurationListener() { - final WindowProcessController wpc = new WindowProcessController( - mService, mock(ApplicationInfo.class), null, 0, -1, null, null); + //By default, the process should not listen to any display. - assertEquals(INVALID_DISPLAY, wpc.getDisplayId()); + assertEquals(INVALID_DISPLAY, mWpc.getDisplayId()); // Register to display 1 as a listener. TestActivityDisplay testActivityDisplay1 = createTestActivityDisplayInContainer(); - wpc.registerDisplayConfigurationListenerLocked(testActivityDisplay1); - assertTrue(testActivityDisplay1.containsListener(wpc)); - assertEquals(testActivityDisplay1.mDisplayId, wpc.getDisplayId()); + mWpc.registerDisplayConfigurationListenerLocked(testActivityDisplay1); + assertTrue(testActivityDisplay1.containsListener(mWpc)); + assertEquals(testActivityDisplay1.mDisplayId, mWpc.getDisplayId()); // Move to display 2. TestActivityDisplay testActivityDisplay2 = createTestActivityDisplayInContainer(); - wpc.registerDisplayConfigurationListenerLocked(testActivityDisplay2); - assertFalse(testActivityDisplay1.containsListener(wpc)); - assertTrue(testActivityDisplay2.containsListener(wpc)); - assertEquals(testActivityDisplay2.mDisplayId, wpc.getDisplayId()); + mWpc.registerDisplayConfigurationListenerLocked(testActivityDisplay2); + assertFalse(testActivityDisplay1.containsListener(mWpc)); + assertTrue(testActivityDisplay2.containsListener(mWpc)); + assertEquals(testActivityDisplay2.mDisplayId, mWpc.getDisplayId()); // Null ActivityDisplay will not change anything. - wpc.registerDisplayConfigurationListenerLocked(null); - assertTrue(testActivityDisplay2.containsListener(wpc)); - assertEquals(testActivityDisplay2.mDisplayId, wpc.getDisplayId()); + mWpc.registerDisplayConfigurationListenerLocked(null); + assertTrue(testActivityDisplay2.containsListener(mWpc)); + assertEquals(testActivityDisplay2.mDisplayId, mWpc.getDisplayId()); // Unregister listener will remove the wpc from registered displays. - wpc.unregisterDisplayConfigurationListenerLocked(); - assertFalse(testActivityDisplay1.containsListener(wpc)); - assertFalse(testActivityDisplay2.containsListener(wpc)); - assertEquals(INVALID_DISPLAY, wpc.getDisplayId()); + mWpc.unregisterDisplayConfigurationListenerLocked(); + assertFalse(testActivityDisplay1.containsListener(mWpc)); + assertFalse(testActivityDisplay2.containsListener(mWpc)); + assertEquals(INVALID_DISPLAY, mWpc.getDisplayId()); // Unregistration still work even if the display was removed. - wpc.registerDisplayConfigurationListenerLocked(testActivityDisplay1); - assertEquals(testActivityDisplay1.mDisplayId, wpc.getDisplayId()); + mWpc.registerDisplayConfigurationListenerLocked(testActivityDisplay1); + assertEquals(testActivityDisplay1.mDisplayId, mWpc.getDisplayId()); mRootActivityContainer.removeChild(testActivityDisplay1); - wpc.unregisterDisplayConfigurationListenerLocked(); - assertEquals(INVALID_DISPLAY, wpc.getDisplayId()); + mWpc.unregisterDisplayConfigurationListenerLocked(); + assertEquals(INVALID_DISPLAY, mWpc.getDisplayId()); + } + + @Test + public void testSetRunningRecentsAnimation() { + mWpc.setRunningRecentsAnimation(true); + mWpc.setRunningRecentsAnimation(false); + mService.mH.runWithScissors(() -> {}, 0); + + InOrder orderVerifier = Mockito.inOrder(mMockListener); + orderVerifier.verify(mMockListener).setRunningRemoteAnimation(eq(true)); + orderVerifier.verify(mMockListener).setRunningRemoteAnimation(eq(false)); + } + + @Test + public void testSetRunningRemoteAnimation() { + mWpc.setRunningRemoteAnimation(true); + mWpc.setRunningRemoteAnimation(false); + mService.mH.runWithScissors(() -> {}, 0); + + InOrder orderVerifier = Mockito.inOrder(mMockListener); + orderVerifier.verify(mMockListener).setRunningRemoteAnimation(eq(true)); + orderVerifier.verify(mMockListener).setRunningRemoteAnimation(eq(false)); + } + + @Test + public void testSetRunningBothAnimations() { + mWpc.setRunningRemoteAnimation(true); + mWpc.setRunningRecentsAnimation(true); + + mWpc.setRunningRecentsAnimation(false); + mWpc.setRunningRemoteAnimation(false); + mService.mH.runWithScissors(() -> {}, 0); + + InOrder orderVerifier = Mockito.inOrder(mMockListener); + orderVerifier.verify(mMockListener, times(3)).setRunningRemoteAnimation(eq(true)); + orderVerifier.verify(mMockListener, times(1)).setRunningRemoteAnimation(eq(false)); + orderVerifier.verifyNoMoreInteractions(); } private TestActivityDisplay createTestActivityDisplayInContainer() { diff --git a/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java b/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java index 94352b21db87..99337565e128 100644 --- a/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java +++ b/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java @@ -104,8 +104,8 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { // This is an indirect indication of the microphone being open in some other application. private boolean mServiceDisabled = false; - // Whether we have ANY recognition (keyphrase or generic) running. - private boolean mRecognitionRunning = false; + // Whether ANY recognition (keyphrase or generic) has been requested. + private boolean mRecognitionRequested = false; private PowerSaveModeListener mPowerSaveModeListener; @@ -252,11 +252,6 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } } - // Initialize power save, call active state monitoring logic. - if (!mRecognitionRunning) { - initializeTelephonyAndPowerStateListeners(); - } - // If the existing SoundModel is different (for the same UUID for Generic and same // keyphrase ID for voice), ensure that it is unloaded and stopped before proceeding. // This works for both keyphrase and generic models. This logic also ensures that a @@ -326,8 +321,16 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { modelData.setRecognitionConfig(recognitionConfig); modelData.setSoundModel(soundModel); - return startRecognitionLocked(modelData, + int status = startRecognitionLocked(modelData, false /* Don't notify for synchronous calls */); + + // Initialize power save, call active state monitoring logic. + if (status == STATUS_OK && !mRecognitionRequested) { + initializeTelephonyAndPowerStateListeners(); + mRecognitionRequested = true; + } + + return status; } } @@ -450,7 +453,7 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { modelData.clearCallback(); modelData.setRecognitionConfig(null); - if (!computeRecognitionRunningLocked()) { + if (!computeRecognitionRequestedLocked()) { internalClearGlobalStateLocked(); } @@ -1196,20 +1199,20 @@ public class SoundTriggerHelper implements SoundTrigger.StatusListener { } // Computes whether we have any recognition running at all (voice or generic). Sets - // the mRecognitionRunning variable with the result. - private boolean computeRecognitionRunningLocked() { + // the mRecognitionRequested variable with the result. + private boolean computeRecognitionRequestedLocked() { if (mModuleProperties == null || mModule == null) { - mRecognitionRunning = false; - return mRecognitionRunning; + mRecognitionRequested = false; + return mRecognitionRequested; } for (ModelData modelData : mModelDataMap.values()) { - if (modelData.isModelStarted()) { - mRecognitionRunning = true; - return mRecognitionRunning; + if (modelData.isRequested()) { + mRecognitionRequested = true; + return mRecognitionRequested; } } - mRecognitionRunning = false; - return mRecognitionRunning; + mRecognitionRequested = false; + return mRecognitionRequested; } // This class encapsulates the callbacks, state, handles and any other information that diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java index ef967d71cfa0..cea4fafc7c18 100755 --- a/telephony/java/android/telephony/CarrierConfigManager.java +++ b/telephony/java/android/telephony/CarrierConfigManager.java @@ -2135,6 +2135,15 @@ public class CarrierConfigManager { "data_warning_notification_bool"; /** + * Controls if the device should automatically warn the user that sim voice & data function + * might be limited due to dual sim scenario. When set to {@true} display the notification, + * {@code false} otherwise. + * @hide + */ + public static final String KEY_LIMITED_SIM_FUNCTION_NOTIFICATION_FOR_DSDS_BOOL = + "limited_sim_function_notification_for_dsds_bool"; + + /** * Controls the cellular data limit. * <p> * If the user uses more than this amount of data in their billing cycle, as defined by @@ -2303,6 +2312,13 @@ public class CarrierConfigManager { public static final String KEY_RTT_DOWNGRADE_SUPPORTED_BOOL = "rtt_downgrade_supported_bool"; /** + * Indicates if the TTY HCO and VCO options should be hidden in the accessibility menu + * if the device is capable of RTT. + * @hide + */ + public static final String KEY_HIDE_TTY_HCO_VCO_WITH_RTT_BOOL = "hide_tty_hco_vco_with_rtt"; + + /** * The flag to disable the popup dialog which warns the user of data charges. * @hide */ @@ -2382,6 +2398,14 @@ public class CarrierConfigManager { public static final String KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL = "check_pricing_with_carrier_data_roaming_bool"; + /** + * Determines whether we should show a notification when the phone established a data + * connection in roaming network, to warn users about possible roaming charges. + * @hide + */ + public static final String KEY_SHOW_DATA_CONNECTED_ROAMING_NOTIFICATION_BOOL = + "show_data_connected_roaming_notification"; + /** * A list of 4 LTE RSRP thresholds above which a signal level is considered POOR, * MODERATE, GOOD, or EXCELLENT, to be used in SignalStrength reporting. @@ -3287,6 +3311,7 @@ public class CarrierConfigManager { sDefaults.putInt(KEY_MONTHLY_DATA_CYCLE_DAY_INT, DATA_CYCLE_USE_PLATFORM_DEFAULT); sDefaults.putLong(KEY_DATA_WARNING_THRESHOLD_BYTES_LONG, DATA_CYCLE_USE_PLATFORM_DEFAULT); sDefaults.putBoolean(KEY_DATA_WARNING_NOTIFICATION_BOOL, true); + sDefaults.putBoolean(KEY_LIMITED_SIM_FUNCTION_NOTIFICATION_FOR_DSDS_BOOL, false); sDefaults.putLong(KEY_DATA_LIMIT_THRESHOLD_BYTES_LONG, DATA_CYCLE_USE_PLATFORM_DEFAULT); sDefaults.putBoolean(KEY_DATA_LIMIT_NOTIFICATION_BOOL, true); sDefaults.putBoolean(KEY_DATA_RAPID_NOTIFICATION_BOOL, true); @@ -3340,6 +3365,7 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, false); sDefaults.putBoolean(KEY_RTT_SUPPORTED_BOOL, false); sDefaults.putBoolean(KEY_TTY_SUPPORTED_BOOL, true); + sDefaults.putBoolean(KEY_HIDE_TTY_HCO_VCO_WITH_RTT_BOOL, false); sDefaults.putBoolean(KEY_DISABLE_CHARGE_INDICATION_BOOL, false); sDefaults.putBoolean(KEY_SUPPORT_NO_REPLY_TIMER_FOR_CFNRY_BOOL, true); sDefaults.putStringArray(KEY_FEATURE_ACCESS_CODES_STRING_ARRAY, null); @@ -3358,6 +3384,7 @@ public class CarrierConfigManager { sDefaults.putString(KEY_CARRIER_SETTINGS_ACTIVITY_COMPONENT_NAME_STRING, ""); sDefaults.putBoolean(KEY_CARRIER_CONFIG_APPLIED_BOOL, false); sDefaults.putBoolean(KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL, false); + sDefaults.putBoolean(KEY_SHOW_DATA_CONNECTED_ROAMING_NOTIFICATION_BOOL, false); sDefaults.putIntArray(KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY, new int[] { -128, /* SIGNAL_STRENGTH_POOR */ diff --git a/telephony/java/android/telephony/DisconnectCause.java b/telephony/java/android/telephony/DisconnectCause.java index 6e839ab0ad6b..aa7e21a82500 100644 --- a/telephony/java/android/telephony/DisconnectCause.java +++ b/telephony/java/android/telephony/DisconnectCause.java @@ -333,6 +333,26 @@ public final class DisconnectCause { */ public static final int OTASP_PROVISIONING_IN_PROCESS = 76; + /** + * Indicates that the call is dropped due to RTCP inactivity, primarily due to media path + * disruption. + * @hide + */ + public static final int MEDIA_TIMEOUT = 77; + + /** + * Indicates that an emergency call cannot be placed over WFC because the service is not + * available in the current location. + * @hide + */ + public static final int EMERGENCY_CALL_OVER_WFC_NOT_AVAILABLE = 78; + + /** + * Indicates that WiFi calling service is not available in the current location. + * @hide + */ + public static final int WFC_SERVICE_NOT_AVAILABLE_IN_THIS_LOCATION = 79; + //********************************************************************************************* // When adding a disconnect type: // 1) Update toString() with the newly added disconnect type. @@ -501,6 +521,12 @@ public final class DisconnectCause { return "TOO_MANY_ONGOING_CALLS"; case OTASP_PROVISIONING_IN_PROCESS: return "OTASP_PROVISIONING_IN_PROCESS"; + case MEDIA_TIMEOUT: + return "MEDIA_TIMEOUT"; + case EMERGENCY_CALL_OVER_WFC_NOT_AVAILABLE: + return "EMERGENCY_CALL_OVER_WFC_NOT_AVAILABLE"; + case WFC_SERVICE_NOT_AVAILABLE_IN_THIS_LOCATION: + return "WFC_SERVICE_NOT_AVAILABLE_IN_THIS_LOCATION"; default: return "INVALID: " + cause; } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 976cd0c577e4..7477c3e29448 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2417,6 +2417,10 @@ public class TelephonyManager { * registered operator or the cell nearby, if available. * . * <p> + * Note: In multi-sim, this returns a shared emergency network country iso from other + * subscription if the subscription used to create the TelephonyManager doesn't camp on + * a network due to some reason (e.g. pin/puk locked), or sim is absent in the corresponding + * slot. * Note: Result may be unreliable on CDMA networks (use {@link #getPhoneType()} to determine * if on a CDMA network). */ diff --git a/telephony/java/android/telephony/emergency/EmergencyNumber.java b/telephony/java/android/telephony/emergency/EmergencyNumber.java index 511adf6ad65b..19d07242132b 100644 --- a/telephony/java/android/telephony/emergency/EmergencyNumber.java +++ b/telephony/java/android/telephony/emergency/EmergencyNumber.java @@ -22,6 +22,7 @@ import android.hardware.radio.V1_4.EmergencyNumberSource; import android.hardware.radio.V1_4.EmergencyServiceCategory; import android.os.Parcel; import android.os.Parcelable; +import android.telephony.CarrierConfigManager; import android.telephony.PhoneNumberUtils; import android.telephony.Rlog; @@ -301,6 +302,9 @@ public final class EmergencyNumber implements Parcelable, Comparable<EmergencyNu * The character in the number string is only the dial pad * character('0'-'9', '*', '+', or '#'). For example: 911. * + * If the number starts with carrier prefix, the carrier prefix is configured in + * {@link CarrierConfigManager#KEY_EMERGENCY_NUMBER_PREFIX_STRING_ARRAY}. + * * @return the dialing number. */ public @NonNull String getNumber() { diff --git a/telephony/java/android/telephony/ims/ImsReasonInfo.java b/telephony/java/android/telephony/ims/ImsReasonInfo.java index a478606da22a..20aba4d97849 100644 --- a/telephony/java/android/telephony/ims/ImsReasonInfo.java +++ b/telephony/java/android/telephony/ims/ImsReasonInfo.java @@ -871,6 +871,19 @@ public final class ImsReasonInfo implements Parcelable { */ public static final int CODE_REJECT_ONGOING_CS_CALL = 1621; + /** + * An attempt was made to place an emergency call over WFC when emergency services is not + * currently available in the current location. + * @hide + */ + public static final int CODE_EMERGENCY_CALL_OVER_WFC_NOT_AVAILABLE = 1622; + + /** + * Indicates that WiFi calling service is not available in the current location. + * @hide + */ + public static final int CODE_WFC_SERVICE_NOT_AVAILABLE_IN_THIS_LOCATION = 1623; + /* * OEM specific error codes. To be used by OEMs when they don't want to reveal error code which * would be replaced by ERROR_UNSPECIFIED. diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 4115663b8bb8..f540492266c5 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -671,6 +671,14 @@ public class WifiManager { public static final int IFACE_IP_MODE_LOCAL_ONLY = 2; /** + * Broadcast intent action indicating that the wifi network settings + * had been reset. + * @hide + */ + public static final String WIFI_NETWORK_SETTINGS_RESET_ACTION = + "android.net.wifi.action.NETWORK_SETTINGS_RESET"; + + /** * Broadcast intent action indicating that a connection to the supplicant has * been established (and it is now possible * to perform Wi-Fi operations) or the connection to the supplicant has been |