diff options
47 files changed, 454 insertions, 530 deletions
diff --git a/core/java/android/content/res/ColorStateList.java b/core/java/android/content/res/ColorStateList.java index 14bfac5..579634f 100644 --- a/core/java/android/content/res/ColorStateList.java +++ b/core/java/android/content/res/ColorStateList.java @@ -382,6 +382,14 @@ public class ColorStateList implements Parcelable { defaultAlphaMod = 1.0f; } + // Extract the theme attributes, if any, before attempting to + // read from the typed array. This prevents a crash if we have + // unresolved attrs. + themeAttrsList[i] = a.extractThemeAttrs(themeAttrsList[i]); + if (themeAttrsList[i] != null) { + hasUnresolvedAttrs = true; + } + final int baseColor = a.getColor( R.styleable.ColorStateListItem_color, mColors[i]); final float alphaMod = a.getFloat( @@ -391,12 +399,6 @@ public class ColorStateList implements Parcelable { // Account for any configuration changes. mChangingConfigurations |= a.getChangingConfigurations(); - // Extract the theme attributes, if any. - themeAttrsList[i] = a.extractThemeAttrs(themeAttrsList[i]); - if (themeAttrsList[i] != null) { - hasUnresolvedAttrs = true; - } - a.recycle(); } } diff --git a/core/java/android/hardware/camera2/CameraCaptureSession.java b/core/java/android/hardware/camera2/CameraCaptureSession.java index b3e7cfc..c22ee5f 100644 --- a/core/java/android/hardware/camera2/CameraCaptureSession.java +++ b/core/java/android/hardware/camera2/CameraCaptureSession.java @@ -654,16 +654,22 @@ public abstract class CameraCaptureSession implements AutoCloseable { /** * This method is called when the camera device has started capturing - * the output image for the request, at the beginning of image exposure. + * the output image for the request, at the beginning of image exposure, or + * when the camera device has started processing an input image for a reprocess + * request. * - * <p>This callback is invoked right as the capture of a frame begins, - * so it is the most appropriate time for playing a shutter sound, - * or triggering UI indicators of capture.</p> + * <p>For a regular capture request, this callback is invoked right as + * the capture of a frame begins, so it is the most appropriate time + * for playing a shutter sound, or triggering UI indicators of capture.</p> * * <p>The request that is being used for this capture is provided, along - * with the actual timestamp for the start of exposure. This timestamp - * matches the timestamp that will be included in - * {@link CaptureResult#SENSOR_TIMESTAMP the result timestamp field}, + * with the actual timestamp for the start of exposure. For a reprocess + * request, this timestamp will be the input image's start of exposure + * which matches {@link CaptureResult#SENSOR_TIMESTAMP the result timestamp field} + * of the {@link TotalCaptureResult} that was used to + * {@link CameraDevice#createReprocessCaptureRequest create the reprocess request}. + * This timestamp matches the timestamps that will be + * included in {@link CaptureResult#SENSOR_TIMESTAMP the result timestamp field}, * and in the buffers sent to each output Surface. These buffer * timestamps are accessible through, for example, * {@link android.media.Image#getTimestamp() Image.getTimestamp()} or @@ -679,7 +685,9 @@ public abstract class CameraCaptureSession implements AutoCloseable { * * @param session the session returned by {@link CameraDevice#createCaptureSession} * @param request the request for the capture that just begun - * @param timestamp the timestamp at start of capture, in nanoseconds. + * @param timestamp the timestamp at start of capture for a regular request, or + * the timestamp at the input image's start of capture for a + * reprocess request, in nanoseconds. * @param frameNumber the frame number for this capture * * @see android.media.MediaActionSound diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index 4fe257c..d5867a9 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -1068,20 +1068,35 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri /** * <p>The correction coefficients to correct for this camera device's - * radial lens distortion.</p> - * <p>Three cofficients <code>[kappa_1, kappa_2, kappa_3]</code> that - * can be used to correct the lens's radial geometric - * distortion with the mapping equations:</p> - * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) - * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + * radial and tangential lens distortion.</p> + * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2, + * kappa_3]</code> and two tangential distortion coefficients + * <code>[kappa_4, kappa_5]</code> that can be used to correct the + * lens's geometric distortion with the mapping equations:</p> + * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + + * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 ) + * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + + * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 ) * </code></pre> - * <p>where <code>[x_i, y_i]</code> are normalized coordinates with <code>(0,0)</code> - * at the lens optical center, and <code>[-1, 1]</code> are the edges of - * the active pixel array; and where <code>[x_c, y_c]</code> are the - * corrected normalized coordinates with radial distortion - * removed; and <code>r^2 = x_i^2 + y_i^2</code>.</p> + * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the + * input image that correspond to the pixel values in the + * corrected image at the coordinate <code>[x_i, y_i]</code>:</p> + * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage) + * </code></pre> + * <p>The pixel coordinates are defined in a normalized + * coordinate system related to the + * android.lens.intrinsicCalibration calibration fields. + * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the + * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes + * of both x and y coordinates are normalized to be 1 at the + * edge further from the optical center, so the range + * for both dimensions is <code>-1 <= x <= 1</code>.</p> + * <p>Finally, <code>r</code> represents the radial distance from the + * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude + * is therefore no larger than <code>|r| <= sqrt(2)</code>.</p> + * <p>The distortion model used is the Brown-Conrady model.</p> * <p><b>Units</b>: - * Coefficients for a 6th-degree even radial polynomial.</p> + * Unitless coefficients.</p> * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> */ @PublicKey diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index f4017d0..df6c986 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -2649,20 +2649,35 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { /** * <p>The correction coefficients to correct for this camera device's - * radial lens distortion.</p> - * <p>Three cofficients <code>[kappa_1, kappa_2, kappa_3]</code> that - * can be used to correct the lens's radial geometric - * distortion with the mapping equations:</p> - * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) - * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + * radial and tangential lens distortion.</p> + * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2, + * kappa_3]</code> and two tangential distortion coefficients + * <code>[kappa_4, kappa_5]</code> that can be used to correct the + * lens's geometric distortion with the mapping equations:</p> + * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + + * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 ) + * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + + * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 ) * </code></pre> - * <p>where <code>[x_i, y_i]</code> are normalized coordinates with <code>(0,0)</code> - * at the lens optical center, and <code>[-1, 1]</code> are the edges of - * the active pixel array; and where <code>[x_c, y_c]</code> are the - * corrected normalized coordinates with radial distortion - * removed; and <code>r^2 = x_i^2 + y_i^2</code>.</p> + * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the + * input image that correspond to the pixel values in the + * corrected image at the coordinate <code>[x_i, y_i]</code>:</p> + * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage) + * </code></pre> + * <p>The pixel coordinates are defined in a normalized + * coordinate system related to the + * android.lens.intrinsicCalibration calibration fields. + * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the + * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes + * of both x and y coordinates are normalized to be 1 at the + * edge further from the optical center, so the range + * for both dimensions is <code>-1 <= x <= 1</code>.</p> + * <p>Finally, <code>r</code> represents the radial distance from the + * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude + * is therefore no larger than <code>|r| <= sqrt(2)</code>.</p> + * <p>The distortion model used is the Brown-Conrady model.</p> * <p><b>Units</b>: - * Coefficients for a 6th-degree even radial polynomial.</p> + * Unitless coefficients.</p> * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> */ @PublicKey @@ -2988,6 +3003,10 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can * be compared to other timestamps from other subsystems that * are using that base.</p> + * <p>For reprocessing, the timestamp will match the start of exposure of + * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the + * timestamp} in the TotalCaptureResult that was used to create the + * reprocess capture request.</p> * <p><b>Units</b>: Nanoseconds</p> * <p><b>Range of valid values:</b><br> * > 0</p> diff --git a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java index 2de846c..943e421 100644 --- a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java +++ b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java @@ -752,12 +752,14 @@ public class LegacyMetadataMapper { CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES , CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE , CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP , + CameraCharacteristics.CONTROL_AE_LOCK_AVAILABLE , CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES , CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS , CameraCharacteristics.CONTROL_AVAILABLE_MODES , CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES , CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES , CameraCharacteristics.CONTROL_AWB_AVAILABLE_MODES , + CameraCharacteristics.CONTROL_AWB_LOCK_AVAILABLE , CameraCharacteristics.CONTROL_MAX_REGIONS , CameraCharacteristics.FLASH_INFO_AVAILABLE , CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL , diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index dfd523a..50eed3e 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -685,8 +685,6 @@ public class Build { final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint"); final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader"); final String currentBootloader = SystemProperties.get("ro.bootloader"); - final String requiredRecovery = SystemProperties.get("ro.expect.recovery_id"); - final String currentRecovery = SystemProperties.get("ro.recovery_id"); final String requiredRadio = SystemProperties.get("ro.build.expect.baseband"); final String currentRadio = SystemProperties.get("gsm.version.baseband"); @@ -703,6 +701,7 @@ public class Build { } } + /* TODO: Figure out issue with checks failing if (!TextUtils.isEmpty(bootimage)) { if (!Objects.equals(system, bootimage)) { Slog.e(TAG, "Mismatched fingerprints; system reported " + system @@ -719,15 +718,6 @@ public class Build { } } - if (!TextUtils.isEmpty(requiredRecovery)) { - if (!Objects.equals(currentRecovery, requiredRecovery)) { - Slog.e(TAG, "Mismatched recovery version: build requires " + requiredRecovery - + " but runtime reports " + currentRecovery); - return false; - } - } - - /* TODO: uncomment when new bootloader lands b/20860620 if (!TextUtils.isEmpty(requiredRadio)) { if (!Objects.equals(currentRadio, requiredRadio)) { Slog.e(TAG, "Mismatched radio version: build requires " + requiredRadio diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index e963f53..a3332fa 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -820,44 +820,36 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mOwnerThread = Thread.currentThread(); final TypedArray a = context.obtainStyledAttributes( - attrs, com.android.internal.R.styleable.AbsListView, defStyleAttr, defStyleRes); + attrs, R.styleable.AbsListView, defStyleAttr, defStyleRes); - Drawable d = a.getDrawable(com.android.internal.R.styleable.AbsListView_listSelector); - if (d != null) { - setSelector(d); - } - - mDrawSelectorOnTop = a.getBoolean( - com.android.internal.R.styleable.AbsListView_drawSelectorOnTop, false); - - boolean stackFromBottom = a.getBoolean(R.styleable.AbsListView_stackFromBottom, false); - setStackFromBottom(stackFromBottom); - - boolean scrollingCacheEnabled = a.getBoolean(R.styleable.AbsListView_scrollingCache, true); - setScrollingCacheEnabled(scrollingCacheEnabled); - - boolean useTextFilter = a.getBoolean(R.styleable.AbsListView_textFilterEnabled, false); - setTextFilterEnabled(useTextFilter); - - int transcriptMode = a.getInt(R.styleable.AbsListView_transcriptMode, - TRANSCRIPT_MODE_DISABLED); - setTranscriptMode(transcriptMode); - - int color = a.getColor(R.styleable.AbsListView_cacheColorHint, 0); - setCacheColorHint(color); - - boolean enableFastScroll = a.getBoolean(R.styleable.AbsListView_fastScrollEnabled, false); - setFastScrollEnabled(enableFastScroll); - - int fastScrollStyle = a.getResourceId(R.styleable.AbsListView_fastScrollStyle, 0); - setFastScrollStyle(fastScrollStyle); - - boolean smoothScrollbar = a.getBoolean(R.styleable.AbsListView_smoothScrollbar, true); - setSmoothScrollbarEnabled(smoothScrollbar); - - setChoiceMode(a.getInt(R.styleable.AbsListView_choiceMode, CHOICE_MODE_NONE)); - setFastScrollAlwaysVisible( - a.getBoolean(R.styleable.AbsListView_fastScrollAlwaysVisible, false)); + final Drawable selector = a.getDrawable(R.styleable.AbsListView_listSelector); + if (selector != null) { + setSelector(selector); + } + + mDrawSelectorOnTop = a.getBoolean(R.styleable.AbsListView_drawSelectorOnTop, false); + + setStackFromBottom(a.getBoolean( + R.styleable.AbsListView_stackFromBottom, false)); + setScrollingCacheEnabled(a.getBoolean( + R.styleable.AbsListView_scrollingCache, true)); + setTextFilterEnabled(a.getBoolean( + R.styleable.AbsListView_textFilterEnabled, false)); + setTranscriptMode(a.getInt( + R.styleable.AbsListView_transcriptMode, TRANSCRIPT_MODE_DISABLED)); + setCacheColorHint(a.getColor( + R.styleable.AbsListView_cacheColorHint, 0)); + setSmoothScrollbarEnabled(a.getBoolean( + R.styleable.AbsListView_smoothScrollbar, true)); + setChoiceMode(a.getInt( + R.styleable.AbsListView_choiceMode, CHOICE_MODE_NONE)); + + setFastScrollEnabled(a.getBoolean( + R.styleable.AbsListView_fastScrollEnabled, false)); + setFastScrollStyle(a.getResourceId( + R.styleable.AbsListView_fastScrollStyle, 0)); + setFastScrollAlwaysVisible(a.getBoolean( + R.styleable.AbsListView_fastScrollAlwaysVisible, false)); a.recycle(); } diff --git a/core/java/com/android/internal/policy/IKeyguardService.aidl b/core/java/com/android/internal/policy/IKeyguardService.aidl index f93b1a1..7ab4651 100644 --- a/core/java/com/android/internal/policy/IKeyguardService.aidl +++ b/core/java/com/android/internal/policy/IKeyguardService.aidl @@ -22,6 +22,7 @@ import com.android.internal.policy.IKeyguardExitCallback; import android.os.Bundle; oneway interface IKeyguardService { + /** * Sets the Keyguard as occluded when a window dismisses the Keyguard with flag * FLAG_SHOW_ON_LOCK_SCREEN. @@ -36,8 +37,27 @@ oneway interface IKeyguardService { void dismiss(); void onDreamingStarted(); void onDreamingStopped(); - void onScreenTurnedOff(int reason); - void onScreenTurnedOn(IKeyguardShowCallback callback); + + /** + * Called when the device has started going to sleep. + * + * @param why {@link #OFF_BECAUSE_OF_USER}, {@link #OFF_BECAUSE_OF_ADMIN}, + * or {@link #OFF_BECAUSE_OF_TIMEOUT}. + */ + void onStartedGoingToSleep(int reason); + + /** + * Called when the device has finished going to sleep. + * + * @param why {@link #OFF_BECAUSE_OF_USER}, {@link #OFF_BECAUSE_OF_ADMIN}, + * or {@link #OFF_BECAUSE_OF_TIMEOUT}. + */ + void onFinishedGoingToSleep(int reason); + + /** + * Called when the device has started waking up. + */ + void onStartedWakingUp(IKeyguardShowCallback callback); void setKeyguardEnabled(boolean enabled); void onSystemReady(); void doKeyguardTimeout(in Bundle options); diff --git a/core/java/com/android/internal/widget/FloatingToolbar.java b/core/java/com/android/internal/widget/FloatingToolbar.java index 3cff59a..1fc0ac3 100644 --- a/core/java/com/android/internal/widget/FloatingToolbar.java +++ b/core/java/com/android/internal/widget/FloatingToolbar.java @@ -353,10 +353,14 @@ public final class FloatingToolbar { * from. */ public FloatingToolbarPopup(View parent) { + mMarginHorizontal = parent.getResources() + .getDimensionPixelSize(R.dimen.floating_toolbar_horizontal_margin); + mMarginVertical = parent.getResources() + .getDimensionPixelSize(R.dimen.floating_toolbar_vertical_margin); mParent = Preconditions.checkNotNull(parent); mContentContainer = createContentContainer(parent.getContext()); mPopupWindow = createPopupWindow(mContentContainer); - mShowAnimation = createGrowFadeInFromBottom(mContentContainer); + mShowAnimation = createGrowFadeInFromBottom(mContentContainer, mMarginHorizontal); mDismissAnimation = createShrinkFadeOutFromBottomAnimation( mContentContainer, 150, // startDelay @@ -376,17 +380,15 @@ public final class FloatingToolbar { mPopupWindow.dismiss(); } }); - mMarginHorizontal = parent.getResources() - .getDimensionPixelSize(R.dimen.floating_toolbar_horizontal_margin); - mMarginVertical = parent.getResources() - .getDimensionPixelSize(R.dimen.floating_toolbar_vertical_margin); } /** * Lays out buttons for the specified menu items. */ - public void layoutMenuItems(List<MenuItem> menuItems, - MenuItem.OnMenuItemClickListener menuItemClickListener, int suggestedWidth) { + public void layoutMenuItems( + List<MenuItem> menuItems, + MenuItem.OnMenuItemClickListener menuItemClickListener, + int suggestedWidth) { Preconditions.checkNotNull(menuItems); mContentContainer.removeAllViews(); @@ -593,7 +595,9 @@ public final class FloatingToolbar { final int startWidth = mContentContainer.getWidth(); final int startHeight = mContentContainer.getHeight(); final float startY = mContentContainer.getY(); - final float right = mContentContainer.getX() + mContentContainer.getWidth(); + final float left = mContentContainer.getX(); + final float right = left + mContentContainer.getWidth(); + final boolean rtl = mContentContainer.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; Animation widthAnimation = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { @@ -601,7 +605,11 @@ public final class FloatingToolbar { int deltaWidth = (int) (interpolatedTime * (targetWidth - startWidth)); params.width = startWidth + deltaWidth; mContentContainer.setLayoutParams(params); - mContentContainer.setX(right - mContentContainer.getWidth()); + if (rtl) { + mContentContainer.setX(left); + } else { + mContentContainer.setX(right - mContentContainer.getWidth()); + } } }; Animation heightAnimation = new Animation() { @@ -644,9 +652,11 @@ public final class FloatingToolbar { final int targetHeight = mainPanelSize.getHeight(); final int startWidth = mContentContainer.getWidth(); final int startHeight = mContentContainer.getHeight(); - final float right = mContentContainer.getX() + mContentContainer.getWidth(); final float bottom = mContentContainer.getY() + mContentContainer.getHeight(); final boolean morphedUpwards = (mOverflowDirection == OVERFLOW_DIRECTION_UP); + final float left = mContentContainer.getX(); + final float right = left + mContentContainer.getWidth(); + final boolean rtl = mContentContainer.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL; Animation widthAnimation = new Animation() { @Override protected void applyTransformation(float interpolatedTime, Transformation t) { @@ -654,7 +664,11 @@ public final class FloatingToolbar { int deltaWidth = (int) (interpolatedTime * (targetWidth - startWidth)); params.width = startWidth + deltaWidth; mContentContainer.setLayoutParams(params); - mContentContainer.setX(right - mContentContainer.getWidth()); + if (rtl) { + mContentContainer.setX(left); + } else { + mContentContainer.setX(right - mContentContainer.getWidth()); + } } }; Animation heightAnimation = new Animation() { @@ -747,9 +761,7 @@ public final class FloatingToolbar { */ private void positionMainPanel() { Preconditions.checkNotNull(mMainPanel); - float x = mPopupWindow.getWidth() - - (mMainPanel.getView().getMeasuredWidth() + mMarginHorizontal); - mContentContainer.setX(x); + mContentContainer.setX(mMarginHorizontal); float y = mMarginVertical; if (mOverflowDirection == OVERFLOW_DIRECTION_UP) { @@ -1320,12 +1332,14 @@ public final class FloatingToolbar { * * @param view The view to animate */ - private static AnimatorSet createGrowFadeInFromBottom(View view) { + private static AnimatorSet createGrowFadeInFromBottom(View view, int x) { AnimatorSet growFadeInFromBottomAnimation = new AnimatorSet(); growFadeInFromBottomAnimation.playTogether( ObjectAnimator.ofFloat(view, View.SCALE_X, 0.5f, 1).setDuration(125), ObjectAnimator.ofFloat(view, View.SCALE_Y, 0.5f, 1).setDuration(125), - ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1).setDuration(75)); + ObjectAnimator.ofFloat(view, View.ALPHA, 0, 1).setDuration(75), + // Make sure that view.x is always fixed throughout the duration of this animation. + ObjectAnimator.ofFloat(view, View.X, x, x)); growFadeInFromBottomAnimation.setStartDelay(50); return growFadeInFromBottomAnimation; } diff --git a/core/java/com/android/internal/widget/SwipeDismissLayout.java b/core/java/com/android/internal/widget/SwipeDismissLayout.java index 6d4e058..35ed63b 100644 --- a/core/java/com/android/internal/widget/SwipeDismissLayout.java +++ b/core/java/com/android/internal/widget/SwipeDismissLayout.java @@ -16,9 +16,11 @@ package com.android.internal.widget; -import android.animation.TimeInterpolator; import android.app.Activity; +import android.content.BroadcastReceiver; import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; import android.content.res.TypedArray; import android.util.AttributeSet; import android.util.Log; @@ -28,8 +30,6 @@ import android.view.View; import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.ViewTreeObserver; -import android.view.animation.AccelerateInterpolator; -import android.view.animation.DecelerateInterpolator; import android.widget.FrameLayout; /** @@ -62,10 +62,6 @@ public class SwipeDismissLayout extends FrameLayout { // Cached ViewConfiguration and system-wide constant values private int mSlop; private int mMinFlingVelocity; - private int mMaxFlingVelocity; - private long mAnimationTime; - private TimeInterpolator mCancelInterpolator; - private TimeInterpolator mDismissInterpolator; // Transient properties private int mActiveTouchId; @@ -92,6 +88,18 @@ public class SwipeDismissLayout extends FrameLayout { } } }; + private BroadcastReceiver mScreenOffReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (mDismissed) { + dismiss(); + } else { + cancel(); + } + resetMembers(); + } + }; + private IntentFilter mScreenOffFilter = new IntentFilter(Intent.ACTION_SCREEN_OFF); private float mLastX; @@ -114,11 +122,6 @@ public class SwipeDismissLayout extends FrameLayout { ViewConfiguration vc = ViewConfiguration.get(context); mSlop = vc.getScaledTouchSlop(); mMinFlingVelocity = vc.getScaledMinimumFlingVelocity(); - mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity(); - mAnimationTime = getContext().getResources().getInteger( - android.R.integer.config_shortAnimTime); - mCancelInterpolator = new DecelerateInterpolator(1.5f); - mDismissInterpolator = new AccelerateInterpolator(1.5f); TypedArray a = context.getTheme().obtainStyledAttributes( com.android.internal.R.styleable.Theme); mUseDynamicTranslucency = !a.hasValue( @@ -141,15 +144,17 @@ public class SwipeDismissLayout extends FrameLayout { getViewTreeObserver().addOnEnterAnimationCompleteListener( mOnEnterAnimationCompleteListener); } + getContext().registerReceiver(mScreenOffReceiver, mScreenOffFilter); } @Override protected void onDetachedFromWindow() { - super.onDetachedFromWindow(); + getContext().unregisterReceiver(mScreenOffReceiver); if (getContext() instanceof Activity) { getViewTreeObserver().removeOnEnterAnimationCompleteListener( mOnEnterAnimationCompleteListener); } + super.onDetachedFromWindow(); } @Override diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java index f159c30..701bd67 100644 --- a/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java +++ b/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java @@ -621,9 +621,6 @@ public class AndroidKeyStoreSpi extends KeyStoreSpi { (params.getKeyValidityForConsumptionEnd() != null) ? params.getKeyValidityForConsumptionEnd() : new Date(Long.MAX_VALUE)); - // TODO: Remove this once keymaster does not require us to specify the size of imported key. - args.addInt(KeymasterDefs.KM_TAG_KEY_SIZE, keyMaterial.length * 8); - if (((purposes & KeyProperties.PURPOSE_ENCRYPT) != 0) && (!params.isRandomizedEncryptionRequired())) { // Permit caller-provided IV when encrypting with this key diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index 668f80a..13714d3 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -77,7 +77,6 @@ import java.util.Map; import java.util.Scanner; import java.util.Set; import java.util.Vector; -import java.util.concurrent.atomic.AtomicBoolean; import java.lang.ref.WeakReference; /** @@ -624,9 +623,6 @@ public class MediaPlayer implements SubtitleController.Listener private int mUsage = -1; private boolean mBypassInterruptionPolicy; - // use AtomicBoolean instead of boolean so we can use the same member both as a flag and a lock. - private AtomicBoolean mPreparing = new AtomicBoolean(); - /** * Default constructor. Consider using one of the create() methods for * synchronously instantiating a MediaPlayer from a Uri or resource. @@ -1166,10 +1162,6 @@ public class MediaPlayer implements SubtitleController.Listener * @throws IllegalStateException if it is called in an invalid state */ public void prepare() throws IOException, IllegalStateException { - // The synchronous version of prepare also recieves a MEDIA_PREPARED message. - synchronized (mPreparing) { - mPreparing.set(true); - } _prepare(); scanInternalSubtitleTracks(); } @@ -1186,14 +1178,7 @@ public class MediaPlayer implements SubtitleController.Listener * * @throws IllegalStateException if it is called in an invalid state */ - public void prepareAsync() throws IllegalStateException { - synchronized (mPreparing) { - mPreparing.set(true); - } - _prepareAsync(); - } - - private native void _prepareAsync() throws IllegalStateException; + public native void prepareAsync() throws IllegalStateException; /** * Starts or resumes playback. If playback had previously been paused, @@ -1244,9 +1229,6 @@ public class MediaPlayer implements SubtitleController.Listener * initialized. */ public void stop() throws IllegalStateException { - synchronized (mPreparing) { - mPreparing.set(false); - } stayAwake(false); _stop(); } @@ -1676,9 +1658,6 @@ public class MediaPlayer implements SubtitleController.Listener * at the same time. */ public void release() { - synchronized (mPreparing) { - mPreparing.set(false); - } stayAwake(false); updateSurfaceScreenOn(); mOnPreparedListener = null; @@ -1705,9 +1684,6 @@ public class MediaPlayer implements SubtitleController.Listener * data source and calling prepare(). */ public void reset() { - synchronized (mPreparing) { - mPreparing.set(false); - } mSelectedSubtitleTrackIndex = -1; synchronized(mOpenSubtitleSources) { for (final InputStream is: mOpenSubtitleSources) { @@ -2828,11 +2804,15 @@ public class MediaPlayer implements SubtitleController.Listener } switch(msg.what) { case MEDIA_PREPARED: - synchronized (mPreparing) { - if (mPreparing.get()) { - scanInternalSubtitleTracks(); - mPreparing.set(false); - } + try { + scanInternalSubtitleTracks(); + } catch (RuntimeException e) { + // send error message instead of crashing; + // send error message instead of inlining a call to onError + // to avoid code duplication. + Message msg2 = obtainMessage( + MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, MEDIA_ERROR_UNSUPPORTED, null); + sendMessage(msg2); } if (mOnPreparedListener != null) mOnPreparedListener.onPrepared(mMediaPlayer); @@ -2908,7 +2888,13 @@ public class MediaPlayer implements SubtitleController.Listener Log.i(TAG, "Info (" + msg.arg1 + "," + msg.arg2 + ")"); break; case MEDIA_INFO_METADATA_UPDATE: - scanInternalSubtitleTracks(); + try { + scanInternalSubtitleTracks(); + } catch (RuntimeException e) { + Message msg2 = obtainMessage( + MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, MEDIA_ERROR_UNSUPPORTED, null); + sendMessage(msg2); + } // fall through case MEDIA_INFO_EXTERNAL_METADATA_UPDATE: diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp index 9c67278..d8041f4 100644 --- a/media/jni/android_media_MediaPlayer.cpp +++ b/media/jni/android_media_MediaPlayer.cpp @@ -1045,7 +1045,7 @@ static JNINativeMethod gMethods[] = { {"_setDataSource", "(Landroid/media/MediaDataSource;)V",(void *)android_media_MediaPlayer_setDataSourceCallback }, {"_setVideoSurface", "(Landroid/view/Surface;)V", (void *)android_media_MediaPlayer_setVideoSurface}, {"_prepare", "()V", (void *)android_media_MediaPlayer_prepare}, - {"_prepareAsync", "()V", (void *)android_media_MediaPlayer_prepareAsync}, + {"prepareAsync", "()V", (void *)android_media_MediaPlayer_prepareAsync}, {"_start", "()V", (void *)android_media_MediaPlayer_start}, {"_stop", "()V", (void *)android_media_MediaPlayer_stop}, {"getVideoWidth", "()I", (void *)android_media_MediaPlayer_getVideoWidth}, diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java index 68803b3..f324933 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java @@ -205,7 +205,9 @@ public class WifiTracker { * Gets the current list of access points. */ public List<AccessPoint> getAccessPoints() { - return mAccessPoints; + synchronized (mAccessPoints) { + return new ArrayList<>(mAccessPoints); + } } public WifiManager getManager() { @@ -230,14 +232,14 @@ public class WifiTracker { public void dump(PrintWriter pw) { pw.println(" - wifi tracker ------"); - for (AccessPoint accessPoint : mAccessPoints) { + for (AccessPoint accessPoint : getAccessPoints()) { pw.println(" " + accessPoint); } } private void updateAccessPoints() { // Swap the current access points into a cached list. - ArrayList<AccessPoint> cachedAccessPoints = new ArrayList<>(mAccessPoints); + List<AccessPoint> cachedAccessPoints = getAccessPoints(); ArrayList<AccessPoint> accessPoints = new ArrayList<>(); // Clear out the configs so we don't think something is saved when it isn't. @@ -330,7 +332,7 @@ public class WifiTracker { mMainHandler.sendEmptyMessage(MainHandler.MSG_ACCESS_POINT_CHANGED); } - private AccessPoint getCachedOrCreate(ScanResult result, ArrayList<AccessPoint> cache) { + private AccessPoint getCachedOrCreate(ScanResult result, List<AccessPoint> cache) { final int N = cache.size(); for (int i = 0; i < N; i++) { if (cache.get(i).matches(result)) { @@ -342,7 +344,7 @@ public class WifiTracker { return new AccessPoint(mContext, result); } - private AccessPoint getCachedOrCreate(WifiConfiguration config, ArrayList<AccessPoint> cache) { + private AccessPoint getCachedOrCreate(WifiConfiguration config, List<AccessPoint> cache) { final int N = cache.size(); for (int i = 0; i < N; i++) { if (cache.get(i).matches(config)) { @@ -380,7 +382,9 @@ public class WifiTracker { } } if (reorder) { - Collections.sort(mAccessPoints); + synchronized (mAccessPoints) { + Collections.sort(mAccessPoints); + } mMainHandler.sendEmptyMessage(MainHandler.MSG_ACCESS_POINT_CHANGED); } } diff --git a/packages/SystemUI/res/anim/ic_signal_blink_1.xml b/packages/SystemUI/res/anim/ic_signal_blink_1.xml index ab1905a..64580d1 100644 --- a/packages/SystemUI/res/anim/ic_signal_blink_1.xml +++ b/packages/SystemUI/res/anim/ic_signal_blink_1.xml @@ -23,16 +23,16 @@ android:valueType="colorType"> <keyframe android:fraction="0.0" - android:value="@color/light_mode_icon_color_dual_tone_fill"/> + android:value="?attr/fillColor"/> <keyframe android:fraction="0.32" - android:value="@color/light_mode_icon_color_dual_tone_fill"/> + android:value="?attr/fillColor"/> <keyframe android:fraction="0.33" - android:value="@color/light_mode_icon_color_dual_tone_background"/> + android:value="?attr/backgroundColor"/> <keyframe android:fraction="1.0" - android:value="@color/light_mode_icon_color_dual_tone_background"/> + android:value="?attr/backgroundColor"/> </propertyValuesHolder> </objectAnimator> diff --git a/packages/SystemUI/res/anim/ic_signal_blink_2.xml b/packages/SystemUI/res/anim/ic_signal_blink_2.xml index 1b7ace2..f055cd0 100644 --- a/packages/SystemUI/res/anim/ic_signal_blink_2.xml +++ b/packages/SystemUI/res/anim/ic_signal_blink_2.xml @@ -23,22 +23,22 @@ android:valueType="colorType"> <keyframe android:fraction="0.0" - android:value="@color/light_mode_icon_color_dual_tone_background"/> + android:value="?attr/backgroundColor"/> <keyframe android:fraction="0.32" - android:value="@color/light_mode_icon_color_dual_tone_background"/> + android:value="?attr/backgroundColor"/> <keyframe android:fraction="0.33" - android:value="@color/light_mode_icon_color_dual_tone_fill"/> + android:value="?attr/fillColor"/> <keyframe android:fraction="0.66" - android:value="@color/light_mode_icon_color_dual_tone_fill"/> + android:value="?attr/fillColor"/> <keyframe android:fraction="0.67" - android:value="@color/light_mode_icon_color_dual_tone_background"/> + android:value="?attr/backgroundColor"/> <keyframe android:fraction="1.0" - android:value="@color/light_mode_icon_color_dual_tone_background"/> + android:value="?attr/backgroundColor"/> </propertyValuesHolder> </objectAnimator> diff --git a/packages/SystemUI/res/anim/ic_signal_blink_3.xml b/packages/SystemUI/res/anim/ic_signal_blink_3.xml index cee831c..abcd774 100644 --- a/packages/SystemUI/res/anim/ic_signal_blink_3.xml +++ b/packages/SystemUI/res/anim/ic_signal_blink_3.xml @@ -23,16 +23,16 @@ android:valueType="colorType"> <keyframe android:fraction="0.0" - android:value="@color/light_mode_icon_color_dual_tone_background"/> + android:value="?attr/backgroundColor"/> <keyframe android:fraction="0.66" - android:value="@color/light_mode_icon_color_dual_tone_background"/> + android:value="?attr/backgroundColor"/> <keyframe android:fraction="0.67" - android:value="@color/light_mode_icon_color_dual_tone_fill"/> + android:value="?attr/fillColor"/> <keyframe android:fraction="1.0" - android:value="@color/light_mode_icon_color_dual_tone_fill"/> + android:value="?attr/fillColor"/> </propertyValuesHolder> </objectAnimator> diff --git a/packages/SystemUI/res/anim/ic_signal_dark_blink_1.xml b/packages/SystemUI/res/anim/ic_signal_dark_blink_1.xml deleted file mode 100644 index 9d398fa..0000000 --- a/packages/SystemUI/res/anim/ic_signal_dark_blink_1.xml +++ /dev/null @@ -1,38 +0,0 @@ -<!-- - Copyright (C) 2015 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. ---> -<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:anim/linear_interpolator" - android:duration="@integer/carrier_network_change_anim_time" - android:repeatCount="-1"> - - <propertyValuesHolder - android:propertyName="fillColor" - android:valueType="colorType"> - <keyframe - android:fraction="0.0" - android:value="@color/dark_mode_icon_color_dual_tone_fill"/> - <keyframe - android:fraction="0.32" - android:value="@color/dark_mode_icon_color_dual_tone_fill"/> - <keyframe - android:fraction="0.33" - android:value="@color/dark_mode_icon_color_dual_tone_background"/> - <keyframe - android:fraction="1.0" - android:value="@color/dark_mode_icon_color_dual_tone_background"/> - </propertyValuesHolder> - -</objectAnimator> diff --git a/packages/SystemUI/res/anim/ic_signal_dark_blink_2.xml b/packages/SystemUI/res/anim/ic_signal_dark_blink_2.xml deleted file mode 100644 index c6e213d..0000000 --- a/packages/SystemUI/res/anim/ic_signal_dark_blink_2.xml +++ /dev/null @@ -1,44 +0,0 @@ -<!-- - Copyright (C) 2015 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. ---> -<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:anim/linear_interpolator" - android:duration="@integer/carrier_network_change_anim_time" - android:repeatCount="-1"> - - <propertyValuesHolder - android:propertyName="fillColor" - android:valueType="colorType"> - <keyframe - android:fraction="0.0" - android:value="@color/dark_mode_icon_color_dual_tone_background"/> - <keyframe - android:fraction="0.32" - android:value="@color/dark_mode_icon_color_dual_tone_background"/> - <keyframe - android:fraction="0.33" - android:value="@color/dark_mode_icon_color_dual_tone_fill"/> - <keyframe - android:fraction="0.66" - android:value="@color/dark_mode_icon_color_dual_tone_fill"/> - <keyframe - android:fraction="0.67" - android:value="@color/dark_mode_icon_color_dual_tone_background"/> - <keyframe - android:fraction="1.0" - android:value="@color/dark_mode_icon_color_dual_tone_background"/> - </propertyValuesHolder> - -</objectAnimator> diff --git a/packages/SystemUI/res/anim/ic_signal_dark_blink_3.xml b/packages/SystemUI/res/anim/ic_signal_dark_blink_3.xml deleted file mode 100644 index dce148c..0000000 --- a/packages/SystemUI/res/anim/ic_signal_dark_blink_3.xml +++ /dev/null @@ -1,38 +0,0 @@ -<!-- - Copyright (C) 2015 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. ---> -<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@android:anim/linear_interpolator" - android:duration="@integer/carrier_network_change_anim_time" - android:repeatCount="-1"> - - <propertyValuesHolder - android:propertyName="fillColor" - android:valueType="colorType"> - <keyframe - android:fraction="0.0" - android:value="@color/dark_mode_icon_color_dual_tone_background"/> - <keyframe - android:fraction="0.66" - android:value="@color/dark_mode_icon_color_dual_tone_background"/> - <keyframe - android:fraction="0.67" - android:value="@color/dark_mode_icon_color_dual_tone_fill"/> - <keyframe - android:fraction="1.0" - android:value="@color/dark_mode_icon_color_dual_tone_fill"/> - </propertyValuesHolder> - -</objectAnimator> diff --git a/packages/SystemUI/res/drawable/stat_sys_signal_dark_carrier_network_change_animation.xml b/packages/SystemUI/res/drawable/stat_sys_signal_dark_carrier_network_change_animation.xml deleted file mode 100644 index ff49d4c..0000000 --- a/packages/SystemUI/res/drawable/stat_sys_signal_dark_carrier_network_change_animation.xml +++ /dev/null @@ -1,27 +0,0 @@ -<!-- - Copyright (C) 2015 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. ---> -<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" - android:drawable="@drawable/stat_sys_signal_carrier_network_change" > - <target - android:name="dot1" - android:animation="@anim/ic_signal_dark_blink_1"/> - <target - android:name="dot2" - android:animation="@anim/ic_signal_dark_blink_2"/> - <target - android:name="dot3" - android:animation="@anim/ic_signal_dark_blink_3"/> -</animated-vector> diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java index 73fa2ed..98558b4 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java @@ -108,15 +108,21 @@ public class KeyguardService extends Service { } @Override // Binder interface - public void onScreenTurnedOff(int reason) { + public void onStartedGoingToSleep(int reason) { checkPermission(); - mKeyguardViewMediator.onScreenTurnedOff(reason); + mKeyguardViewMediator.onStartedGoingToSleep(reason); } @Override // Binder interface - public void onScreenTurnedOn(IKeyguardShowCallback callback) { + public void onFinishedGoingToSleep(int reason) { checkPermission(); - mKeyguardViewMediator.onScreenTurnedOn(callback); + mKeyguardViewMediator.onFinishedGoingToSleep(reason); + } + + @Override // Binder interface + public void onStartedWakingUp(IKeyguardShowCallback callback) { + checkPermission(); + mKeyguardViewMediator.onStartedWakingUp(callback); } @Override // Binder interface diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 74962ec..bc42105 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -188,11 +188,6 @@ public class KeyguardViewMediator extends SystemUI { private boolean mBootCompleted; private boolean mBootSendUserPresent; - // Whether the next call to playSounds() should be skipped. Defaults to - // true because the first lock (on boot) should be silent. - private boolean mSuppressNextLockSound = true; - - /** High level access to the power manager for WakeLocks */ private PowerManager mPM; @@ -255,7 +250,7 @@ public class KeyguardViewMediator extends SystemUI { private KeyguardUpdateMonitor mUpdateMonitor; - private boolean mScreenOn; + private boolean mDeviceInteractive; // last known state of the cellular connection private String mPhoneState = TelephonyManager.EXTRA_STATE_IDLE; @@ -306,6 +301,18 @@ public class KeyguardViewMediator extends SystemUI { private final ArrayList<IKeyguardStateCallback> mKeyguardStateCallbacks = new ArrayList<>(); + /** + * When starting going to sleep, we figured out that we need to reset Keyguard state and this + * should be committed when finished going to sleep. + */ + private boolean mPendingReset; + + /** + * When starting goign to sleep, we figured out that we need to lock Keyguard and this should be + * committed when finished going to sleep. + */ + private boolean mPendingLock; + KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() { @Override @@ -341,7 +348,7 @@ public class KeyguardViewMediator extends SystemUI { public void onPhoneStateChanged(int phoneState) { synchronized (KeyguardViewMediator.this) { if (TelephonyManager.CALL_STATE_IDLE == phoneState // call ending - && !mScreenOn // screen off + && !mDeviceInteractive // screen off && mExternallyEnabled) { // not disabled by any app // note: this is a way to gracefully reenable the keyguard when the call @@ -514,7 +521,7 @@ public class KeyguardViewMediator extends SystemUI { @Override public boolean isScreenOn() { - return mScreenOn; + return mDeviceInteractive; } }; @@ -550,7 +557,7 @@ public class KeyguardViewMediator extends SystemUI { mViewMediatorCallback, mLockPatternUtils); final ContentResolver cr = mContext.getContentResolver(); - mScreenOn = mPM.isScreenOn(); + mDeviceInteractive = mPM.isInteractive(); mLockSounds = new SoundPool(1, AudioManager.STREAM_SYSTEM, 0); String soundPath = Settings.Global.getString(cr, Settings.Global.LOCK_SOUND); @@ -613,23 +620,18 @@ public class KeyguardViewMediator extends SystemUI { * @param why either {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_USER} or * {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT}. */ - public void onScreenTurnedOff(int why) { + public void onStartedGoingToSleep(int why) { + if (DEBUG) Log.d(TAG, "onStartedGoingToSleep(" + why + ")"); synchronized (this) { - mScreenOn = false; - if (DEBUG) Log.d(TAG, "onScreenTurnedOff(" + why + ")"); - - resetKeyguardDonePendingLocked(); - mHideAnimationRun = false; + mDeviceInteractive = false; // Lock immediately based on setting if secure (user has a pin/pattern/password). // This also "locks" the device when not secure to provide easy access to the // camera while preventing unwanted input. int currentUser = KeyguardUpdateMonitor.getCurrentUser(); final boolean lockImmediately = - mLockPatternUtils.getPowerButtonInstantlyLocks(currentUser) - || !mLockPatternUtils.isSecure(currentUser); - - notifyScreenOffLocked(); + mLockPatternUtils.getPowerButtonInstantlyLocks(currentUser) + || !mLockPatternUtils.isSecure(currentUser); if (mExitSecureCallback != null) { if (DEBUG) Log.d(TAG, "pending exit secure callback cancelled"); @@ -643,12 +645,37 @@ public class KeyguardViewMediator extends SystemUI { hideLocked(); } } else if (mShowing) { - resetStateLocked(); + mPendingReset = true; } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT - || (why == WindowManagerPolicy.OFF_BECAUSE_OF_USER && !lockImmediately)) { + || (why == WindowManagerPolicy.OFF_BECAUSE_OF_USER && !lockImmediately)) { doKeyguardLaterLocked(); - } else { + } else if (!mLockPatternUtils.isLockScreenDisabled(currentUser)) { + mPendingLock = true; + } + + if (mPendingLock || mPendingReset) { + playSounds(true); + } + } + } + + public void onFinishedGoingToSleep(int why) { + if (DEBUG) Log.d(TAG, "onFinishedGoingToSleep(" + why + ")"); + synchronized (this) { + mDeviceInteractive = false; + + resetKeyguardDonePendingLocked(); + mHideAnimationRun = false; + + notifyScreenOffLocked(); + + if (mPendingReset) { + resetStateLocked(); + mPendingReset = false; + } + if (mPendingLock) { doKeyguardLocked(null); + mPendingLock = false; } } KeyguardUpdateMonitor.getInstance(mContext).dispatchScreenTurnedOff(why); @@ -686,7 +713,6 @@ public class KeyguardViewMediator extends SystemUI { if (timeout <= 0) { // Lock now - mSuppressNextLockSound = true; doKeyguardLocked(null); } else { // Lock in the future @@ -706,13 +732,15 @@ public class KeyguardViewMediator extends SystemUI { } /** - * Let's us know the screen was turned on. + * Let's us know when the device is waking up. */ - public void onScreenTurnedOn(IKeyguardShowCallback callback) { + public void onStartedWakingUp(IKeyguardShowCallback callback) { + + // TODO: Rename all screen off/on references to interactive/sleeping synchronized (this) { - mScreenOn = true; + mDeviceInteractive = true; cancelDoKeyguardLaterLocked(); - if (DEBUG) Log.d(TAG, "onScreenTurnedOn, seq = " + mDelayedShowingSequence); + if (DEBUG) Log.d(TAG, "onStartedWakingUp, seq = " + mDelayedShowingSequence); if (callback != null) { notifyScreenOnLocked(callback); } @@ -737,7 +765,8 @@ public class KeyguardViewMediator extends SystemUI { */ public void onDreamingStarted() { synchronized (this) { - if (mScreenOn && mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser())) { + if (mDeviceInteractive + && mLockPatternUtils.isSecure(KeyguardUpdateMonitor.getCurrentUser())) { doKeyguardLaterLocked(); } } @@ -748,7 +777,7 @@ public class KeyguardViewMediator extends SystemUI { */ public void onDreamingStopped() { synchronized (this) { - if (mScreenOn) { + if (mDeviceInteractive) { cancelDoKeyguardLaterLocked(); } } @@ -1100,8 +1129,6 @@ public class KeyguardViewMediator extends SystemUI { + sequence + ", mDelayedShowingSequence = " + mDelayedShowingSequence); synchronized (KeyguardViewMediator.this) { if (mDelayedShowingSequence == sequence) { - // Don't play lockscreen SFX if the screen went off due to timeout. - mSuppressNextLockSound = true; doKeyguardLocked(null); } } @@ -1252,13 +1279,6 @@ public class KeyguardViewMediator extends SystemUI { } private void playSounds(boolean locked) { - // User feedback for keyguard. - - if (mSuppressNextLockSound) { - mSuppressNextLockSound = false; - return; - } - playSound(locked ? mLockSoundId : mUnlockSoundId); } @@ -1283,9 +1303,6 @@ public class KeyguardViewMediator extends SystemUI { } private void playTrustedSound() { - if (mSuppressNextLockSound) { - return; - } playSound(mTrustedSoundId); } @@ -1318,9 +1335,6 @@ public class KeyguardViewMediator extends SystemUI { adjustStatusBarLocked(); userActivity(); - // Do this at the end to not slow down display of the keyguard. - playSounds(true); - mShowKeyguardWakeLock.release(); } mKeyguardDisplayManager.show(); diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java index dcf0438..a9e8b38 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java @@ -162,10 +162,9 @@ public class CellularTile extends QSTile<QSTile.SignalState> { } @Override - public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, - int darkStatusIcon, int statusType, int qsType, boolean activityIn, - boolean activityOut, String typeContentDescription, String description, - boolean isWide, int subId) { + public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, + int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, + String description, boolean isWide, int subId) { if (qsIcon == null) { // Not data sim, don't display. return; diff --git a/packages/SystemUI/src/com/android/systemui/recents/Constants.java b/packages/SystemUI/src/com/android/systemui/recents/Constants.java index c7f8919..18c213d 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/Constants.java +++ b/packages/SystemUI/src/com/android/systemui/recents/Constants.java @@ -29,8 +29,6 @@ public class Constants { public static final boolean EnableTransitionThumbnailDebugMode = false; // Enables the filtering of tasks according to their grouping public static final boolean EnableTaskFiltering = false; - // Enables app-info pane on long-pressing the icon - public static final boolean EnableDevAppInfoOnLongPress = true; // Enables dismiss-all public static final boolean EnableDismissAll = false; // Enables debug mode diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java index 682775b..01ed08a 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java @@ -678,11 +678,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, mHeaderView.mMoveTaskButton.setOnClickListener(this); } mActionButtonView.setOnClickListener(this); - if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) { - if (mConfig.developerOptionsEnabled) { - mHeaderView.mApplicationIcon.setOnLongClickListener(this); - } - } + mHeaderView.mApplicationIcon.setOnLongClickListener(this); } mTaskDataLoaded = true; } @@ -701,9 +697,7 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, mHeaderView.mMoveTaskButton.setOnClickListener(null); } mActionButtonView.setOnClickListener(null); - if (Constants.DebugFlags.App.EnableDevAppInfoOnLongPress) { - mHeaderView.mApplicationIcon.setOnLongClickListener(null); - } + mHeaderView.mApplicationIcon.setOnLongClickListener(null); } mTaskDataLoaded = false; } diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java index 7e32c3a..6d02365 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -60,6 +60,7 @@ import android.widget.ImageView; import com.android.systemui.R; import java.io.File; +import java.io.FileOutputStream; import java.io.OutputStream; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -232,6 +233,12 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi // for DATE_TAKEN long dateSeconds = mImageTime / 1000; + // Save + OutputStream out = new FileOutputStream(mImageFilePath); + image.compress(Bitmap.CompressFormat.PNG, 100, out); + out.flush(); + out.close(); + // Save the screenshot to the MediaStore ContentValues values = new ContentValues(); ContentResolver resolver = context.getContentResolver(); @@ -244,8 +251,10 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi values.put(MediaStore.Images.ImageColumns.MIME_TYPE, "image/png"); values.put(MediaStore.Images.ImageColumns.WIDTH, mImageWidth); values.put(MediaStore.Images.ImageColumns.HEIGHT, mImageHeight); + values.put(MediaStore.Images.ImageColumns.SIZE, new File(mImageFilePath).length()); Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); + // Create a share intent String subjectDate = DateFormat.getDateTimeInstance().format(new Date(mImageTime)); String subject = String.format(SCREENSHOT_SHARE_SUBJECT_TEMPLATE, subjectDate); Intent sharingIntent = new Intent(Intent.ACTION_SEND); @@ -253,16 +262,6 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi sharingIntent.putExtra(Intent.EXTRA_STREAM, uri); sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject); - OutputStream out = resolver.openOutputStream(uri); - image.compress(Bitmap.CompressFormat.PNG, 100, out); - out.flush(); - out.close(); - - // Update file size in the database - values.clear(); - values.put(MediaStore.Images.ImageColumns.SIZE, new File(mImageFilePath).length()); - resolver.update(uri, values, null, null); - // Create a share action for the notification final PendingIntent callback = PendingIntent.getBroadcast(context, 0, new Intent(context, GlobalScreenshot.TargetChosenReceiver.class) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index 991bde5..a66f8ec 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -180,13 +180,12 @@ public class SignalClusterView } @Override - public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int darkStatusIcon, - int statusType, int qsType, boolean activityIn, boolean activityOut, - String typeContentDescription, String description, boolean isWide, int subId) { + public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, + int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, + String description, boolean isWide, int subId) { PhoneState state = getOrInflateState(subId); state.mMobileVisible = statusIcon.visible; state.mMobileStrengthId = statusIcon.icon; - state.mMobileDarkStrengthId = darkStatusIcon; state.mMobileTypeId = statusType; state.mMobileDescription = statusIcon.contentDescription; state.mMobileTypeDescription = typeContentDescription; @@ -426,7 +425,7 @@ public class SignalClusterView private class PhoneState { private final int mSubId; private boolean mMobileVisible = false; - private int mMobileStrengthId = 0, mMobileDarkStrengthId = 0, mMobileTypeId = 0; + private int mMobileStrengthId = 0, mMobileTypeId = 0; private boolean mIsMobileTypeIconWide; private String mMobileDescription, mMobileTypeDescription; @@ -483,9 +482,8 @@ public class SignalClusterView mMobileDark.setPaddingRelative(mIsMobileTypeIconWide ? mWideTypeIconStartPadding : 0, 0, 0, 0); - if (DEBUG) Log.d(TAG, String.format("mobile: %s sig=%d dark=%d typ=%d", - (mMobileVisible ? "VISIBLE" : "GONE"), mMobileStrengthId, - mMobileDarkStrengthId, mMobileTypeId)); + if (DEBUG) Log.d(TAG, String.format("mobile: %s sig=%d typ=%d", + (mMobileVisible ? "VISIBLE" : "GONE"), mMobileStrengthId, mMobileTypeId)); mMobileType.setVisibility(mMobileTypeId != 0 ? View.VISIBLE : View.GONE); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 1e4aa61..5ff4ddb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -349,6 +349,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (!mUserSetup && mStatusBarView != null) animateCollapseQuickSettings(); } + if (mIconPolicy != null) { + mIconPolicy.setCurrentUserSetup(mUserSetup); + } } }; @@ -554,6 +557,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // Lastly, call to the icon policy to install/update all the icons. mIconPolicy = new PhoneStatusBarPolicy(mContext, mCastController, mHotspotController); + mIconPolicy.setCurrentUserSetup(mUserSetup); mSettingsObserver.onChange(false); // set up mHeadsUpObserver.onChange(true); // set up diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java index 7c10c66..0872e06 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone; import android.app.ActivityManagerNative; import android.app.AlarmManager; +import android.app.AlarmManager.AlarmClockInfo; import android.app.IUserSwitchObserver; import android.app.StatusBarManager; import android.bluetooth.BluetoothAdapter; @@ -75,6 +76,7 @@ public class PhoneStatusBarPolicy { private boolean mZenVisible; private boolean mVolumeVisible; + private boolean mCurrentUserSetup; private int mZen; @@ -175,11 +177,12 @@ public class PhoneStatusBarPolicy { } private void updateAlarm() { - final boolean hasAlarm = mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT) != null; + final AlarmClockInfo alarm = mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT); + final boolean hasAlarm = alarm != null && alarm.getTriggerTime() > 0; final boolean zenNone = mZen == Global.ZEN_MODE_NO_INTERRUPTIONS; - mService.setIconVisibility(SLOT_ALARM_CLOCK, hasAlarm); mService.setIcon(SLOT_ALARM_CLOCK, zenNone ? R.drawable.stat_sys_alarm_dim : R.drawable.stat_sys_alarm, 0, null); + mService.setIconVisibility(SLOT_ALARM_CLOCK, mCurrentUserSetup && hasAlarm); } private final void updateSimState(Intent intent) { @@ -391,4 +394,10 @@ public class PhoneStatusBarPolicy { mKeyguardVisible = visible; updateManagedProfile(); } + + public void setCurrentUserSetup(boolean userSetup) { + if (mCurrentUserSetup == userSetup) return; + mCurrentUserSetup = userSetup; + updateAlarm(); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java index 7f52191..e618cb8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java @@ -124,17 +124,16 @@ public class CallbackHandler extends Handler implements EmergencyListener, Signa @Override public void setMobileDataIndicators(final IconState statusIcon, final IconState qsIcon, - final int darkStatusIcon, final int statusType, final int qsType, - final boolean activityIn, final boolean activityOut, - final String typeContentDescription, final String description, final boolean isWide, - final int subId) { + final int statusType, final int qsType,final boolean activityIn, + final boolean activityOut, final String typeContentDescription, + final String description, final boolean isWide, final int subId) { post(new Runnable() { @Override public void run() { for (SignalCallback signalCluster : mSignalCallbacks) { - signalCluster.setMobileDataIndicators(statusIcon, qsIcon, darkStatusIcon, - statusType, qsType, activityIn, activityOut, typeContentDescription, - description, isWide, subId); + signalCluster.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType, + activityIn, activityOut, typeContentDescription, description, isWide, + subId); } } }); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java index 0d59953..cfc95bf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java @@ -117,7 +117,7 @@ public class MobileSignalController extends SignalController< public void setCarrierNetworkChangeMode(boolean carrierNetworkChangeMode) { mCurrentState.carrierNetworkChangeMode = carrierNetworkChangeMode; - notifyListenersIfNecessary(); + updateTelephony(); } /** @@ -220,13 +220,9 @@ public class MobileSignalController extends SignalController< && mCurrentState.activityOut; showDataIcon &= mCurrentState.isDefault; int typeIcon = showDataIcon ? icons.mDataType : 0; - mCallbackHandler.setMobileDataIndicators(statusIcon, qsIcon, getCurrentDarkIconId(), - typeIcon, qsTypeIcon, activityIn, activityOut, dataContentDescription, description, - icons.mIsWide, mSubscriptionInfo.getSubscriptionId()); - } - - private int getCurrentDarkIconId() { - return getCurrentIconId(false /* light */); + mCallbackHandler.setMobileDataIndicators(statusIcon, qsIcon, typeIcon, qsTypeIcon, + activityIn, activityOut, dataContentDescription, description, icons.mIsWide, + mSubscriptionInfo.getSubscriptionId()); } @Override @@ -478,17 +474,8 @@ public class MobileSignalController extends SignalController< int sbNullState, int qsNullState, int sbDiscState, int qsDiscState, int discContentDesc, int dataContentDesc, int dataType, boolean isWide, int qsDataType) { - this(name, sbIcons, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState, - sbDiscState, sbDiscState, qsDiscState, discContentDesc, dataContentDesc, - dataType, isWide, qsDataType); - } - - public MobileIconGroup(String name, int[][] sbIcons, int[][] sbDarkIcons, int[][] qsIcons, - int[] contentDesc, int sbNullState, int qsNullState, int sbDiscState, - int sbDarkDiscState, int qsDiscState, int discContentDesc, int dataContentDesc, - int dataType, boolean isWide, int qsDataType) { - super(name, sbIcons, sbDarkIcons, qsIcons, contentDesc, sbNullState, qsNullState, - sbDiscState, sbDarkDiscState, qsDiscState, discContentDesc); + super(name, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState, sbDiscState, + qsDiscState, discContentDesc); mDataContentDescription = dataContentDesc; mDataType = dataType; mIsWide = isWide; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index 070ca63..38656ee 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -38,9 +38,9 @@ public interface NetworkController { void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon, boolean activityIn, boolean activityOut, String description); - void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int darkStatusIcon, - int statusType, int qsType, boolean activityIn, boolean activityOut, - String typeContentDescription, String description, boolean isWide, int subId); + void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, + int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, + String description, boolean isWide, int subId); void setSubs(List<SubscriptionInfo> subs); void setNoSims(boolean show); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java index 83a7d3d..dce889f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java @@ -35,10 +35,9 @@ public class SignalCallbackAdapter implements SignalCallback { } @Override - public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, - int darkStatusIcon, int statusType, int qsType, boolean activityIn, - boolean activityOut, String typeContentDescription, String description, - boolean isWide, int subId) { + public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType, + int qsType, boolean activityIn, boolean activityOut, String typeContentDescription, + String description, boolean isWide, int subId) { } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalController.java index e6ca646..5e9447e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalController.java @@ -133,22 +133,10 @@ public abstract class SignalController<T extends SignalController.State, * Gets the signal icon for SB based on current state of connected, enabled, and level. */ public int getCurrentIconId() { - return getCurrentIconId(true /* light */); - } - - protected int getCurrentIconId(boolean light) { if (mCurrentState.connected) { - if (light) { - return getIcons().mSbIcons[mCurrentState.inetCondition][mCurrentState.level]; - } else { - return getIcons().mSbDarkIcons[mCurrentState.inetCondition][mCurrentState.level]; - } + return getIcons().mSbIcons[mCurrentState.inetCondition][mCurrentState.level]; } else if (mCurrentState.enabled) { - if (light) { - return getIcons().mSbDiscState; - } else { - return getIcons().mSbDarkDiscState; - } + return getIcons().mSbDiscState; } else { return getIcons().mSbNullState; } @@ -229,13 +217,11 @@ public abstract class SignalController<T extends SignalController.State, */ static class IconGroup { final int[][] mSbIcons; - final int[][] mSbDarkIcons; final int[][] mQsIcons; final int[] mContentDesc; final int mSbNullState; final int mQsNullState; final int mSbDiscState; - final int mSbDarkDiscState; final int mQsDiscState; final int mDiscContentDesc; // For logging. @@ -244,22 +230,13 @@ public abstract class SignalController<T extends SignalController.State, public IconGroup(String name, int[][] sbIcons, int[][] qsIcons, int[] contentDesc, int sbNullState, int qsNullState, int sbDiscState, int qsDiscState, int discContentDesc) { - this(name, sbIcons, sbIcons, qsIcons, contentDesc, sbNullState, qsNullState, - sbDiscState, sbDiscState, qsDiscState, discContentDesc); - } - - public IconGroup(String name, int[][] sbIcons, int[][] sbDarkIcons, int[][] qsIcons, - int[] contentDesc, int sbNullState, int qsNullState, int sbDiscState, - int sbDarkDiscState, int qsDiscState, int discContentDesc) { mName = name; mSbIcons = sbIcons; - mSbDarkIcons = sbDarkIcons; mQsIcons = qsIcons; mContentDesc = contentDesc; mSbNullState = sbNullState; mQsNullState = qsNullState; mSbDiscState = sbDiscState; - mSbDarkDiscState = sbDarkDiscState; mQsDiscState = qsDiscState; mDiscContentDesc = discContentDesc; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java index fa4d464..8a27653 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java @@ -73,24 +73,15 @@ class TelephonyIcons { { R.drawable.stat_sys_signal_carrier_network_change_animation, R.drawable.stat_sys_signal_carrier_network_change_animation, R.drawable.stat_sys_signal_carrier_network_change_animation, + R.drawable.stat_sys_signal_carrier_network_change_animation, R.drawable.stat_sys_signal_carrier_network_change_animation }, { R.drawable.stat_sys_signal_carrier_network_change_animation, R.drawable.stat_sys_signal_carrier_network_change_animation, R.drawable.stat_sys_signal_carrier_network_change_animation, + R.drawable.stat_sys_signal_carrier_network_change_animation, R.drawable.stat_sys_signal_carrier_network_change_animation } }; - static final int[][] TELEPHONY_CARRIER_NETWORK_CHANGE_DARK = { - { R.drawable.stat_sys_signal_dark_carrier_network_change_animation, - R.drawable.stat_sys_signal_dark_carrier_network_change_animation, - R.drawable.stat_sys_signal_dark_carrier_network_change_animation, - R.drawable.stat_sys_signal_dark_carrier_network_change_animation }, - { R.drawable.stat_sys_signal_dark_carrier_network_change_animation, - R.drawable.stat_sys_signal_dark_carrier_network_change_animation, - R.drawable.stat_sys_signal_dark_carrier_network_change_animation, - R.drawable.stat_sys_signal_dark_carrier_network_change_animation } - }; - static final int[][] QS_TELEPHONY_CARRIER_NETWORK_CHANGE = { { R.drawable.ic_qs_signal_carrier_network_change_animation, R.drawable.ic_qs_signal_carrier_network_change_animation, @@ -216,8 +207,6 @@ class TelephonyIcons { static final int ICON_1X = R.drawable.stat_sys_data_fully_connected_1x; static final int ICON_CARRIER_NETWORK_CHANGE = R.drawable.stat_sys_signal_carrier_network_change_animation; - static final int ICON_CARRIER_NETWORK_CHANGE_DARK = - R.drawable.stat_sys_signal_dark_carrier_network_change_animation; static final int QS_ICON_LTE = R.drawable.ic_qs_signal_lte; static final int QS_ICON_3G = R.drawable.ic_qs_signal_3g; @@ -229,12 +218,10 @@ class TelephonyIcons { static final MobileIconGroup CARRIER_NETWORK_CHANGE = new MobileIconGroup( "CARRIER_NETWORK_CHANGE", TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE, - TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE_DARK, TelephonyIcons.QS_TELEPHONY_CARRIER_NETWORK_CHANGE, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH, 0, 0, TelephonyIcons.ICON_CARRIER_NETWORK_CHANGE, - TelephonyIcons.ICON_CARRIER_NETWORK_CHANGE_DARK, TelephonyIcons.QS_ICON_CARRIER_NETWORK_CHANGE, AccessibilityContentDescriptions.PHONE_SIGNAL_STRENGTH[0], R.string.accessibility_carrier_network_change_mode, diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java index c14d06f..5055bfe 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CallbackHandlerTest.java @@ -94,7 +94,6 @@ public class CallbackHandlerTest extends AndroidTestCase { public void testSignalCallback_setMobileDataIndicators() { IconState status = new IconState(true, 0, ""); IconState qs = new IconState(true, 1, ""); - int dark = 2; boolean in = true; boolean out = true; String typeDescription = "Test 1"; @@ -103,13 +102,12 @@ public class CallbackHandlerTest extends AndroidTestCase { int qsType = R.drawable.ic_qs_signal_1x; boolean wide = true; int subId = 5; - mHandler.setMobileDataIndicators(status, qs, dark, type, qsType, in, out, typeDescription, + mHandler.setMobileDataIndicators(status, qs, type, qsType, in, out, typeDescription, description, wide, subId); waitForCallbacks(); ArgumentCaptor<IconState> statusArg = ArgumentCaptor.forClass(IconState.class); ArgumentCaptor<IconState> qsArg = ArgumentCaptor.forClass(IconState.class); - ArgumentCaptor<Integer> darkStrengthArg = ArgumentCaptor.forClass(Integer.class); ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class); ArgumentCaptor<Integer> qsTypeIconArg = ArgumentCaptor.forClass(Integer.class); ArgumentCaptor<Boolean> inArg = ArgumentCaptor.forClass(Boolean.class); @@ -118,13 +116,12 @@ public class CallbackHandlerTest extends AndroidTestCase { ArgumentCaptor<String> descArg = ArgumentCaptor.forClass(String.class); ArgumentCaptor<Boolean> wideArg = ArgumentCaptor.forClass(Boolean.class); ArgumentCaptor<Integer> subIdArg = ArgumentCaptor.forClass(Integer.class); - Mockito.verify(mSignalCallback).setMobileDataIndicators(statusArg.capture(), qsArg.capture(), - darkStrengthArg.capture(), typeIconArg.capture(), qsTypeIconArg.capture(), - inArg.capture(), outArg.capture(), typeContentArg.capture(), descArg.capture(), - wideArg.capture(), subIdArg.capture()); + Mockito.verify(mSignalCallback).setMobileDataIndicators(statusArg.capture(), + qsArg.capture(), typeIconArg.capture(), qsTypeIconArg.capture(), inArg.capture(), + outArg.capture(), typeContentArg.capture(), descArg.capture(), wideArg.capture(), + subIdArg.capture()); assertEquals(status, statusArg.getValue()); assertEquals(qs, qsArg.getValue()); - assertEquals(dark, (int) darkStrengthArg.getValue()); assertEquals(type, (int) typeIconArg.getValue()); assertEquals(qsType, (int) qsTypeIconArg.getValue()); assertEquals(in, (boolean) inArg.getValue()); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java index 2d6bb68..441bb16 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java @@ -258,7 +258,6 @@ public class NetworkControllerBaseTest extends SysuiTestCase { ArgumentCaptor.forClass(IconState.class).capture(), iconArg.capture(), ArgumentCaptor.forClass(Integer.class).capture(), - ArgumentCaptor.forClass(Integer.class).capture(), typeIconArg.capture(), dataInArg.capture(), dataOutArg.capture(), ArgumentCaptor.forClass(String.class).capture(), ArgumentCaptor.forClass(String.class).capture(), @@ -275,20 +274,14 @@ public class NetworkControllerBaseTest extends SysuiTestCase { } protected void verifyLastMobileDataIndicators(boolean visible, int icon, int typeIcon) { - verifyLastMobileDataIndicators(visible, icon, icon, typeIcon); - } - - protected void verifyLastMobileDataIndicators(boolean visible, int strengthIcon, - int darkStrengthIcon, int typeIcon) { ArgumentCaptor<IconState> iconArg = ArgumentCaptor.forClass(IconState.class); - ArgumentCaptor<Integer> darkStrengthIconArg = ArgumentCaptor.forClass(Integer.class); ArgumentCaptor<Integer> typeIconArg = ArgumentCaptor.forClass(Integer.class); // TODO: Verify all fields. Mockito.verify(mCallbackHandler, Mockito.atLeastOnce()).setMobileDataIndicators( iconArg.capture(), ArgumentCaptor.forClass(IconState.class).capture(), - darkStrengthIconArg.capture(), typeIconArg.capture(), + typeIconArg.capture(), ArgumentCaptor.forClass(Integer.class).capture(), ArgumentCaptor.forClass(Boolean.class).capture(), ArgumentCaptor.forClass(Boolean.class).capture(), @@ -298,9 +291,6 @@ public class NetworkControllerBaseTest extends SysuiTestCase { ArgumentCaptor.forClass(Integer.class).capture()); IconState iconState = iconArg.getValue(); - assertEquals("Signal strength icon in status bar", strengthIcon, iconState.icon); - assertEquals("Signal strength icon (dark mode) in status bar", darkStrengthIcon, - (int) darkStrengthIconArg.getValue()); assertEquals("Data icon in status bar", typeIcon, (int) typeIconArg.getValue()); assertEquals("Visibility in status bar", visible, iconState.visible); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java index 874fdf9..dd6f272 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java @@ -438,7 +438,6 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { // Out of service and carrier network change is true, show special indicator verifyLastMobileDataIndicators(true /* visible */, TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE[0][0] /* strengthIcon */, - TelephonyIcons.TELEPHONY_CARRIER_NETWORK_CHANGE_DARK[0][0] /* darkStrengthIcon */, 0 /* typeIcon */); // Revert back diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 70a5821..bea138e 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -1052,6 +1052,7 @@ public class Allocation extends BaseObj { mSelectedLOD, mSelectedFace.mID, count, 1, data.getID(mRS), dataOff, 0, data.mSelectedLOD, data.mSelectedFace.mID); + Trace.traceEnd(RenderScript.TRACE_TAG); } private void validate2DRange(int xoff, int yoff, int w, int h) { @@ -1213,19 +1214,22 @@ public class Allocation extends BaseObj { * @param data the Bitmap to be copied */ public void copy2DRangeFrom(int xoff, int yoff, Bitmap data) { - Trace.traceBegin(RenderScript.TRACE_TAG, "copy2DRangeFrom"); - mRS.validate(); - if (data.getConfig() == null) { - Bitmap newBitmap = Bitmap.createBitmap(data.getWidth(), data.getHeight(), Bitmap.Config.ARGB_8888); - Canvas c = new Canvas(newBitmap); - c.drawBitmap(data, 0, 0, null); - copy2DRangeFrom(xoff, yoff, newBitmap); - return; + try { + Trace.traceBegin(RenderScript.TRACE_TAG, "copy2DRangeFrom"); + mRS.validate(); + if (data.getConfig() == null) { + Bitmap newBitmap = Bitmap.createBitmap(data.getWidth(), data.getHeight(), Bitmap.Config.ARGB_8888); + Canvas c = new Canvas(newBitmap); + c.drawBitmap(data, 0, 0, null); + copy2DRangeFrom(xoff, yoff, newBitmap); + return; + } + validateBitmapFormat(data); + validate2DRange(xoff, yoff, data.getWidth(), data.getHeight()); + mRS.nAllocationData2D(getIDSafe(), xoff, yoff, mSelectedLOD, mSelectedFace.mID, data); + } finally { + Trace.traceEnd(RenderScript.TRACE_TAG); } - validateBitmapFormat(data); - validate2DRange(xoff, yoff, data.getWidth(), data.getHeight()); - mRS.nAllocationData2D(getIDSafe(), xoff, yoff, mSelectedLOD, mSelectedFace.mID, data); - Trace.traceEnd(RenderScript.TRACE_TAG); } private void validate3DRange(int xoff, int yoff, int zoff, int w, int h, int d) { diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java index ad671c6..742f570 100644 --- a/services/core/java/com/android/server/AlarmManagerService.java +++ b/services/core/java/com/android/server/AlarmManagerService.java @@ -64,6 +64,7 @@ import java.util.LinkedList; import java.util.Locale; import java.util.Random; import java.util.TimeZone; +import java.util.TreeSet; import static android.app.AlarmManager.RTC_WAKEUP; import static android.app.AlarmManager.RTC; @@ -1055,6 +1056,28 @@ class AlarmManagerService extends SystemService { pw.print(" = "); pw.println(sdf.format(new Date(nextWakeupRTC))); pw.print("Num time change events: "); pw.println(mNumTimeChanged); + pw.println(); + pw.println("Next alarm clock information: "); + final TreeSet<Integer> users = new TreeSet<>(); + for (int i = 0; i < mNextAlarmClockForUser.size(); i++) { + users.add(mNextAlarmClockForUser.keyAt(i)); + } + for (int i = 0; i < mPendingSendNextAlarmClockChangedForUser.size(); i++) { + users.add(mPendingSendNextAlarmClockChangedForUser.keyAt(i)); + } + for (int user : users) { + final AlarmManager.AlarmClockInfo next = mNextAlarmClockForUser.get(user); + final long time = next != null ? next.getTriggerTime() : 0; + final boolean pendingSend = mPendingSendNextAlarmClockChangedForUser.get(user); + pw.print(" user:"); pw.print(user); + pw.print(" pendingSend:"); pw.print(pendingSend); + pw.print(" time:"); pw.print(time); + if (time > 0) { + pw.print(" = "); pw.print(sdf.format(new Date(time))); + pw.print(" = "); TimeUtils.formatDuration(time, nowRTC, pw); + } + pw.println(); + } if (mAlarmBatches.size() > 0) { pw.println(); pw.print("Pending alarm batches: "); @@ -1706,8 +1729,8 @@ class AlarmManagerService extends SystemService { */ public static class IncreasingTimeOrder implements Comparator<Alarm> { public int compare(Alarm a1, Alarm a2) { - long when1 = a1.when; - long when2 = a2.when; + long when1 = a1.whenElapsed; + long when2 = a2.whenElapsed; if (when1 - when2 > 0) { return 1; } diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 706e965..81b8457 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -9028,11 +9028,22 @@ public final class ActivityManagerService extends ActivityManagerNative // Our work here is done. return; } + + final int callingUid = Binder.getCallingUid(); + final int lockTaskUid = lockTask.mLockTaskUid; // Ensure the same caller for startLockTaskMode and stopLockTaskMode. + // It is possible lockTaskMode was started by the system process because + // android:lockTaskMode is set to a locking value in the application manifest instead of + // the app calling startLockTaskMode. In this case {@link TaskRecord.mLockTaskUid} will + // be 0, so we compare the callingUid to the {@link TaskRecord.effectiveUid} instead. if (getLockTaskModeState() == ActivityManager.LOCK_TASK_MODE_LOCKED && - Binder.getCallingUid() != lockTask.mLockTaskUid) { - throw new SecurityException("Invalid uid, expected " + lockTask.mLockTaskUid); + callingUid != lockTaskUid + && (lockTaskUid != 0 + || (lockTaskUid == 0 && callingUid != lockTask.effectiveUid))) { + throw new SecurityException("Invalid uid, expected " + lockTaskUid + + " callingUid=" + callingUid + " effectiveUid=" + lockTask.effectiveUid); } + long ident = Binder.clearCallingIdentity(); try { Log.d(TAG, "stopLockTaskMode"); diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 7d383fa..7bd5b78 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -5269,6 +5269,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public void startedGoingToSleep(int why) { if (DEBUG_WAKEUP) Slog.i(TAG, "Started going to sleep... (why=" + why + ")"); + if (mKeyguardDelegate != null) { + mKeyguardDelegate.onStartedGoingToSleep(why); + } } // Called on the PowerManager's Notifier thread. @@ -5286,9 +5289,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { updateOrientationListenerLp(); updateLockScreenTimeout(); } - if (mKeyguardDelegate != null) { - mKeyguardDelegate.onScreenTurnedOff(why); + mKeyguardDelegate.onFinishedGoingToSleep(why); } } @@ -5316,7 +5318,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } if (mKeyguardDelegate != null) { - mKeyguardDelegate.onScreenTurnedOn(mKeyguardDelegateCallback); + mKeyguardDelegate.onStartedWakingUp(mKeyguardDelegateCallback); // ... eventually calls finishKeyguardDrawn } else { if (DEBUG_WAKEUP) Slog.d(TAG, "null mKeyguardDelegate: setting mKeyguardDrawComplete."); diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java index 1a52933..b9f132b 100644 --- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java +++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceDelegate.java @@ -56,10 +56,8 @@ public class KeyguardServiceDelegate { boolean systemIsReady; boolean deviceHasKeyguard; public boolean enabled; - public boolean dismissable; public int offReason; public int currentUser; - public boolean screenIsOn; public boolean bootCompleted; }; @@ -138,7 +136,7 @@ public class KeyguardServiceDelegate { // If the system is ready, it means keyguard crashed and restarted. mKeyguardService.onSystemReady(); // This is used to hide the scrim once keyguard displays. - mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate( + mKeyguardService.onStartedWakingUp(new KeyguardShowDelegate( mShowListenerWhenConnect)); mShowListenerWhenConnect = null; } @@ -218,10 +216,10 @@ public class KeyguardServiceDelegate { mKeyguardState.dreaming = false; } - public void onScreenTurnedOn(final ShowListener showListener) { + public void onStartedWakingUp(final ShowListener showListener) { if (mKeyguardService != null) { if (DEBUG) Log.v(TAG, "onScreenTurnedOn(showListener = " + showListener + ")"); - mKeyguardService.onScreenTurnedOn(new KeyguardShowDelegate(showListener)); + mKeyguardService.onStartedWakingUp(new KeyguardShowDelegate(showListener)); } else { // try again when we establish a connection Slog.w(TAG, "onScreenTurnedOn(): no keyguard service!"); @@ -230,15 +228,19 @@ public class KeyguardServiceDelegate { mShowListenerWhenConnect = showListener; showScrim(); } - mKeyguardState.screenIsOn = true; } - public void onScreenTurnedOff(int why) { + public void onStartedGoingToSleep(int why) { if (mKeyguardService != null) { - mKeyguardService.onScreenTurnedOff(why); + mKeyguardService.onStartedGoingToSleep(why); } mKeyguardState.offReason = why; - mKeyguardState.screenIsOn = false; + } + + public void onFinishedGoingToSleep(int why) { + if (mKeyguardService != null) { + mKeyguardService.onFinishedGoingToSleep(why); + } } public void setKeyguardEnabled(boolean enabled) { diff --git a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java index 2dc685b..51d59fa 100644 --- a/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java +++ b/services/core/java/com/android/server/policy/keyguard/KeyguardServiceWrapper.java @@ -105,19 +105,28 @@ public class KeyguardServiceWrapper implements IKeyguardService { } } - @Override // Binder interface - public void onScreenTurnedOff(int reason) { + @Override + public void onStartedGoingToSleep(int reason) { try { - mService.onScreenTurnedOff(reason); + mService.onStartedGoingToSleep(reason); } catch (RemoteException e) { Slog.w(TAG , "Remote Exception", e); } } - @Override // Binder interface - public void onScreenTurnedOn(IKeyguardShowCallback result) { + @Override + public void onFinishedGoingToSleep(int reason) { + try { + mService.onFinishedGoingToSleep(reason); + } catch (RemoteException e) { + Slog.w(TAG , "Remote Exception", e); + } + } + + @Override + public void onStartedWakingUp(IKeyguardShowCallback callback) { try { - mService.onScreenTurnedOn(result); + mService.onStartedWakingUp(callback); } catch (RemoteException e) { Slog.w(TAG , "Remote Exception", e); } diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 4cf741d..07176b3 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -124,6 +124,16 @@ public class TelecomManager { "android.telecom.action.CHANGE_DEFAULT_DIALER"; /** + * Privileged version of {@link #ACTION_CHANGE_DEFAULT_DIALER} that doesn't require + * confirmation from the user via the dialog. + * + * Requires permission: {@link android.Manifest.permission#MODIFY_PHONE_STATE} + * @hide + */ + public static final String ACTION_CHANGE_DEFAULT_DIALER_PRIVILEGED = + "android.telecom.action.CHANGE_DEFAULT_DIALER_PRIVILEGED"; + + /** * Activity action: Opens the settings screen where a user can enable and disable which * {@link PhoneAccount}s are allows to make and receive calls. Because a user must * explicitly enable an account before the system will use it, an app may want to send the diff --git a/tests/VectorDrawableTest/res/anim/blink.xml b/tests/VectorDrawableTest/res/anim/blink.xml index 2af0b48..714f491 100644 --- a/tests/VectorDrawableTest/res/anim/blink.xml +++ b/tests/VectorDrawableTest/res/anim/blink.xml @@ -22,7 +22,7 @@ <propertyValuesHolder android:propertyName="fillColor" android:valueType="colorType" - android:valueFrom="#ff3838" - android:valueTo="?attr/color1" /> + android:valueFrom="?attr/color1" + android:valueTo="@android:color/white" /> </objectAnimator> |
