Skip to content

Commit 6ec8f44

Browse files
fryanpanclaude
andcommitted
ADFA-4128 (6/11): drop the disconnect binder method and its tests
The runtime only ever disconnected by process death, which ProxyAppConnections.onDisconnected already handles; the AIDL method went in the qb-04 followup. Asked for in review on #1718. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xsc7AMGBVyEMfrwpZX87iC
1 parent 766f279 commit 6ec8f44

2 files changed

Lines changed: 0 additions & 32 deletions

File tree

‎quickbuild/core/src/main/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostService.kt‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,6 @@ class QuickBuildHostService : Service() {
144144
deathWatch = null
145145
}
146146

147-
override fun disconnect(packageName: String?) {
148-
enforceCaller("disconnect")
149-
log.info("Proxy app {} disconnected", packageName)
150-
// Unlink too: a stale recipient would otherwise fire on the process's eventual
151-
// death and report a disconnect against whatever is registered by then.
152-
clearDeathWatch()
153-
connections.onDisconnected()
154-
}
155-
156147
/**
157148
* Throws unless the caller is the proxy app the live session accepts.
158149
*

‎quickbuild/core/src/test/java/org/appdevforall/cotg/quickbuild/service/deploy/QuickBuildHostBinderTest.kt‎

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class QuickBuildHostBinderTest {
4747
assertThrows(SecurityException::class.java) { binder.connect(target, "com.example.quickbuild", 0) }
4848
assertThrows(SecurityException::class.java) { binder.reportReloaded(1, 40) }
4949
assertThrows(SecurityException::class.java) { binder.reportCrash(1, "boom") }
50-
assertThrows(SecurityException::class.java) { binder.disconnect("com.example.quickbuild") }
5150
assertThat(connections.target.value).isNull()
5251
}
5352

@@ -122,16 +121,6 @@ class QuickBuildHostBinderTest {
122121
return seen
123122
}
124123

125-
@Test
126-
fun `disconnect clears the registered target`() {
127-
beginMatchingSession()
128-
binder.connect(target, "com.example.quickbuild", 0)
129-
130-
binder.disconnect("com.example.quickbuild")
131-
132-
assertThat(connections.target.value).isNull()
133-
}
134-
135124
@Test
136125
fun `a death from a superseded binder leaves the live registration alone`() {
137126
beginMatchingSession()
@@ -236,18 +225,6 @@ class QuickBuildHostBinderTest {
236225
assertThat(connections.target.value).isNull()
237226
}
238227

239-
@Test
240-
fun `a graceful disconnect unlinks the death watch`() {
241-
beginMatchingSession()
242-
val live = WatchableBinder()
243-
binder.connect(targetOn(live.binder), "com.example.quickbuild", 0)
244-
245-
binder.disconnect("com.example.quickbuild")
246-
247-
// No stale recipient stays linked to fire on the process's eventual death.
248-
assertThat(live.watching()).isEmpty()
249-
}
250-
251228
/**
252229
* An [IBinder] that records link/unlink traffic and can script [IBinder.linkToDeath],
253230
* so the death-watch wiring is exercised for real. Only the two death-watch methods

0 commit comments

Comments
 (0)