OSDN Git Service

Only read foreground attr for FrameLayouts for targetSdkVersion < M
authorAdam Powell <adamp@google.com>
Fri, 12 Jun 2015 21:54:49 +0000 (14:54 -0700)
committerAdam Powell <adamp@google.com>
Fri, 12 Jun 2015 21:54:49 +0000 (14:54 -0700)
commitbbd3eeb9e53707bcbf0cc540acd7bb566252a969
tree31c7bb1cc1d70a73ddfb6f23c998f9e0dd5829f7
parent54b65ff3004a1585867e8c3c4d267b381123e179
Only read foreground attr for FrameLayouts for targetSdkVersion < M

Now that the android:foreground attribute is supported for all views
it turns out some existing apps were previously setting foreground or
applying styles with a foreground to unsupporting views even though
the values being set were not drawables. While this was silently
ignored before, now it results in app crashes.

The most expedient fix is to only support foreground on
non-FrameLayout views if the app sets targetSdkVersion to M or newer.

Bug 21646309

Change-Id: I8937f44988866e86e640555f4bbc5dd5b2e1cce1
core/java/android/view/View.java