Commit Graph

5455 Commits

Author SHA1 Message Date
Emilian Peev
671d613bcb Camera: Avoid NPE when extension results are not supported
Bug: 240017175
Test: atest -c -d cts/tests/camera/src/android/hardware/camera2/cts/CameraExtensionSessionTest.java#testRepeatingAndCaptureCombined
Change-Id: I0b82039a103ac2a55f71a6aea505d7c7c696d7be
2022-07-27 22:46:59 +00:00
Rucha Katakwar
7cdfd75b02 Merge "Update torch brightness max level description." into tm-d1-dev 2022-07-27 18:14:04 +00:00
Rucha Katakwar
851d5cf44b Update torch brightness max level description.
Bug: 239492786
Change-Id: I9514a3d137a64f99e3c5c03d1843b53ace0cbf3a
2022-07-21 14:03:50 -07:00
Jayant Chowdhary
138fc75ad4 Merge "camera2: update original ByteBuffer using bulk get on 'viewed' ByteBuffer for correct position" into tm-d1-dev 2022-07-21 20:41:45 +00:00
Jayant Chowdhary
cff610bf0e camera2: update original ByteBuffer using bulk get on 'viewed' ByteBuffer for correct position
When we use any of the viewed methods from ByteBuffer such as
asFloatBuffer, the returned buffer's position and the original
ByteBuffer's positions are independent. So update the original
ByteBuffer's position as well, for correct accounting.

Bug: 239639757

Test: Camera CTS; GCA
Test: MarshalQueryableArray error logs don't appear in logcat while using GCA

Change-Id: I488a23c278ee5d044c2423a616e598a93cbbad0b
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2022-07-20 18:33:45 +00:00
Rucha Katakwar
a5bd39561a Update torch brightness max level description.
Bug: 239492786
Change-Id: I01720f2d25b932d58fa8b7816f8504101d70f3a3
2022-07-19 16:50:25 -07:00
Jayant Chowdhary
f0f7a7cabf camera2: use bulk get methods while unmarshalling primitives.
Bug: 239167817

Test: GCA (validity)
Test: Camera CTS
Test: profiling results mentioned in b/239167817

Change-Id: I6954a81d49be6d8a0746301e544b1772444ee746
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2022-07-15 19:40:29 +00:00
Avichal Rakesh
a9d512bef1 camera: Fix exception handling from ImageReader#detach
ImageReader has a bug where if detaching an Image from Surface fails, it
might throw a RuntimeException instead of an IllegalStateException as
stated in the javadoc. This can lead to CameraExtensionSessionImpl
crashing due to the unhandled exception. Changing ImageReader behavior
is difficult as it might break backwards compatibility.

To prevent crashes from expected exception, this CL adds exception
handling for RuntimeException when detaching images.

In addition, CameraExtensionSessionImpl caught generic `Exception` at
another place, which can lead to it consuming unintended exceptions.
This CL scopes in the exception handling to consume expected exceptions
only.

Bug: 236825255
Test: CtsCameraTestCases pass on Flame
Change-Id: I6fa81b7a19fb4017480074e33b09942aedcd2212
2022-07-01 11:42:22 -07:00
Jayant Chowdhary
06086bee8e Merge "Limit preview stabilization mandatory stream sizes to 1440p (instead of RECORD)." into tm-dev am: f0094b8dd3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18704183

Change-Id: I17b3850de21c4b35e5e447e5faa1b03adedae9a3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-17 21:36:47 +00:00
Jayant Chowdhary
f0094b8dd3 Merge "Limit preview stabilization mandatory stream sizes to 1440p (instead of RECORD)." into tm-dev 2022-06-17 21:35:12 +00:00
Jayant Chowdhary
d83e9b5325 Limit preview stabilization mandatory stream sizes to 1440p (instead of RECORD).
Also fix a logic error in an if check while retrieving mandatory streams
for preview stabilization. This was not caught by CTS since for devices
where preview stabilization was supported, skipped the test. A
modification has been made to CTS RobustnessTest to ensure that the
preview stabilization support and mandatory streams are in agreement
with each other.

Bug: 228245412

Test: atest RobustnessTest.java on device supporting preview stabilization

Change-Id: I18c7f3c728862866b8f088da3afe222afbad7051
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2022-06-17 17:18:29 +00:00
TreeHugger Robot
36b94109da Merge "Camera: Update streamConfigurationMap doc for JPEG sizes" into tm-dev am: 0558b51322
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18870021

Change-Id: I9d568bfb8c0203d15ce146c0592611e12297a04e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 03:36:48 +00:00
TreeHugger Robot
0558b51322 Merge "Camera: Update streamConfigurationMap doc for JPEG sizes" into tm-dev 2022-06-14 03:16:43 +00:00
Emilian Peev
53b01eb303 Merge "Camera: Allow synthetic extension metadata" into tm-dev am: eb177cd5d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18801658

Change-Id: I3eb898b1001a34db4d315ca7bc44a607acd927a3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 21:51:53 +00:00
Emilian Peev
eb177cd5d6 Merge "Camera: Allow synthetic extension metadata" into tm-dev 2022-06-13 21:29:03 +00:00
Shuzhen Wang
e07c69bfde Camera: Update streamConfigurationMap doc for JPEG sizes
Update the developer doc for reduced set of supported JPEG sizes
depending on media performance class level.

Also fix some broken links in developer doc.

Test: Build
Bug: 235804659
Change-Id: Iab3be52d13f02a19cc62732dcdf46feb576e0095
2022-06-13 14:09:58 -07:00
Michael Wright
4f89921b4a Merge "Revert "Revert "Do not send updates for disabled displays.""" into tm-dev am: f029d8cf1b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18799664

Change-Id: Ia26667a9b7d0d79d69496acd37857b48b4e2cda0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-13 19:48:22 +00:00
Michael Wright
ce5906b4a1 Revert "Revert "Do not send updates for disabled displays.""
This reverts commit d04fae1ba7.

Reason for revert: Robolectric fixed

Change-Id: Idfba84d5aefb694f9af77a1d4f1a648e01e282b4
2022-06-13 11:08:32 +00:00
Sam Dubey
525a41a6db Merge "Revert "Do not send updates for disabled displays."" into tm-dev am: 54e0824f85
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18803234

Change-Id: Ide0cddaef2914222fbea373abcb2d517e50edbe1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 06:47:39 +00:00
Sam Dubey
54e0824f85 Merge "Revert "Do not send updates for disabled displays."" into tm-dev 2022-06-10 05:51:43 +00:00
Sam Dubey
d04fae1ba7 Revert "Do not send updates for disabled displays."
This reverts commit 3175300106.

Reason for revert: Breaking roboelectric suw tests with an NPE accessing displayids() in shadowdisplaymanager

Bug: 235541208
Change-Id: Ib760b5b9a477eb3c8516f01614afe8192a6e597b
2022-06-10 04:38:26 +00:00
TreeHugger Robot
627bbbe717 Merge "Do not send updates for disabled displays." into tm-dev am: ad3c32bff1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17245703

Change-Id: Iccc9059b93b53ff6443c7ee1a970c06e97e81223
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 00:10:02 +00:00
TreeHugger Robot
ad3c32bff1 Merge "Do not send updates for disabled displays." into tm-dev 2022-06-09 23:45:39 +00:00
Santos Cordon
3175300106 Do not send updates for disabled displays.
If a display is disabled, do no share it outside of
LogicalDisplayMapper.

This will help by not creating unnecessary updates for displays that
are disabled.

Bug: 197515205
Bug: 221071695
Test: atest com.server.android.display
Test: Manually verify display layouts still successfully change, and
      also that confirm logs no longer have excessive add/remove
      display notifications.
Change-Id: Ie5954935bb1afc612935e52d421b0e103d8d0854
2022-06-09 13:37:59 +00:00
Emilian Peev
cbd3739167 Camera: Allow synthetic extension metadata
Synthetic metadata such as 'STATISTICS_FACES'
could be of value to extension clients.
Allow extension implementations to advertise support
for synthetic keys.

Bug: 235330843
Test:
atest -c -d
cts/tests/camera/src/android/hardware/camera2/cts/CameraExtensionCharacteristicsTest.java
atest -c -d
cts/tests/camera/src/android/hardware/camera2/cts/CameraExtensionSessionTest.java

Change-Id: I80133e4559610ecad714afa93400c00b2b6685fa
2022-06-08 14:13:56 -07:00
TreeHugger Robot
a6cc576b31 Merge "Logging for DisplayPowerController SuspendBlockers" into tm-dev am: aedd857b68
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18375396

Change-Id: Ib41f70c6c5488d6d169a364cc5639d842ca1724e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-03 18:14:57 +00:00
TreeHugger Robot
aedd857b68 Merge "Logging for DisplayPowerController SuspendBlockers" into tm-dev 2022-06-03 17:59:53 +00:00
Antony Sargent
de2d849abd Merge "Prevent deadlocks during VirtualDisplay creation" into tm-dev am: fc6eb70e0e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18246032

Change-Id: If653afb4a286de6046e9bf4392a2fa924de5c92b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-30 00:35:54 +00:00
Antony Sargent
725dad7d71 Prevent deadlocks during VirtualDisplay creation
When creating a VirtualDisplay for a VirtualDevice, we need to do some
extra work like setting up for input injection, creating a
DisplayWindowPolicyController, and grabbing a wakelock to keep the
display awake. Some parts of this extra work end up calling back into
the DisplayManagerService from another thread, but since we're already
holding the mSyncRoot lock we sometimes get into situations where
those threads get blocked trying to acquire mSyncRoot, while holding a
lock that another thread ends up needing like the global window
manager one, so we get deadlock.

The fix in this CL is to break up the extra work the
VirtualDeviceManagerService needs to do into two parts: one part that
happens before the VirtualDisplay is created, and one part
after. Neither of these needs mSyncRoot to be held.

Fixes: 230544802
Test: atest CreateVirtualDisplayTest
Change-Id: I6a6e03f816567579510b3f1ef0705375549a3c88
2022-05-29 11:18:36 -07:00
Santos Cordon
1fe8fe5b7b Logging for DisplayPowerController SuspendBlockers
Bug: 213407479
Test: Manually verify via 'adb shell dumpsys display'
Change-Id: I2948319fc0354adf6e25b30ca11654c368c1e1d5
2022-05-28 17:13:20 +00:00
TreeHugger Robot
c8571df946 Merge "Add ALL_INCLUDING_DISPLAYS category for getDisplays()" into tm-dev am: d5b0c3f163
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18488313

Change-Id: I7d8ed0e3dd91a8c0bd54868de5333f63d2268fdf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 03:01:12 +00:00
TreeHugger Robot
d5b0c3f163 Merge "Add ALL_INCLUDING_DISPLAYS category for getDisplays()" into tm-dev 2022-05-25 02:40:34 +00:00
Emilian Peev
be108d910c Merge "Camera: Pass shared outputs during advanced extension configuration" into tm-dev am: f25e9aec2a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18192278

Change-Id: I7d72a960a3ef9480f2d357aac08d54e6aed4422f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 22:25:30 +00:00
Emilian Peev
f25e9aec2a Merge "Camera: Pass shared outputs during advanced extension configuration" into tm-dev 2022-05-24 22:20:42 +00:00
Santos Cordon
3be5498e61 Add ALL_INCLUDING_DISPLAYS category for getDisplays()
Add a category for DisplayManager#getDisplays() that includes
disabled/inaccessible/temporary displays in the set of returned
Displays.

Bug: 221071695
Test: adb shell cmd display get-displays \
      android.hardware.display.category.ALL_INCLUDING_DISABLED
Change-Id: If06f7f8b7f9ba4779a19d24d76fb49e95a908afc
2022-05-20 11:27:45 +00:00
TreeHugger Robot
02afba9572 Merge "Defines flag to disable touch feedback on display" into tm-dev am: beddca329f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17607970

Change-Id: Ie13675a43f0ddf29f926292fb2813508d890b583
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-19 12:24:55 +00:00
yuanjiahsu
fc06fc5cb1 Defines flag to disable touch feedback on display
Define FLAG_TOUCH_FEEDBACK_DISABLED to disable touch sound and haptic feedback when creating virtual display.

Bug: 185558698
Test: atest FrameworksCoreTests:ViewRootImplTest, manual testing
Change-Id: Ida67f4027f2636e004218595b3bf088c06194522
2022-05-19 06:01:55 +00:00
TreeHugger Robot
936834e3b5 Merge "Camera: Add videoStabilizationMode to Camera session stats" into tm-dev am: ed57953565
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18376844

Change-Id: If1a8c3eccb6676f891a7e8742b49aacdaccfddb3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 21:33:08 +00:00
Shuzhen Wang
23767f998d Camera: Add videoStabilizationMode to Camera session stats
Test: ./out/host/linux-x86/bin/statsd_testdrive 227
Bug: 224639088
Change-Id: I2a7b0965662b729585d0aa6e6a1e6407e448ddfe
2022-05-17 14:20:53 -07:00
Prabir Pradhan
978c20b808 Merge "Consolidate testing for input changes" into tm-dev am: 648717a3b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18186410

Change-Id: I91801a48d0c935f990b71216c4ece2bd0ba29f8b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-16 14:15:48 +00:00
Prabir Pradhan
648717a3b1 Merge "Consolidate testing for input changes" into tm-dev 2022-05-16 13:22:00 +00:00
TreeHugger Robot
065c279cb6 Merge "Camera: Update doc to describe tradeoff of DEFAULT timestamp base" into tm-dev am: b15596cb67
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18322257

Change-Id: I7ced63c3e66fc4275382d8801cc950b55a17ec06
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-14 19:34:43 +00:00
TreeHugger Robot
b15596cb67 Merge "Camera: Update doc to describe tradeoff of DEFAULT timestamp base" into tm-dev 2022-05-14 18:05:10 +00:00
TreeHugger Robot
edc4e42618 Merge "Add note about Sensor.TYPE_HEAD_TRACKER visibility" into tm-dev am: 616530de0e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18381200

Change-Id: Ibecbc1b8eb6b42b1a68f760961e3fbd9cba14f39
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-14 04:20:56 +00:00
Brian Duddie
73d4b0f98f Add note about Sensor.TYPE_HEAD_TRACKER visibility
In Android 13, this sensor type is generally not expected to be used by
apps.

Bug: 224619073
Test: compile; comment change only
Change-Id: Ic6f56b6d354777dcf608d34314d6e4e7b7af36b8
2022-05-13 20:47:08 +00:00
Shuzhen Wang
bca2a32c73 Camera: Update doc to describe tradeoff of DEFAULT timestamp base
Describe the tradeoffs of preview jitter reduction, and mention that
the application can turn off jitter reduction for better latency.

Test: Build
Bug: 195025014
Change-Id: I68f99efe6a35ae9db0f4cdf75ef31879f8550ff8
2022-05-13 10:47:37 -07:00
TreeHugger Robot
200c269fc7 Merge "Reland: Change input injection security model" into tm-dev am: d0f6ad2f30
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17689973

Change-Id: I79f4598fd2d915422d8db6b3ed0076f78a369dab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-11 20:34:28 +00:00
Prabir Pradhan
0f9ea02be0 Reland: Change input injection security model
This reverts commit 6b3c6cae3f.

Changes from revert:
- Explicitly maintain the same behavior as previous versions of Android,
  where injection is allowed into all window if the caller has the
  INJECT_EVENTS permission, even if it is targeting a certain uid. This
  fallback will be removed separately in b/228161340.
- Clear the calling identity before checking if the injection source has
  a permisssion to avoid hitting blanket-checks in PackageManager that
  denys permissions in some cases, such as if the permission check call
  is coming from an instant app (b/228319794).
- Leave the existing IInputManager#injectInputEvent method signature
  unchanged, and add a new input method injectInputEventToTarget to
  perform targeted injection. This makes it so that tools or apps
  relying on the @UnsupportedAppUsage injection method will not be
  broken by a change in the method's signature (b/228583652).

Bug: 207667844
Bug: 194952792
Test: Run tests affected by b/228319794 and its duplicates using
cts-tradefed, so that they are also run as instant apps.
Test: Test scrcpy tool works locally

Change-Id: I503e4f087501e3aecf2c18b4b1d27e51ecda59ac
Merged-In: I503e4f087501e3aecf2c18b4b1d27e51ecda59ac
2022-05-10 18:40:32 +00:00
TreeHugger Robot
847661ebbd Merge "Switched face acquire strings" into tm-d1-dev 2022-05-09 21:46:01 +00:00
Emilian Peev
c7f3fa1920 Camera: Pass shared outputs during advanced extension configuration
Shared outputs are not expected to be part of the main output
configuration list. Expect to receive the shared surfaces only
as part of the corresponding shared list.

Bug: 231636379
Test: Camera CTS
Change-Id: I67547a38ed97d55c8270196403d4af5d62795351
2022-05-09 11:10:48 -07:00