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 ;
@@ -861,6 +864,10 @@ protected boolean hitsNextPage(float x, float y) {
861864
862865 @ Override
863866 public boolean onInterceptTouchEvent (MotionEvent ev ) {
867+ if (DISABLE_TOUCH_INTERACTION ) {
868+ return false ;
869+ }
870+
864871 /*
865872 * This method JUST determines whether we want to intercept the motion.
866873 * If we return true, onTouchEvent will be called and we do the actual
@@ -1099,6 +1106,10 @@ protected float maxOverScroll() {
10991106
11001107 @ Override
11011108 public boolean onTouchEvent (MotionEvent ev ) {
1109+ if (DISABLE_TOUCH_INTERACTION ) {
1110+ return false ;
1111+ }
1112+
11021113 // Skip touch handling if there are no pages to swipe
11031114 if (getChildCount () <= 0 ) return super .onTouchEvent (ev );
11041115
You can’t perform that action at this time.
0 commit comments