OSDN Git Service

Fix issues with launching activities on virtual displays
authorAndrii Kulian <akulian@google.com>
Fri, 27 Jan 2017 03:43:13 +0000 (19:43 -0800)
committerAndrii Kulian <akulian@google.com>
Fri, 27 Jan 2017 03:43:13 +0000 (19:43 -0800)
- Virtual displays might have hdr capabilities not initialized,
  which lead to exception when checking.
- Dynamic stacks were mistakenly considered an invalid launch stack.

Test: android.server.cts.ActivityManagerDisplayTests
Change-Id: I20356d6e25cf9e5fa4a3d7bd3699a8e82a73f21a

core/java/android/view/DisplayInfo.java
services/core/java/com/android/server/am/ActivityStarter.java

index 82388f8..f6b94af 100644 (file)
@@ -520,7 +520,7 @@ public final class DisplayInfo implements Parcelable {
     }
 
     public boolean isHdr() {
-        int[] types = hdrCapabilities.getSupportedHdrTypes();
+        int[] types = hdrCapabilities != null ? hdrCapabilities.getSupportedHdrTypes() : null;
         return types != null && types.length > 0;
     }
 
index f7eb5d5..96f732e 100644 (file)
@@ -2072,6 +2072,9 @@ class ActivityStarter {
             case RECENTS_STACK_ID:
                 return r.isRecentsActivity();
             default:
+                if (StackId.isDynamicStack(stackId)) {
+                    return true;
+                }
                 Slog.e(TAG, "isValidLaunchStackId: Unexpected stackId=" + stackId);
                 return false;
         }