Loading apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java +2 −1 Original line number Diff line number Diff line Loading @@ -693,6 +693,7 @@ public class DeviceIdleController extends SystemService synchronized (DeviceIdleController.this) { if (mStationaryListeners.size() > 0) { startMonitoringMotionLocked(); scheduleMotionTimeoutAlarmLocked(); } } }; Loading Loading @@ -3859,7 +3860,7 @@ public class DeviceIdleController extends SystemService void handleMotionDetectedLocked(long timeout, String type) { if (mStationaryListeners.size() > 0) { postStationaryStatusUpdated(); scheduleMotionTimeoutAlarmLocked(); cancelMotionTimeoutAlarmLocked(); // We need to re-register the motion listener, but we don't want the sensors to be // constantly active or to churn the CPU by registering too early, register after some // delay. Loading core/java/com/android/internal/jank/InteractionJankMonitor.java +4 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,7 @@ public class InteractionJankMonitor { public static final int CUJ_SETTINGS_SLIDER = 53; public static final int CUJ_TAKE_SCREENSHOT = 54; public static final int CUJ_VOLUME_CONTROL = 55; public static final int CUJ_BIOMETRIC_PROMPT_TRANSITION = 56; public static final int CUJ_SETTINGS_TOGGLE = 57; private static final int NO_STATSD_LOGGING = -1; Loading Loading @@ -343,6 +344,7 @@ public class InteractionJankMonitor { CUJ_SETTINGS_SLIDER, CUJ_TAKE_SCREENSHOT, CUJ_VOLUME_CONTROL, CUJ_BIOMETRIC_PROMPT_TRANSITION, CUJ_SETTINGS_TOGGLE, }) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -774,6 +776,8 @@ public class InteractionJankMonitor { return "TAKE_SCREENSHOT"; case CUJ_VOLUME_CONTROL: return "VOLUME_CONTROL"; case CUJ_BIOMETRIC_PROMPT_TRANSITION: return "BIOMETRIC_PROMPT_TRANSITION"; case CUJ_SETTINGS_TOGGLE: return "SETTINGS_TOGGLE"; } Loading packages/SettingsLib/FooterPreference/src/com/android/settingslib/widget/FooterPreference.java +11 −37 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ public class FooterPreference extends Preference { int mIconVisibility = View.VISIBLE; private CharSequence mContentDescription; private CharSequence mLearnMoreText; private CharSequence mLearnMoreContentDescription; private FooterLearnMoreSpan mLearnMoreSpan; public FooterPreference(Context context, AttributeSet attrs) { Loading Loading @@ -80,9 +79,6 @@ public class FooterPreference extends Preference { learnMoreText.setSpan(mLearnMoreSpan, 0, learnMoreText.length(), 0); learnMore.setText(learnMoreText); if (!TextUtils.isEmpty(mLearnMoreContentDescription)) { learnMore.setContentDescription(mLearnMoreContentDescription); } } else { learnMore.setVisibility(View.GONE); } Loading Loading @@ -139,27 +135,6 @@ public class FooterPreference extends Preference { } } /** * To set content description of the learn more text. This can use for talkback * environment if developer wants to have a customization content. * * @param learnMoreContentDescription The resource id of the content description. */ public void setLearnMoreContentDescription(CharSequence learnMoreContentDescription) { if (!TextUtils.equals(mContentDescription, learnMoreContentDescription)) { mLearnMoreContentDescription = learnMoreContentDescription; notifyChanged(); } } /** * Return the content description of learn more link. */ @VisibleForTesting CharSequence getLearnMoreContentDescription() { return mLearnMoreContentDescription; } /** * Assign an action for the learn more link. */ Loading Loading @@ -201,7 +176,7 @@ public class FooterPreference extends Preference { private String mKey; private CharSequence mTitle; private CharSequence mContentDescription; private CharSequence mLearnMoreContentDescription; private CharSequence mLearnMoreText; public Builder(@NonNull Context context) { mContext = context; Loading Loading @@ -260,25 +235,24 @@ public class FooterPreference extends Preference { } /** * To set content description of the learn more text. This can use for talkback * To set learn more string of the learn more text. This can use for talkback * environment if developer wants to have a customization content. * * @param learnMoreContentDescription The resource id of the content description. * @param learnMoreText The resource id of the learn more string. */ public Builder setLearnMoreContentDescription(CharSequence learnMoreContentDescription) { mLearnMoreContentDescription = learnMoreContentDescription; public Builder setLearnMoreText(CharSequence learnMoreText) { mLearnMoreText = learnMoreText; return this; } /** * To set content description of the {@link FooterPreference}. This can use for talkback * To set learn more string of the {@link FooterPreference}. This can use for talkback * environment if developer wants to have a customization content. * * @param learnMoreContentDescriptionResId The resource id of the content description. * @param learnMoreTextResId The resource id of the learn more string. */ public Builder setLearnMoreContentDescription( @StringRes int learnMoreContentDescriptionResId) { mLearnMoreContentDescription = mContext.getText(learnMoreContentDescriptionResId); public Builder setLearnMoreText(@StringRes int learnMoreTextResId) { mLearnMoreText = mContext.getText(learnMoreTextResId); return this; } Loading @@ -301,8 +275,8 @@ public class FooterPreference extends Preference { footerPreference.setContentDescription(mContentDescription); } if (!TextUtils.isEmpty(mLearnMoreContentDescription)) { footerPreference.setLearnMoreContentDescription(mLearnMoreContentDescription); if (!TextUtils.isEmpty(mLearnMoreText)) { footerPreference.setLearnMoreText(mLearnMoreText); } return footerPreference; } Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/FooterPreferenceTest.java +0 −7 Original line number Diff line number Diff line Loading @@ -73,13 +73,6 @@ public class FooterPreferenceTest { assertThat(mFooterPreference.getContentDescription()).isEqualTo("test"); } @Test public void setLearnMoreContentDescription_contentSet_shouldGetSameContentDescription() { mFooterPreference.setLearnMoreContentDescription("test"); assertThat(mFooterPreference.getLearnMoreContentDescription()).isEqualTo("test"); } @Test public void setLearnMoreAction_actionSet_shouldGetAction() { mFooterPreference.setLearnMoreAction(v -> { Loading packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +21 −16 Original line number Diff line number Diff line Loading @@ -159,6 +159,8 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @VisibleForTesting protected DisplayDecorationSupport mHwcScreenDecorationSupport; private Display.Mode mDisplayMode; @VisibleForTesting protected DisplayInfo mDisplayInfo = new DisplayInfo(); private CameraAvailabilityListener.CameraTransitionCallback mCameraTransitionCallback = new CameraAvailabilityListener.CameraTransitionCallback() { Loading Loading @@ -325,9 +327,10 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab private void startOnScreenDecorationsThread() { mWindowManager = mContext.getSystemService(WindowManager.class); mDisplayManager = mContext.getSystemService(DisplayManager.class); mRotation = mContext.getDisplay().getRotation(); mDisplayMode = mContext.getDisplay().getMode(); mDisplayUniqueId = mContext.getDisplay().getUniqueId(); mContext.getDisplay().getDisplayInfo(mDisplayInfo); mRotation = mDisplayInfo.rotation; mDisplayMode = mDisplayInfo.getMode(); mDisplayUniqueId = mDisplayInfo.uniqueId; mRoundedCornerResDelegate = new RoundedCornerResDelegate(mContext.getResources(), mDisplayUniqueId); mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio( Loading @@ -351,8 +354,9 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @Override public void onDisplayChanged(int displayId) { final int newRotation = mContext.getDisplay().getRotation(); final Display.Mode newDisplayMode = mContext.getDisplay().getMode(); mContext.getDisplay().getDisplayInfo(mDisplayInfo); final int newRotation = mDisplayInfo.rotation; final Display.Mode newDisplayMode = mDisplayInfo.getMode(); if ((mOverlays != null || mScreenDecorHwcWindow != null) && (mRotation != newRotation || displayModeChanged(mDisplayMode, newDisplayMode))) { Loading Loading @@ -398,7 +402,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab } } final String newUniqueId = mContext.getDisplay().getUniqueId(); final String newUniqueId = mDisplayInfo.uniqueId; if (!Objects.equals(newUniqueId, mDisplayUniqueId)) { mDisplayUniqueId = newUniqueId; final DisplayDecorationSupport newScreenDecorationSupport = Loading Loading @@ -923,11 +927,10 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @VisibleForTesting float getPhysicalPixelDisplaySizeRatio() { final Point stableDisplaySize = mDisplayManager.getStableDisplaySize(); final DisplayInfo displayInfo = new DisplayInfo(); mContext.getDisplay().getDisplayInfo(displayInfo); mContext.getDisplay().getDisplayInfo(mDisplayInfo); return DisplayUtils.getPhysicalPixelDisplaySizeRatio( stableDisplaySize.x, stableDisplaySize.y, displayInfo.getNaturalWidth(), displayInfo.getNaturalHeight()); stableDisplaySize.x, stableDisplaySize.y, mDisplayInfo.getNaturalWidth(), mDisplayInfo.getNaturalHeight()); } @Override Loading Loading @@ -1004,11 +1007,12 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab "must call on " + mHandler.getLooper().getThread() + ", but was " + Thread.currentThread()); int newRotation = mContext.getDisplay().getRotation(); mContext.getDisplay().getDisplayInfo(mDisplayInfo); final int newRotation = mDisplayInfo.rotation; if (mRotation != newRotation) { mDotViewController.setNewRotation(newRotation); } final Display.Mode newMod = mContext.getDisplay().getMode(); final Display.Mode newMod = mDisplayInfo.getMode(); if (!mPendingConfigChange && (newRotation != mRotation || displayModeChanged(mDisplayMode, newMod))) { Loading Loading @@ -1220,7 +1224,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @Override public void updateRotation(int rotation) { mRotation = rotation; updateCutout(); super.updateRotation(rotation); } @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) Loading Loading @@ -1431,9 +1435,10 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @Override public boolean onPreDraw() { final int displayRotation = mContext.getDisplay().getRotation(); final Display.Mode displayMode = mContext.getDisplay().getMode(); if (displayRotation != mRotation && displayModeChanged(mDisplayMode, displayMode) mContext.getDisplay().getDisplayInfo(mDisplayInfo); final int displayRotation = mDisplayInfo.rotation; final Display.Mode displayMode = mDisplayInfo.getMode(); if ((displayRotation != mRotation || displayModeChanged(mDisplayMode, displayMode)) && !mPendingConfigChange) { if (DEBUG) { if (displayRotation != mRotation) { Loading Loading
apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java +2 −1 Original line number Diff line number Diff line Loading @@ -693,6 +693,7 @@ public class DeviceIdleController extends SystemService synchronized (DeviceIdleController.this) { if (mStationaryListeners.size() > 0) { startMonitoringMotionLocked(); scheduleMotionTimeoutAlarmLocked(); } } }; Loading Loading @@ -3859,7 +3860,7 @@ public class DeviceIdleController extends SystemService void handleMotionDetectedLocked(long timeout, String type) { if (mStationaryListeners.size() > 0) { postStationaryStatusUpdated(); scheduleMotionTimeoutAlarmLocked(); cancelMotionTimeoutAlarmLocked(); // We need to re-register the motion listener, but we don't want the sensors to be // constantly active or to churn the CPU by registering too early, register after some // delay. Loading
core/java/com/android/internal/jank/InteractionJankMonitor.java +4 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,7 @@ public class InteractionJankMonitor { public static final int CUJ_SETTINGS_SLIDER = 53; public static final int CUJ_TAKE_SCREENSHOT = 54; public static final int CUJ_VOLUME_CONTROL = 55; public static final int CUJ_BIOMETRIC_PROMPT_TRANSITION = 56; public static final int CUJ_SETTINGS_TOGGLE = 57; private static final int NO_STATSD_LOGGING = -1; Loading Loading @@ -343,6 +344,7 @@ public class InteractionJankMonitor { CUJ_SETTINGS_SLIDER, CUJ_TAKE_SCREENSHOT, CUJ_VOLUME_CONTROL, CUJ_BIOMETRIC_PROMPT_TRANSITION, CUJ_SETTINGS_TOGGLE, }) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -774,6 +776,8 @@ public class InteractionJankMonitor { return "TAKE_SCREENSHOT"; case CUJ_VOLUME_CONTROL: return "VOLUME_CONTROL"; case CUJ_BIOMETRIC_PROMPT_TRANSITION: return "BIOMETRIC_PROMPT_TRANSITION"; case CUJ_SETTINGS_TOGGLE: return "SETTINGS_TOGGLE"; } Loading
packages/SettingsLib/FooterPreference/src/com/android/settingslib/widget/FooterPreference.java +11 −37 Original line number Diff line number Diff line Loading @@ -44,7 +44,6 @@ public class FooterPreference extends Preference { int mIconVisibility = View.VISIBLE; private CharSequence mContentDescription; private CharSequence mLearnMoreText; private CharSequence mLearnMoreContentDescription; private FooterLearnMoreSpan mLearnMoreSpan; public FooterPreference(Context context, AttributeSet attrs) { Loading Loading @@ -80,9 +79,6 @@ public class FooterPreference extends Preference { learnMoreText.setSpan(mLearnMoreSpan, 0, learnMoreText.length(), 0); learnMore.setText(learnMoreText); if (!TextUtils.isEmpty(mLearnMoreContentDescription)) { learnMore.setContentDescription(mLearnMoreContentDescription); } } else { learnMore.setVisibility(View.GONE); } Loading Loading @@ -139,27 +135,6 @@ public class FooterPreference extends Preference { } } /** * To set content description of the learn more text. This can use for talkback * environment if developer wants to have a customization content. * * @param learnMoreContentDescription The resource id of the content description. */ public void setLearnMoreContentDescription(CharSequence learnMoreContentDescription) { if (!TextUtils.equals(mContentDescription, learnMoreContentDescription)) { mLearnMoreContentDescription = learnMoreContentDescription; notifyChanged(); } } /** * Return the content description of learn more link. */ @VisibleForTesting CharSequence getLearnMoreContentDescription() { return mLearnMoreContentDescription; } /** * Assign an action for the learn more link. */ Loading Loading @@ -201,7 +176,7 @@ public class FooterPreference extends Preference { private String mKey; private CharSequence mTitle; private CharSequence mContentDescription; private CharSequence mLearnMoreContentDescription; private CharSequence mLearnMoreText; public Builder(@NonNull Context context) { mContext = context; Loading Loading @@ -260,25 +235,24 @@ public class FooterPreference extends Preference { } /** * To set content description of the learn more text. This can use for talkback * To set learn more string of the learn more text. This can use for talkback * environment if developer wants to have a customization content. * * @param learnMoreContentDescription The resource id of the content description. * @param learnMoreText The resource id of the learn more string. */ public Builder setLearnMoreContentDescription(CharSequence learnMoreContentDescription) { mLearnMoreContentDescription = learnMoreContentDescription; public Builder setLearnMoreText(CharSequence learnMoreText) { mLearnMoreText = learnMoreText; return this; } /** * To set content description of the {@link FooterPreference}. This can use for talkback * To set learn more string of the {@link FooterPreference}. This can use for talkback * environment if developer wants to have a customization content. * * @param learnMoreContentDescriptionResId The resource id of the content description. * @param learnMoreTextResId The resource id of the learn more string. */ public Builder setLearnMoreContentDescription( @StringRes int learnMoreContentDescriptionResId) { mLearnMoreContentDescription = mContext.getText(learnMoreContentDescriptionResId); public Builder setLearnMoreText(@StringRes int learnMoreTextResId) { mLearnMoreText = mContext.getText(learnMoreTextResId); return this; } Loading @@ -301,8 +275,8 @@ public class FooterPreference extends Preference { footerPreference.setContentDescription(mContentDescription); } if (!TextUtils.isEmpty(mLearnMoreContentDescription)) { footerPreference.setLearnMoreContentDescription(mLearnMoreContentDescription); if (!TextUtils.isEmpty(mLearnMoreText)) { footerPreference.setLearnMoreText(mLearnMoreText); } return footerPreference; } Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/FooterPreferenceTest.java +0 −7 Original line number Diff line number Diff line Loading @@ -73,13 +73,6 @@ public class FooterPreferenceTest { assertThat(mFooterPreference.getContentDescription()).isEqualTo("test"); } @Test public void setLearnMoreContentDescription_contentSet_shouldGetSameContentDescription() { mFooterPreference.setLearnMoreContentDescription("test"); assertThat(mFooterPreference.getLearnMoreContentDescription()).isEqualTo("test"); } @Test public void setLearnMoreAction_actionSet_shouldGetAction() { mFooterPreference.setLearnMoreAction(v -> { Loading
packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +21 −16 Original line number Diff line number Diff line Loading @@ -159,6 +159,8 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @VisibleForTesting protected DisplayDecorationSupport mHwcScreenDecorationSupport; private Display.Mode mDisplayMode; @VisibleForTesting protected DisplayInfo mDisplayInfo = new DisplayInfo(); private CameraAvailabilityListener.CameraTransitionCallback mCameraTransitionCallback = new CameraAvailabilityListener.CameraTransitionCallback() { Loading Loading @@ -325,9 +327,10 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab private void startOnScreenDecorationsThread() { mWindowManager = mContext.getSystemService(WindowManager.class); mDisplayManager = mContext.getSystemService(DisplayManager.class); mRotation = mContext.getDisplay().getRotation(); mDisplayMode = mContext.getDisplay().getMode(); mDisplayUniqueId = mContext.getDisplay().getUniqueId(); mContext.getDisplay().getDisplayInfo(mDisplayInfo); mRotation = mDisplayInfo.rotation; mDisplayMode = mDisplayInfo.getMode(); mDisplayUniqueId = mDisplayInfo.uniqueId; mRoundedCornerResDelegate = new RoundedCornerResDelegate(mContext.getResources(), mDisplayUniqueId); mRoundedCornerResDelegate.setPhysicalPixelDisplaySizeRatio( Loading @@ -351,8 +354,9 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @Override public void onDisplayChanged(int displayId) { final int newRotation = mContext.getDisplay().getRotation(); final Display.Mode newDisplayMode = mContext.getDisplay().getMode(); mContext.getDisplay().getDisplayInfo(mDisplayInfo); final int newRotation = mDisplayInfo.rotation; final Display.Mode newDisplayMode = mDisplayInfo.getMode(); if ((mOverlays != null || mScreenDecorHwcWindow != null) && (mRotation != newRotation || displayModeChanged(mDisplayMode, newDisplayMode))) { Loading Loading @@ -398,7 +402,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab } } final String newUniqueId = mContext.getDisplay().getUniqueId(); final String newUniqueId = mDisplayInfo.uniqueId; if (!Objects.equals(newUniqueId, mDisplayUniqueId)) { mDisplayUniqueId = newUniqueId; final DisplayDecorationSupport newScreenDecorationSupport = Loading Loading @@ -923,11 +927,10 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @VisibleForTesting float getPhysicalPixelDisplaySizeRatio() { final Point stableDisplaySize = mDisplayManager.getStableDisplaySize(); final DisplayInfo displayInfo = new DisplayInfo(); mContext.getDisplay().getDisplayInfo(displayInfo); mContext.getDisplay().getDisplayInfo(mDisplayInfo); return DisplayUtils.getPhysicalPixelDisplaySizeRatio( stableDisplaySize.x, stableDisplaySize.y, displayInfo.getNaturalWidth(), displayInfo.getNaturalHeight()); stableDisplaySize.x, stableDisplaySize.y, mDisplayInfo.getNaturalWidth(), mDisplayInfo.getNaturalHeight()); } @Override Loading Loading @@ -1004,11 +1007,12 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab "must call on " + mHandler.getLooper().getThread() + ", but was " + Thread.currentThread()); int newRotation = mContext.getDisplay().getRotation(); mContext.getDisplay().getDisplayInfo(mDisplayInfo); final int newRotation = mDisplayInfo.rotation; if (mRotation != newRotation) { mDotViewController.setNewRotation(newRotation); } final Display.Mode newMod = mContext.getDisplay().getMode(); final Display.Mode newMod = mDisplayInfo.getMode(); if (!mPendingConfigChange && (newRotation != mRotation || displayModeChanged(mDisplayMode, newMod))) { Loading Loading @@ -1220,7 +1224,7 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @Override public void updateRotation(int rotation) { mRotation = rotation; updateCutout(); super.updateRotation(rotation); } @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) Loading Loading @@ -1431,9 +1435,10 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab @Override public boolean onPreDraw() { final int displayRotation = mContext.getDisplay().getRotation(); final Display.Mode displayMode = mContext.getDisplay().getMode(); if (displayRotation != mRotation && displayModeChanged(mDisplayMode, displayMode) mContext.getDisplay().getDisplayInfo(mDisplayInfo); final int displayRotation = mDisplayInfo.rotation; final Display.Mode displayMode = mDisplayInfo.getMode(); if ((displayRotation != mRotation || displayModeChanged(mDisplayMode, displayMode)) && !mPendingConfigChange) { if (DEBUG) { if (displayRotation != mRotation) { Loading