diff options
author | Jae Seo <jaeseo@google.com> | 2015-06-21 23:00:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-21 23:00:11 +0000 |
commit | 392f2d3b5d8407f7920e437a2d0db900251b4f81 (patch) | |
tree | 2cfabd7baf3d665653fea5fa95ff13170514f204 | |
parent | a5103b9b52f38fa4928f8712c95049791a1153d2 (diff) | |
parent | 93ff14b7a5d1a9b4d3f57da85b286069fe9d8303 (diff) | |
download | frameworks_base-392f2d3b5d8407f7920e437a2d0db900251b4f81.zip frameworks_base-392f2d3b5d8407f7920e437a2d0db900251b4f81.tar.gz frameworks_base-392f2d3b5d8407f7920e437a2d0db900251b4f81.tar.bz2 |
Merge "TIF: Use the right size for calls to toArray() instead of 0" into mnc-dev
-rw-r--r-- | services/core/java/com/android/server/tv/TvInputHardwareManager.java | 2 | ||||
-rw-r--r-- | services/core/java/com/android/server/tv/TvInputManagerService.java | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/tv/TvInputHardwareManager.java b/services/core/java/com/android/server/tv/TvInputHardwareManager.java index 444969f..8d2ff35 100644 --- a/services/core/java/com/android/server/tv/TvInputHardwareManager.java +++ b/services/core/java/com/android/server/tv/TvInputHardwareManager.java @@ -900,7 +900,7 @@ class TvInputHardwareManager implements TvInputHal.Callback { mAudioManager.createAudioPatch( audioPatchArray, new AudioPortConfig[] { sourceConfig }, - sinkConfigs.toArray(new AudioPortConfig[0])); + sinkConfigs.toArray(new AudioPortConfig[sinkConfigs.size()])); mAudioPatch = audioPatchArray[0]; if (sourceGainConfig != null) { mAudioManager.setAudioPortGain(mAudioSource, sourceGainConfig); diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index 4895d12..8f32510 100644 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -1658,10 +1658,9 @@ public final class TvInputManagerService extends SystemService { UserState userState = getUserStateLocked(resolvedUserId); if (userState.sessionStateMap.size() == 1) { return true; - } - else if (userState.sessionStateMap.size() == 2) { + } else if (userState.sessionStateMap.size() == 2) { SessionState[] sessionStates = userState.sessionStateMap.values().toArray( - new SessionState[0]); + new SessionState[2]); // Check if there is a wrapper input. if (sessionStates[0].hardwareSessionToken != null || sessionStates[1].hardwareSessionToken != null) { |