Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Issue 273313003: Fix lint issues with Chromoting for Android. (Closed)

Created:
6 years, 7 months ago by Sungmann Cho
Modified:
6 years, 7 months ago
CC:
chromium-reviews, chromoting-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Fix lint issues with Chromoting for Android. Currently, the lint warns at: Error: Field requires API level 18 (current min is 14): android.provider.Settings#EXTRA_ACCOUNT_TYPES [InlinedApi] Error: Field requires API level 16 (current min is 14): android.view.View#SYSTEM_UI_FLAG_FULLSCREEN [InlinedApi] So we need to add @TargetApi to suppress these lint error. BUG=327768 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269995

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -8 lines) Patch
M remoting/android/java/src/org/chromium/chromoting/Chromoting.java View 3 chunks +3 lines, -0 lines 3 comments Download
M remoting/android/java/src/org/chromium/chromoting/Desktop.java View 4 chunks +12 lines, -8 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Sungmann Cho
Please take a look. Thanks!
6 years, 7 months ago (2014-05-11 14:07:27 UTC) #1
garykac
https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/org/chromium/chromoting/Chromoting.java File remoting/android/java/src/org/chromium/chromoting/Chromoting.java (right): https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/org/chromium/chromoting/Chromoting.java#newcode107 remoting/android/java/src/org/chromium/chromoting/Chromoting.java:107: intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, Doesn't this code need a if (Build.VERSION.SDK_INT >= ...
6 years, 7 months ago (2014-05-12 17:37:14 UTC) #2
Lambros
lgtm https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/org/chromium/chromoting/Chromoting.java File remoting/android/java/src/org/chromium/chromoting/Chromoting.java (right): https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/org/chromium/chromoting/Chromoting.java#newcode107 remoting/android/java/src/org/chromium/chromoting/Chromoting.java:107: intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, On 2014/05/12 17:37:14, garykac wrote: > Doesn't ...
6 years, 7 months ago (2014-05-12 20:39:29 UTC) #3
garykac
On 2014/05/12 20:39:29, Lambros wrote: > lgtm > > https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/org/chromium/chromoting/Chromoting.java > File remoting/android/java/src/org/chromium/chromoting/Chromoting.java (right): > ...
6 years, 7 months ago (2014-05-12 20:41:33 UTC) #4
Sungmann Cho
The CQ bit was checked by sungmann.cho@navercorp.com
6 years, 7 months ago (2014-05-12 23:08:21 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sungmann.cho@navercorp.com/273313003/1
6 years, 7 months ago (2014-05-12 23:09:29 UTC) #6
commit-bot: I haz the power
Change committed as 269995
6 years, 7 months ago (2014-05-13 03:36:13 UTC) #7
newt (away)
drive-by after-the-fact review :) https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/org/chromium/chromoting/Chromoting.java File remoting/android/java/src/org/chromium/chromoting/Chromoting.java (right): https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/org/chromium/chromoting/Chromoting.java#newcode107 remoting/android/java/src/org/chromium/chromoting/Chromoting.java:107: intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, On 2014/05/12 20:39:29, Lambros ...
6 years, 7 months ago (2014-05-13 04:04:47 UTC) #8
Sungmann Cho
On 2014/05/13 04:04:47, newt wrote: > drive-by after-the-fact review :) > > https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/org/chromium/chromoting/Chromoting.java > File ...
6 years, 7 months ago (2014-05-13 05:32:58 UTC) #9
Lambros
On 2014/05/13 05:32:58, Sungmann Cho wrote: > On 2014/05/13 04:04:47, newt wrote: > > drive-by ...
6 years, 7 months ago (2014-05-13 16:43:08 UTC) #10
Sungmann Cho
6 years, 7 months ago (2014-05-13 23:18:16 UTC) #11
Message was sent while issue was closed.
On 2014/05/13 16:43:08, Lambros wrote:
> On 2014/05/13 05:32:58, Sungmann Cho wrote:
> > On 2014/05/13 04:04:47, newt wrote:
> > > drive-by after-the-fact review :)
> > > 
> > >
> >
>
https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/or...
> > > File remoting/android/java/src/org/chromium/chromoting/Chromoting.java
> > (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/273313003/diff/1/remoting/android/java/src/or...
> > > remoting/android/java/src/org/chromium/chromoting/Chromoting.java:107:
> > > intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES,
> > > On 2014/05/12 20:39:29, Lambros wrote:
> > > > On 2014/05/12 17:37:14, garykac wrote:
> > > > > Doesn't this code need a 
> > > > >    if (Build.VERSION.SDK_INT >= ...
> > > > > check around the EXTRA_ACCOUNT_TYPES as well?
> > > > > 
> > > > > 
> > > > I'm not sure. It works fine on an older device with Android 4.0.3, and
> > there's
> > > > no sign of any crash in the log.
> > > > 
> > > > I guess this is because EXTRA_ACCOUNT_TYPES is a compile-time integer
> > > constant,
> > > > and so the generated bytecode doesn't need to do a runtime field lookup,
> > which
> > > > would throw an exception on older versions. All that happens is that the
> > > Intent
> > > > ends up with extra information that the older Android OS doesn't know
> about
> > so
> > > > it is simply ignored.
> > > 
> > > Correct. Constants on Android are typically static final, so their values
> are
> > > inlined at compile time. This means this code won't crash at runtime on
old
> > > versions of Android, but could -- in theory -- fail in mysterious ways.
> > > 
> > > To suppress the warning, you can either use the @TargetApi annotation if
the
> > > code is only run on higher versions of Android, or if the warning doesn't
> > > actually indicate a problem (which often seems to be the case with
> > InlinedApi),
> > > you can use @SuppressLint("InlinedApi"). I think the latter would actually
> be
> > > appropriate here... unless this code path never runs on Android devices
> > running
> > > JB MR1 and below.
> > > 
> > > 
> > > > 
> > > > If the check is needed, it is only for style reasons. I'm happy to defer
> > > > judgement on this.
> > 
> > Thanks for the nice comments! I learn something new everyday through
reviews.
> :)
> > As you mentioned, @SuppressLint("InlinedApi") would be more appropriate
here.
> > And I think we could apply this to Desktop.java in the same vein. What do
you
> > think?
> 
> Yes, please send a patch to newt@ for review (and myself for OWNERS approval).
> He understands these annotations much better than I do - I need to do some
> reading! I don't know which is the right way to annotate Desktop.java,
hopefully
> newt@ will be able to tell us.

I got it. Thanks! :)

Powered by Google App Engine
This is Rietveld 408576698