OSDN Git Service

Prevent non-fullscreen activities from influencing orientation
authorBryce Lee <brycelee@google.com>
Wed, 26 Apr 2017 16:29:12 +0000 (09:29 -0700)
committerBryce Lee <brycelee@google.com>
Tue, 9 May 2017 23:13:51 +0000 (16:13 -0700)
commit39791594560b2326625b663ed6796882900c220f
treedb4e06445bea784502fc915834fa7b15c92632c3
parentdea0438385393d9dab1579823b79e413c6e22f3b
Prevent non-fullscreen activities from influencing orientation

This changelist enforces that activities targeting O and beyond
can only specify an orientation if they are fullscreen. The
change ignores the orientation on the server side and throws an
exception when the client has an orientation set in onCreate or
invokes Activity#setRequestedOrientation.

Fixes: 33483680
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testNonFullscreenActivityProhibited
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerAppConfigurationTests#testLegacyNonFullscreenActivityPermitted
Change-Id: I4f7f79744918fad6465a537633dfadec8d05c6df
core/java/android/app/Activity.java
core/java/android/content/pm/ActivityInfo.java
services/core/java/com/android/server/am/ActivityRecord.java
services/core/java/com/android/server/wm/AppWindowToken.java
services/tests/servicestests/src/com/android/server/wm/AppWindowTokenTests.java