OSDN Git Service

Prevent clobbering of activity options bundle when merging
authorWinson Chung <winsonc@google.com>
Fri, 29 Jun 2018 17:16:53 +0000 (10:16 -0700)
committerWinson Chung <winsonc@google.com>
Sat, 30 Jun 2018 00:36:16 +0000 (17:36 -0700)
commit3743d28ec98d06f8aa51d3e03b573dc2abe5aef1
tree2d1211a02719488d32c5b0abcd0f45dd77646cae
parent0c16e74bc024707bb937faedc499dcbfca809b5e
Prevent clobbering of activity options bundle when merging

- RemoteViews specify an ActivityOptions when calling startIntentSender()
  (for click handling), but if the PendingIntent being started also has an
  ActivityOptions, the merging of the two options will fail since the
  ActivityOptions properties are always written into the bundle (regardless
  of whether they are actually set).  Instead, only write non-default
  values to the bundle (the defaults will be read out if not set when
  restoring the options from the bundle anyways).

Bug: 72459081
Test: atest FrameworksServicesTests:ActivityOptionsTest

change-id: i1d6718d9db4b3f7056412c5b4c5347a19ffa7c09
core/java/android/app/ActivityOptions.java
services/tests/servicestests/src/com/android/server/am/ActivityOptionsTest.java [new file with mode: 0644]