New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 805479 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Feb 2018
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Fix NewApi issue in TabularContextMenuViewPager.java

Project Member Reported by wnwen@chromium.org, Jan 24 2018

Issue description

../SRC_ROOT1/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuViewPager.java:134 Call requires API level 18 (current min is 16): android.view.View#setClipBounds: NewApi [warning]                                                                                                                                               
                setClipBounds(mClipBounds);
                ~~~~~~~~~~~~~                              
../SRC_ROOT1/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuViewPager.java:144 Call requires API level 18 (current min is 16): android.view.View#setClipBounds: NewApi [warning]                                                                                                
                setClipBounds(null);
                ~~~~~~~~~~~~~                                                                                            
                   

This will likely crash users on API 16/17. Please either add TargetApi tag, provide references that this will not crash, or fix it by using something supported by API 16 and below.

Thanks!
 
Status: Started (was: Assigned)

Comment 2 by wnwen@chromium.org, Jan 25 2018

Please remove the suppression in build/android/lint/suppressions.xml afterwards, thank you!

The one under "TODO( crbug.com/805479 )".
Project Member

Comment 3 by bugdroid1@chromium.org, Feb 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a3ac1cbbc3f66cfb45b0edb447ead24e298af60

commit 6a3ac1cbbc3f66cfb45b0edb447ead24e298af60
Author: Daniel Park <danielpark@chromium.org>
Date: Thu Feb 01 18:35:58 2018

[Custom Context Menu] Fixes newApiWarning for setClipBounds

Reverts to method before setClipBounds was used.
Removes canvas.save and restore as they weren't doing anything

Removes check for clip bounds = 0 since it was never 0

Adds scrollX() to rectangle clip bounds for canvas

Bug:  805479 
Change-Id: I3d32f8dd9526ca7d5504d702283f8fcd2364d678
Reviewed-on: https://chromium-review.googlesource.com/896635
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Daniel Park <danielpark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533746}
[modify] https://crrev.com/6a3ac1cbbc3f66cfb45b0edb447ead24e298af60/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/TabularContextMenuViewPager.java

Status: Fixed (was: Started)

Comment 5 by wnwen@chromium.org, Feb 1 2018

Thanks for fixing the code!

Please let me know if you need help finishing the suppression removal mentioned in c#2.
Project Member

Comment 6 by bugdroid1@chromium.org, Feb 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/94f07a46b5ec3f38a29ec095a06b8ea967ce9173

commit 94f07a46b5ec3f38a29ec095a06b8ea967ce9173
Author: Daniel Park <danielpark@chromium.org>
Date: Thu Feb 01 21:40:43 2018

Removed lint suppression

Bug:  805479 
Change-Id: Icf3110416b4f619f6854e46a685b39b4664cbef9
Reviewed-on: https://chromium-review.googlesource.com/897995
Reviewed-by: Peter Wen <wnwen@chromium.org>
Commit-Queue: Daniel Park <danielpark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533822}
[modify] https://crrev.com/94f07a46b5ec3f38a29ec095a06b8ea967ce9173/build/android/lint/suppressions.xml

Sign in to add a comment