File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed
policy/src/com/android/internal/policy/impl/keyguard Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ public class KeyguardWidgetRegion extends LinearLayout implements PagedView.Page
2929 private int mPage = 0 ;
3030 private Callbacks mCallbacks ;
3131
32+ // We are disabling touch interaction of the widget region for factory ROM.
33+ private static final boolean DISABLE_TOUCH_INTERACTION = true ;
34+
3235 private static final long CUSTOM_WIDGET_USER_ACTIVITY_TIMEOUT = 30000 ;
3336
3437 public KeyguardWidgetRegion (Context context ) {
@@ -52,19 +55,21 @@ protected void onFinishInflate() {
5255 mPager .setPageSwitchListener (this );
5356
5457 setSoundEffectsEnabled (false );
55- setOnClickListener (new OnClickListener () {
56- @ Override
57- public void onClick (View v ) {
58- showPagingFeedback ();
59- }
60- });
58+ if (!DISABLE_TOUCH_INTERACTION ) {
59+ setOnClickListener (new OnClickListener () {
60+ @ Override
61+ public void onClick (View v ) {
62+ showPagingFeedback ();
63+ }
64+ });
65+ }
6166 }
6267
6368 public void showPagingFeedback () {
64- if (true || (mPage < mPager .getPageCount () - 1 )) {
69+ if ((mPage < mPager .getPageCount () - 1 )) {
6570 mLeftStrip .makeEmGo ();
6671 }
67- if (true || (mPage > 0 )) {
72+ if ((mPage > 0 )) {
6873 mRightStrip .makeEmGo ();
6974 }
7075 }
Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ public class PagedView extends ViewGroup implements ViewGroup.OnHierarchyChangeL
7777 private static final int MIN_SNAP_VELOCITY = 1500 ;
7878 private static final int MIN_FLING_VELOCITY = 250 ;
7979
80+ // We are disabling touch interaction of the widget region for factory ROM.
81+ private static final boolean DISABLE_TOUCH_INTERACTION = true ;
82+
8083 static final int AUTOMATIC_PAGE_SPACING = -1 ;
8184
8285 protected int mFlingThresholdVelocity ;
@@ -862,6 +865,10 @@ protected boolean hitsNextPage(float x, float y) {
862865
863866 @ Override
864867 public boolean onInterceptTouchEvent (MotionEvent ev ) {
868+ if (DISABLE_TOUCH_INTERACTION ) {
869+ return false ;
870+ }
871+
865872 /*
866873 * This method JUST determines whether we want to intercept the motion.
867874 * If we return true, onTouchEvent will be called and we do the actual
@@ -1100,6 +1107,10 @@ protected float maxOverScroll() {
11001107
11011108 @ Override
11021109 public boolean onTouchEvent (MotionEvent ev ) {
1110+ if (DISABLE_TOUCH_INTERACTION ) {
1111+ return false ;
1112+ }
1113+
11031114 // Skip touch handling if there are no pages to swipe
11041115 if (getChildCount () <= 0 ) return super .onTouchEvent (ev );
11051116
You can’t perform that action at this time.
0 commit comments