From 78a44f21f430568921c68b8f9cb6fcc2f63dab24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Go=CC=88llner?= Date: Tue, 21 Feb 2023 15:51:51 +0100 Subject: [PATCH] Refactor Utilities#isTablet to Utilities#isLargeScreen The utility checks the dimension of the screen rather than the device itself. This means that on a foldable it would return true when unfolded even though it is not a tablet. Test: Checked code usages to see if expectations were correct. Fixes: 267285637 Change-Id: I9ab45d65e08a6024729819724e8661e00419ebdd --- .../utilities/PreviewPositionHelper.java | 6 +++--- .../shared/recents/utilities/Utilities.java | 2 +- .../charging/WirelessChargingLayout.java | 3 ++- .../KeyguardUnlockAnimationController.kt | 6 +++--- .../view/MediaProjectionTaskView.kt | 8 +++---- .../view/TaskPreviewSizeProvider.kt | 6 +++--- .../systemui/navigationbar/NavigationBar.java | 4 ++-- .../NavigationBarController.java | 21 ++++++++++--------- .../recents/ScreenPinningRequest.java | 4 ++-- .../statusbar/KeyboardShortcutsReceiver.java | 2 +- .../statusbar/phone/CentralSurfacesImpl.java | 6 +++--- .../NavigationBarControllerTest.java | 8 +++---- .../KeyboardShortcutsReceiverTest.java | 8 +++---- 13 files changed, 43 insertions(+), 41 deletions(-) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java index b92715516a75a..8690b36c12d7d 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java @@ -62,7 +62,7 @@ public class PreviewPositionHelper { */ public void updateThumbnailMatrix(Rect thumbnailBounds, ThumbnailData thumbnailData, int canvasWidth, int canvasHeight, int screenWidthPx, int screenHeightPx, - int taskbarSize, boolean isTablet, + int taskbarSize, boolean isLargeScreen, int currentRotation, boolean isRtl) { boolean isRotated = false; boolean isOrientationDifferent; @@ -95,7 +95,7 @@ public class PreviewPositionHelper { canvasScreenRatio = (float) canvasWidth / screenWidthPx; } scaledTaskbarSize = taskbarSize * canvasScreenRatio; - thumbnailClipHint.bottom = isTablet ? scaledTaskbarSize : 0; + thumbnailClipHint.bottom = isLargeScreen ? scaledTaskbarSize : 0; float scale = thumbnailData.scale; final float thumbnailScale; @@ -103,7 +103,7 @@ public class PreviewPositionHelper { // Landscape vs portrait change. // Note: Disable rotation in grid layout. boolean windowingModeSupportsRotation = - thumbnailData.windowingMode == WINDOWING_MODE_FULLSCREEN && !isTablet; + thumbnailData.windowingMode == WINDOWING_MODE_FULLSCREEN && !isLargeScreen; isOrientationDifferent = isOrientationChange(deltaRotate) && windowingModeSupportsRotation; if (canvasWidth == 0 || canvasHeight == 0 || scale == 0) { diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java index 77a13bd91b907..751a3f8458bd7 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/Utilities.java @@ -137,7 +137,7 @@ public class Utilities { /** @return whether or not {@param context} represents that of a large screen device or not */ @TargetApi(Build.VERSION_CODES.R) - public static boolean isTablet(Context context) { + public static boolean isLargeScreen(Context context) { final WindowManager windowManager = context.getSystemService(WindowManager.class); final Rect bounds = windowManager.getCurrentWindowMetrics().getBounds(); diff --git a/packages/SystemUI/src/com/android/systemui/charging/WirelessChargingLayout.java b/packages/SystemUI/src/com/android/systemui/charging/WirelessChargingLayout.java index cef415c8a490f..98a3e4b552569 100644 --- a/packages/SystemUI/src/com/android/systemui/charging/WirelessChargingLayout.java +++ b/packages/SystemUI/src/com/android/systemui/charging/WirelessChargingLayout.java @@ -130,7 +130,8 @@ final class WirelessChargingLayout extends FrameLayout { animatorSet.playTogether(textSizeAnimator, textOpacityAnimator, textFadeAnimator); // For tablet docking animation, we don't play the background scrim. - if (!Utilities.isTablet(context)) { + // TODO(b/270524780): use utility to check for tablet instead. + if (!Utilities.isLargeScreen(context)) { ValueAnimator scrimFadeInAnimator = ObjectAnimator.ofArgb(this, "backgroundColor", Color.TRANSPARENT, SCRIM_COLOR); scrimFadeInAnimator.setDuration(SCRIM_FADE_DURATION); diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt index 0ca9115723a31..57c4b36b8b7a6 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt @@ -945,9 +945,9 @@ class KeyguardUnlockAnimationController @Inject constructor( return false } - // We don't do the shared element on tablets because they're large and the smartspace has to - // fly across large distances, which is distracting. - if (Utilities.isTablet(context)) { + // We don't do the shared element on large screens because the smartspace has to fly across + // large distances, which is distracting. + if (Utilities.isLargeScreen(context)) { return false } diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/view/MediaProjectionTaskView.kt b/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/view/MediaProjectionTaskView.kt index d4991f90a86b5..9b9d561b5180b 100644 --- a/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/view/MediaProjectionTaskView.kt +++ b/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/view/MediaProjectionTaskView.kt @@ -33,7 +33,7 @@ import com.android.systemui.R import com.android.systemui.mediaprojection.appselector.data.RecentTask import com.android.systemui.shared.recents.model.ThumbnailData import com.android.systemui.shared.recents.utilities.PreviewPositionHelper -import com.android.systemui.shared.recents.utilities.Utilities.isTablet +import com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen /** * Custom view that shows a thumbnail preview of one recent task based on [ThumbnailData]. @@ -150,9 +150,9 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 val displayWidthPx = windowMetrics.bounds.width() val displayHeightPx = windowMetrics.bounds.height() val isRtl = layoutDirection == LAYOUT_DIRECTION_RTL - val isTablet = isTablet(context) + val isLargeScreen = isLargeScreen(context) val taskbarSize = - if (isTablet) { + if (isLargeScreen) { resources.getDimensionPixelSize(AndroidR.dimen.taskbar_frame_height) } else { 0 @@ -166,7 +166,7 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 displayWidthPx, displayHeightPx, taskbarSize, - isTablet, + isLargeScreen, currentRotation, isRtl ) diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/view/TaskPreviewSizeProvider.kt b/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/view/TaskPreviewSizeProvider.kt index 88d5eaaff2165..1c901540ed392 100644 --- a/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/view/TaskPreviewSizeProvider.kt +++ b/packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/view/TaskPreviewSizeProvider.kt @@ -23,7 +23,7 @@ import android.view.WindowManager import com.android.internal.R as AndroidR import com.android.systemui.mediaprojection.appselector.MediaProjectionAppSelectorScope import com.android.systemui.mediaprojection.appselector.view.TaskPreviewSizeProvider.TaskPreviewSizeListener -import com.android.systemui.shared.recents.utilities.Utilities.isTablet +import com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen import com.android.systemui.statusbar.policy.CallbackController import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener @@ -61,8 +61,8 @@ constructor( val width = windowMetrics.bounds.width() var height = maximumWindowHeight - val isTablet = isTablet(context) - if (isTablet) { + val isLargeScreen = isLargeScreen(context) + if (isLargeScreen) { val taskbarSize = context.resources.getDimensionPixelSize(AndroidR.dimen.taskbar_frame_height) height -= taskbarSize diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java index d5d73258bb086..4db1da3f1c956 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java @@ -41,7 +41,7 @@ import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSE import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.HOME_BUTTON_LONG_PRESS_DURATION_MS; import static com.android.systemui.navigationbar.NavBarHelper.transitionMode; import static com.android.systemui.recents.OverviewProxyService.OverviewProxyListener; -import static com.android.systemui.shared.recents.utilities.Utilities.isTablet; +import static com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_CLICKABLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_A11Y_BUTTON_LONG_CLICKABLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY; @@ -1792,7 +1792,7 @@ public class NavigationBar extends ViewController implements private void setNavigationIconHints(int hints) { if (hints == mNavigationIconHints) return; - if (!isTablet(mContext)) { + if (!isLargeScreen(mContext)) { // All IME functions handled by launcher via Sysui flags for large screen final boolean newBackAlt = (hints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) != 0; final boolean oldBackAlt = diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java index 3c1746532a02b..63d977ed33a79 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarController.java @@ -21,7 +21,7 @@ import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_GESTURE import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR; import static com.android.systemui.navigationbar.gestural.EdgeBackGestureHandler.DEBUG_MISSING_GESTURE_TAG; -import static com.android.systemui.shared.recents.utilities.Utilities.isTablet; +import static com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen; import android.content.Context; import android.content.pm.ActivityInfo; @@ -91,7 +91,7 @@ public class NavigationBarController implements private final DisplayManager mDisplayManager; private final TaskbarDelegate mTaskbarDelegate; private int mNavMode; - @VisibleForTesting boolean mIsTablet; + @VisibleForTesting boolean mIsLargeScreen; /** A displayId - nav bar maps. */ @VisibleForTesting @@ -138,16 +138,16 @@ public class NavigationBarController implements navBarHelper, navigationModeController, sysUiFlagsContainer, dumpManager, autoHideController, lightBarController, pipOptional, backAnimation.orElse(null), taskStackChangeListeners); - mIsTablet = isTablet(mContext); + mIsLargeScreen = isLargeScreen(mContext); dumpManager.registerDumpable(this); } @Override public void onConfigChanged(Configuration newConfig) { - boolean isOldConfigTablet = mIsTablet; - mIsTablet = isTablet(mContext); + boolean isOldConfigLargeScreen = mIsLargeScreen; + mIsLargeScreen = isLargeScreen(mContext); boolean willApplyConfig = mConfigChanges.applyNewConfig(mContext.getResources()); - boolean largeScreenChanged = mIsTablet != isOldConfigTablet; + boolean largeScreenChanged = mIsLargeScreen != isOldConfigLargeScreen; // TODO(b/243765256): Disable this logging once b/243765256 is fixed. Log.i(DEBUG_MISSING_GESTURE_TAG, "NavbarController: newConfig=" + newConfig + " mTaskbarDelegate initialized=" + mTaskbarDelegate.isInitialized() @@ -235,8 +235,9 @@ public class NavigationBarController implements /** @return {@code true} if taskbar is enabled, false otherwise */ private boolean initializeTaskbarIfNecessary() { - // Enable for tablet or (phone AND flag is set); assuming phone = !mIsTablet - boolean taskbarEnabled = mIsTablet || mFeatureFlags.isEnabled(Flags.HIDE_NAVBAR_WINDOW); + // Enable for large screens or (phone AND flag is set); assuming phone = !mIsLargeScreen + boolean taskbarEnabled = mIsLargeScreen || mFeatureFlags.isEnabled( + Flags.HIDE_NAVBAR_WINDOW); if (taskbarEnabled) { Trace.beginSection("NavigationBarController#initializeTaskbarIfNecessary"); @@ -258,7 +259,7 @@ public class NavigationBarController implements @Override public void onDisplayReady(int displayId) { Display display = mDisplayManager.getDisplay(displayId); - mIsTablet = isTablet(mContext); + mIsLargeScreen = isLargeScreen(mContext); createNavigationBar(display, null /* savedState */, null /* result */); } @@ -470,7 +471,7 @@ public class NavigationBarController implements @Override public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { - pw.println("mIsTablet=" + mIsTablet); + pw.println("mIsLargeScreen=" + mIsLargeScreen); pw.println("mNavMode=" + mNavMode); for (int i = 0; i < mNavigationBars.size(); i++) { if (i > 0) { diff --git a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java index 645b1256e5f16..346acf958e51d 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +++ b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java @@ -16,7 +16,7 @@ package com.android.systemui.recents; -import static com.android.systemui.shared.recents.utilities.Utilities.isTablet; +import static com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen; import static com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_NONE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE; @@ -265,7 +265,7 @@ public class ScreenPinningRequest implements View.OnClickListener, .setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); View buttons = mLayout.findViewById(R.id.screen_pinning_buttons); if (!QuickStepContract.isGesturalMode(mNavBarMode) - && hasSoftNavigationBar(mContext.getDisplayId()) && !isTablet(mContext)) { + && hasSoftNavigationBar(mContext.getDisplayId()) && !isLargeScreen(mContext)) { buttons.setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); swapChildrenIfRtlAndVertical(buttons); } else { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutsReceiver.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutsReceiver.java index e9fac28395ea6..1cfb400280fef 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutsReceiver.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutsReceiver.java @@ -39,7 +39,7 @@ public class KeyboardShortcutsReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - if (mIsShortcutListSearchEnabled && Utilities.isTablet(context)) { + if (mIsShortcutListSearchEnabled && Utilities.isLargeScreen(context)) { if (Intent.ACTION_SHOW_KEYBOARD_SHORTCUTS.equals(intent.getAction())) { KeyboardShortcutListSearch.show(context, -1 /* deviceId unknown */); } else if (Intent.ACTION_DISMISS_KEYBOARD_SHORTCUTS.equals(intent.getAction())) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 17fb05547e00e..bfeca020cc87f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -2554,7 +2554,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { String action = intent.getAction(); String reason = intent.getStringExtra(SYSTEM_DIALOG_REASON_KEY); if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) { - if (mIsShortcutListSearchEnabled && Utilities.isTablet(mContext)) { + if (mIsShortcutListSearchEnabled && Utilities.isLargeScreen(mContext)) { KeyboardShortcutListSearch.dismiss(); } else { KeyboardShortcuts.dismiss(); @@ -3905,7 +3905,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } protected void toggleKeyboardShortcuts(int deviceId) { - if (mIsShortcutListSearchEnabled && Utilities.isTablet(mContext)) { + if (mIsShortcutListSearchEnabled && Utilities.isLargeScreen(mContext)) { KeyboardShortcutListSearch.toggle(mContext, deviceId); } else { KeyboardShortcuts.toggle(mContext, deviceId); @@ -3913,7 +3913,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } protected void dismissKeyboardShortcuts() { - if (mIsShortcutListSearchEnabled && Utilities.isTablet(mContext)) { + if (mIsShortcutListSearchEnabled && Utilities.isLargeScreen(mContext)) { KeyboardShortcutListSearch.dismiss(); } else { KeyboardShortcuts.dismiss(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerTest.java index 2212bbda8021a..89405c1092241 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerTest.java @@ -141,8 +141,8 @@ public class NavigationBarControllerTest extends SysuiTestCase { @Test public void testCreateNavigationBarsIncludeDefaultTrue() { - // Tablets may be using taskbar and the logic is different - mNavigationBarController.mIsTablet = false; + // Large screens may be using taskbar and the logic is different + mNavigationBarController.mIsLargeScreen = false; doNothing().when(mNavigationBarController).createNavigationBar(any(), any(), any()); mNavigationBarController.createNavigationBars(true, null); @@ -290,7 +290,7 @@ public class NavigationBarControllerTest extends SysuiTestCase { @Test public void testConfigurationChange_taskbarNotInitialized() { Configuration configuration = mContext.getResources().getConfiguration(); - when(Utilities.isTablet(any())).thenReturn(true); + when(Utilities.isLargeScreen(any())).thenReturn(true); mNavigationBarController.onConfigChanged(configuration); verify(mTaskbarDelegate, never()).onConfigurationChanged(configuration); } @@ -298,7 +298,7 @@ public class NavigationBarControllerTest extends SysuiTestCase { @Test public void testConfigurationChange_taskbarInitialized() { Configuration configuration = mContext.getResources().getConfiguration(); - when(Utilities.isTablet(any())).thenReturn(true); + when(Utilities.isLargeScreen(any())).thenReturn(true); when(mTaskbarDelegate.isInitialized()).thenReturn(true); mNavigationBarController.onConfigChanged(configuration); verify(mTaskbarDelegate, times(1)).onConfigurationChanged(configuration); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsReceiverTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsReceiverTest.java index bea2cfb8bb5c3..bedb2b33d07bc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsReceiverTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyboardShortcutsReceiverTest.java @@ -73,7 +73,7 @@ public class KeyboardShortcutsReceiverTest extends SysuiTestCase { .startMocking(); mFeatureFlags.set(Flags.SHORTCUT_LIST_SEARCH_LAYOUT, false); mKeyboardShortcutsReceiver = spy(new KeyboardShortcutsReceiver(mFeatureFlags)); - when(Utilities.isTablet(mContext)).thenReturn(true); + when(Utilities.isLargeScreen(mContext)).thenReturn(true); mKeyboardShortcutsReceiver.onReceive(mContext, mIntent); @@ -90,7 +90,7 @@ public class KeyboardShortcutsReceiverTest extends SysuiTestCase { .startMocking(); mFeatureFlags.set(Flags.SHORTCUT_LIST_SEARCH_LAYOUT, false); mKeyboardShortcutsReceiver = spy(new KeyboardShortcutsReceiver(mFeatureFlags)); - when(Utilities.isTablet(mContext)).thenReturn(false); + when(Utilities.isLargeScreen(mContext)).thenReturn(false); mKeyboardShortcutsReceiver.onReceive(mContext, mIntent); @@ -107,7 +107,7 @@ public class KeyboardShortcutsReceiverTest extends SysuiTestCase { .startMocking(); mFeatureFlags.set(Flags.SHORTCUT_LIST_SEARCH_LAYOUT, true); mKeyboardShortcutsReceiver = spy(new KeyboardShortcutsReceiver(mFeatureFlags)); - when(Utilities.isTablet(mContext)).thenReturn(true); + when(Utilities.isLargeScreen(mContext)).thenReturn(true); mKeyboardShortcutsReceiver.onReceive(mContext, mIntent); @@ -124,7 +124,7 @@ public class KeyboardShortcutsReceiverTest extends SysuiTestCase { .startMocking(); mFeatureFlags.set(Flags.SHORTCUT_LIST_SEARCH_LAYOUT, true); mKeyboardShortcutsReceiver = spy(new KeyboardShortcutsReceiver(mFeatureFlags)); - when(Utilities.isTablet(mContext)).thenReturn(false); + when(Utilities.isLargeScreen(mContext)).thenReturn(false); mKeyboardShortcutsReceiver.onReceive(mContext, mIntent);