Merge remote-tracking branch 'origin/master' into new-core

This commit is contained in:
Cameron Gutman 2017-05-15 23:23:45 -07:00
commit f7d91b5107
2 changed files with 23 additions and 4 deletions

View File

@ -40,8 +40,12 @@
android:name="com.sec.android.support.multiwindow" android:name="com.sec.android.support.multiwindow"
android:value="true" /> android:value="true" />
<!-- Samsung DeX support requires explicit placement of android:resizeableActivity="true"
in each activity even though it is implied by targeting API 24+ -->
<activity <activity
android:name=".PcView" android:name=".PcView"
android:resizeableActivity="true"
android:configChanges="mcc|mnc|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"> android:configChanges="mcc|mnc|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -56,6 +60,7 @@
<activity <activity
android:name=".AppViewShortcutTrampoline" android:name=".AppViewShortcutTrampoline"
android:noHistory="true" android:noHistory="true"
android:resizeableActivity="true"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"> android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
@ -63,6 +68,7 @@
</activity> </activity>
<activity <activity
android:name=".AppView" android:name=".AppView"
android:resizeableActivity="true"
android:configChanges="mcc|mnc|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"> android:configChanges="mcc|mnc|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
@ -70,6 +76,7 @@
</activity> </activity>
<activity <activity
android:name=".preferences.StreamSettings" android:name=".preferences.StreamSettings"
android:resizeableActivity="true"
android:label="Streaming Settings"> android:label="Streaming Settings">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
@ -77,6 +84,7 @@
</activity> </activity>
<activity <activity
android:name=".preferences.AddComputerManually" android:name=".preferences.AddComputerManually"
android:resizeableActivity="true"
android:label="Add Computer Manually"> android:label="Add Computer Manually">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
@ -87,6 +95,7 @@
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"
android:screenOrientation="sensorLandscape" android:screenOrientation="sensorLandscape"
android:noHistory="true" android:noHistory="true"
android:resizeableActivity="true"
android:theme="@style/StreamTheme"> android:theme="@style/StreamTheme">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
@ -105,6 +114,7 @@
<activity <activity
android:name=".HelpActivity" android:name=".HelpActivity"
android:resizeableActivity="true"
android:configChanges="mcc|mnc|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"> android:configChanges="mcc|mnc|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"

View File

@ -561,8 +561,13 @@ public class Game extends Activity implements SurfaceHolder.Callback,
} }
boolean handled = false; boolean handled = false;
if (event.getDevice() == null ||
event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC) { boolean detectedGamepad = event.getDevice() == null ? false :
((event.getDevice().getSources() & InputDevice.SOURCE_JOYSTICK) != 0 ||
(event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) != 0);
if (detectedGamepad || (event.getDevice() == null ||
event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC
)) {
// Always try the controller handler first, unless it's an alphanumeric keyboard device. // Always try the controller handler first, unless it's an alphanumeric keyboard device.
// Otherwise, controller handler will eat keyboard d-pad events. // Otherwise, controller handler will eat keyboard d-pad events.
handled = controllerHandler.handleButtonDown(event); handled = controllerHandler.handleButtonDown(event);
@ -599,8 +604,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
} }
boolean handled = false; boolean handled = false;
if (event.getDevice() == null || boolean detectedGamepad = event.getDevice() == null ? false :
event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC) { ((event.getDevice().getSources() & InputDevice.SOURCE_JOYSTICK) != 0 ||
(event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) != 0);
if (detectedGamepad || (event.getDevice() == null ||
event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC
)) {
// Always try the controller handler first, unless it's an alphanumeric keyboard device. // Always try the controller handler first, unless it's an alphanumeric keyboard device.
// Otherwise, controller handler will eat keyboard d-pad events. // Otherwise, controller handler will eat keyboard d-pad events.
handled = controllerHandler.handleButtonUp(event); handled = controllerHandler.handleButtonUp(event);