History log of /frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
51c4f038b2be0c32a4f7a09beb6865e25875cd95 05-Apr-2018 Bernardo Rufino <brufino@google.com> Catch IAE from unbind onServiceDisconnected()

We still don't know the underlying cause of this, but we shouldn't crash
the system_server. Catching for now.

Bug: 74940472
Bug: 77574274
Test: m -j RunFrameworksServicesRoboTests
Change-Id: I36fc2e65f8766f6b8fd68104d8830b72668d84eb
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
60719a4e7448f36dad8054740fb8becb2f1fb43f 09-Mar-2018 Bernardo Rufino <brufino@google.com> Add measurements for TransportClient connections

Retrievable via 'adb shell dumpsys backup transportstats'.
Sample output:

Average connection time: 36.00 ms
Max connection time: 181 ms
Min connection time: 7 ms
Number of connections: 16
Per transport:
com.google.android.gms/.backup.BackupTransportService
Average connection time: 27.71 ms
Max connection time: 139 ms
Min connection time: 13 ms
Number of connections: 14
com.google.android.gms/.backup.component.D2dTransportService
Average connection time: 181.00 ms
Max connection time: 181 ms
Min connection time: 181 ms
Number of connections: 1
android/com.android.internal.backup.LocalTransportService
Average connection time: 7.00 ms
Max connection time: 7 ms
Min connection time: 7 ms
Number of connections: 1

Bug: 72485465
Test: Will follow in another CL if reviewers OK w/ approach.
Change-Id: I133ed423d0b8471d69e3c3631aadee7d42d0ec0e
(cherry picked from commit e5a976404c66c054fbec9b124f816a90f9d6b4dc)
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
3184cc99486fca8d55287a96cb91f87603378201 20-Jan-2018 Bernardo Rufino <brufino@google.com> Binding on-demand #12: Log and unbind dangling TransportClients

Extracted connection in TransportClient to static class with weak
reference to TransportClient so that TransportClient is garbage
collected when left undisposed. Created finalize method that logs,
unbinds TransportClient and warns using CloseGuard.
Also adjusted some logging.

Bug: 17140907
Test: m -j RunFrameworksServicesRoboTests
Test: Manually left a dangling TransportClient and observed logs and
connections

Change-Id: I30f89e7c27579089ba29936483abd1b60c9e8e37
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
861b420bc3282da174523b309b8886fb0d50da58 17-Jan-2018 Bernardo Rufino <brufino@google.com> Binding on-demand #11: Dump TransportClients

And adjust logs.

Change-Id: I04fcfb77bac14db36cc30288878bbb65332deb81
Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: adb shell dumpsys backup
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
aa56a6cde39b80fa1edd61052dc8ad595d4562cc 16-Jan-2018 Bernardo Rufino <brufino@google.com> Move event logging to TransportClient and add connection event

Move event logging from registration to TransportClient and add new
event for connection.

Change-Id: I32022590a36b6f28f960e91f8880a0430e862852
Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: m -j RunFrameworksServicesRoboTest
Test: adb logcat -b events, check relevant events
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
41349c02a8867b956ff48752c2d3dffc124fc0fc 10-Jan-2018 Bernardo Rufino <brufino@google.com> Binding on-demand #10: Remove permanent binding and add registration

This CL is the last of the P1 CLs for binding on-demand. During
transport-usage migration to binding on-demand the permanent-bound
code was still there and we piggybacked on it to register the
transports. Now that everything is migrated we removed the permanent
binding and used the registration code created in the CL #9
(selectTransport) for registering all the transports.

I put a 3s delay on registration after bring-up. Any operation that uses
the transport before that will gracefully fail.

The TransportBoundListener does not return a boolean anymore because it
can't fail anymore (we pass it the data it needs so that it doesn't need
to be exposed to TransportNotRegistered exceptions). It's now called
OnTransportRegisteredListener.

Eligible transports were a similar thing to valid transports from the
permanent binding code, whose only need came from rebinding from what I
could tell. I saw no need for it anymore and removed it. If I missed
something please shout :)

I shuffled methods a bit in TransportManager.

There were a lot of changes to robo test infra to bring together
TransportManager tests and the rest and re-use mocking infra.

Change-Id: If61268228dd0bb724b718abd3dcafdad50e8b3dc
Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: m -j RunFrameworksServicesRoboTest
Test: runtest -p com.android.server.backup frameworks-services
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupTestCases
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupHostTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsBackupTestCases
Test: adb shell bmgr enable true/false
Test: adb shell bmgr list transports [-c]
Test: adb shell bmgr transport <transport_name>/-c <transport_component>
Test: adb shell bmgr restore <token>/<token> <package>/<package>
Test: adb shell bmgr backup <pacakge>
Test: adb shell bmgr run
Test: adb shell bmgr wipe <transport> <package>
Test: adb shell bmgr fullbackup <package>
Test: adb shell bmgr backupnow --all/<packages>
Test: adb shell cmd jobscheduler run -f android <job_id>
Test: adb shell dumpsys backup
Test: D2D scenario
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
516ac95746bd1091732e4bc407e2941debdc38d9 04-Jan-2018 Bernardo Rufino <brufino@google.com> Remove transport dir name from TransportClient

To be able to re-use the TransportClient infra for transport
registration, I need to remove transport dir name property from
TransportClient because it's not available before registration
itself. As a result callsites that used getTransportDirName()
from TransportClient will have to go through the
TransportManager for that. Bryan suggested that the
TransportClient wasn't the best place for the property before.

Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: m -j RunFrameworksServicesTests
Change-Id: I3fa335faf97d63adfad1a929336073a70fc8bc02
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
ab953332bca70799b908ae0bfffb10c5d7a7a7f7 22-Nov-2017 Bernardo Rufino <brufino@google.com> Binding on-demand #3: updateTransportAttributes() API

This CL introduces the updateTransportAttributes() API to be used by the
transport hosts. It doesn't actually use the description attributes yet,
this will go in another CL. This is because I want to test that CL
together with transport usage. Tests are lacking for TransportManager
and BMS, I'll still add them, but I'm trying to migrate Robolectric
first.

Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: make RunFrameworksServicesRoboTests
Test: runtest -p com.android.server.backup frameworks-services
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupTestCases
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupHostTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsBackupTestCases
Change-Id: I56f7b5a5026d21d8f11afb371d5560d4913c5f2a
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
4719ed513e68ac0c89f5830b2d50edb960b6ba34 15-Nov-2017 Bernardo Rufino <brufino@google.com> Binding on-demand #2: PerformFullTransportBackupTask usage

Migrate the full-backup task to use binding on-demand

Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: make RunFrameworksServicesRoboTests
Test: runtest -p com.android.server.backup frameworks-services
Test: adb shell bmgr backupnow <packages>
With transports manually unbound and also canceled the operation a
few times. Then inspected TransportClient logcat
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupTestCases
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupHostTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsBackupTestCases
Test: Manually unbound before GTS/CTS above.

Change-Id: I15abe970db0b9858e0e2e4eb666358db3a9d50ad
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java
af547f4a15a7d6121306a5e973ae7f3709e5df3a 13-Nov-2017 Bernardo Rufino <brufino@google.com> Binding on-demand #1: TransportClient infra + PerformBackupTask usage

This CL introduces TransportClient infra-structure and integration in
TransportManager, plus a few unit tests. Also start using binding
on-demand for PerformBackupTask.

Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: make RunFrameworksServicesRoboTests
Test: runtest -p com.android.server.backup frameworks-services
Test: adb shell bmgr backupnow <packages>
With transports manually unbound and also canceled the operation a
few times. Then inspected TransportClient logcat
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupTestCases
Test: gts-tradefed run commandAndExit gts-dev -m GtsBackupHostTestCases
Test: cts-tradefed run commandAndExit cts-dev -m CtsBackupTestCases
Test: Manually unbound before GTS/CTS above.
Change-Id: I63cbde27131205787d90663603a4f8f61d187607
/frameworks/base/services/backup/java/com/android/server/backup/transport/TransportClient.java