P-Y

P-Y

@p-y.wtf

https://p-y.wtf | Android Eng @Square | instagram.com/py.ricau | LeakCanary, Radiography, square/logcat, square/PAPA. He/Him

1.7K followers407 following1K posts

Pinned

Here's a thread of my past technical posts & threads! Pinned it to my profile to make these threads easier to find without having to scroll through all my random hot takes like how S'mores are disgusting garbage #AndroidDev

P-Y reposted

Ramaswamy has produced an attack ad weaponizing the rape of his opponent, Amy Acton, when she was 12 years old. It features Acton’s mother, who abandoned Acton after she was raped by her step-father, fleeing the state with her husband. Here is the corporate money helping fund that ad.

🤯 OOM root cause: A keypad-0 key on a keyboard was held down for 9 hours while the app sat on the passcode screen. We register a OnPreDrawListener for every key event and only remove it when the window next draws. The screen never redrew, so about 700,000 listeners piled up and took 188 MB.

My French Bulldog has no tail. When she lays on a couch (which is 80% of her day), her butthole touches the backrest... Tiny dried poop dots accumulate, and eventually I've end up with an impressionist line of poop on my sofa

P-Y reposted

People will say it's "Tech Week" here in NYC. Well, any event run by Andreessen Horowitz is illegitimate, because the NYC tech community has values, and one of its most fundamental is its humanity. They have forfeited theirs.

Blocking reflection is dumb: it's my own process, who cares what I do with it? More importantly: Google engineers write bugs. LOTS of them. And after an OS ships, the code is frozen, no fixes. We NEED reflection to fix their fuckups.

So instead we use reflection to inject a custom context wrapper we own in the window, and THAT gets passed at construction time to the DecorView

That DecorView holds a special additional weak ref to an activity context, passed in at construction time... Whoever implemented it forgot to swap out the weak ref to the old activity when the DecorView gets reused. DecorView calls weakRef.get() every frame sooo...

The weak ref keeps surviving GC long after the activity is destroyed => leak. We unfortunately can't use reflection to fix this, the field is blacklisted... I really want to give an earful to whoever at Google decided to block reflection, it's SO STUPID.

Can you believe this shit?! Whoever works on security for the "my Visa" app: Fuck You. Go back to making your employees change their password, stop bothering customers with such stupid antisecurity rules. I hope a mad sorcerer sets a curse on you.

Claude came up with a one shot valid, reasonable & small size fix for an Android keyboard leak that's been nagging all Android devs for ages (APIs 30 to 35). github.com/square/leakc... What helped the most: providing Claude with a tool that exposes heap state, to check hypothesis against sources.

github.comFix InputMethodManager.mImeInsetsConsumer holding a removed window by pyricau · Pull Request #3006 · square/leakcanaryWhat leaks InputMethodManager.mImeInsetsConsumer holds the ImeInsetsSourceConsumer of a dialog that was already dismissed, and through it that dialog's ViewRootImpl. Meanwhile the activity that...

"Started from that directory, so nothing of this repository is in what the session is told, and the prompt beside you is the whole of it." Is there a name for Claude's nonsensical style of writing? Not just "LLM speak" but that very weird phrasing style.

It's 2026 and Android Studio stills loads projects with the "Android" view that hides your actual project structure and doesn't display the location of the files you open. Still treating Android devs like babies who shouldn't see a file that the Android team didn't think was important

Watching Mando & Grogu, and I'm sorry but Grogu's animation is shit. I get that it's intentional, but the result just doesn't feel great to me

Early still, but at the top here is the outcome written by an agent investigating a leak, following a method enforced via MCP. The same process holds the UI and the MCP, which means the agent can show its investigation in context and you can poke around.

The next release of LeakCanary will update its vocabulary. Instead of "Leaking: Yes / No", object status will be reported with "Verdict: Stuck / Expected". This aims to help folks (& agents) grasp that a leak is a faulty reference, rather than any given object

Ingo Kegel@ingokegel.bsky.social

Zombie comes to mind, but has an actor-like feeling. What about "stuck"? An object that is stuck in the heap due to a faulty reference.

Thanks Ingo for suggesting "stuck", I really like how it conveys "we expected this to be GCed but it's stuck in the heap due to a faulty reference"

Me: "Ajoute du sel et du lait sur la liste de course" Index01: "sur la petite croute" Trying again: "sur les secours" This voice recognition thing isn't quite there yet

LeakCanary has framework specific knowledge and can report objects as "leaking" / "not leaking" / "unknown" based on state (e.g. an activity having a "destroyed" boolean field). "Leaking" means "should be been GCed but is retained". I'm looking into alternative words to carry this meaning #help

View full thread

"Leaking" canditades: Dead / Garbage / Expired / Defunct / Obsolete / Stale / Abandonned "Not leaking" candidates: Active / Live / Fresh / In use / Needed

None of the other Java heap tools have this concept. JProfiler (cc @ingokegel.bsky.social) apparently mentions "faulty references" in its dominator tree guidance (I like "faulty"!) I kinda like "Garbage" for this but might be confusing because Garbage normally gets collected. "Obsolete"?

LeakCanary has framework specific knowledge and can report objects as "leaking" / "not leaking" / "unknown" based on state (e.g. an activity having a "destroyed" boolean field). "Leaking" means "should be been GCed but is retained". I'm looking into alternative words to carry this meaning #help

The "leak" is typically a single bad reference that should have been cleared, which leads to a whole group of objects being retained. I don't like "Leaking" as an object status, as it steers attention towards the leaking objects, whereas I'd rather have people look for the bad reference

Who's been training the LLMs to use acronyms everywhere? It was hard enough when my peers did it, but now the agents just straight up invent their own and drop them everywhere without ever showing you the association

I think Claude is a little mad at me: > I left "stochastic parrot" alone — you've picked it twice and it's your call; I've said what I think. (can't help but remind me of @mekka.mekka-tech.com 's frequent "I've said what I said")

I've been vibe coding a new Java heap exploration desktop tool (more on that soon). One interesting outcome: the UI has a lot more explanation text than what you'd expect in typical desktop software. Claude is chatty even in the UI it produces. Still deciding if I like it.

Also kind of fun that every task has intructions to show the result by starting an instance of the app with a custom title related to the task (to help distinguish them), so I start a bunch of parallel work and get all these shark icons popping up

P-Y reposted

1/ Java serialization sucks. That's why there are so many alternatives. There's a new kid on the block who claims to be much faster than anybody else. I was curious, so I put together a comparison of the top 5 Java serialization frameworks.

P-Y reposted

I only just now realized that the slogan is "have a break, have a Kit Kat" because you *break a Kit Kat in half* when you eat it

P-Y reposted

Replying to @p-y.wtf

IN THEORY AppFunctions is the implementation of MCP for Android. Official docs say that other apps and agents than Gemini should be able to use them. Reality is that it is now blocked for Gemini only. Not sure if there’s any intention to open up that permission to other apps in the short-mid term.

My spanish is top notch.. I ordered water and then asked for "quatro besos" (four kisses..). I ordered "aqua con gas" and got cañas (beers)

Is there really no emerging "Android local MCP" standard? (local as in app to app e.g. content provider) Google shipped AppFunctions, FUCK THAT, it's only for apps to expose functions to Gemini. We need a standard protocol / SDK so that apps can: - List MCPs available locally - Answer MCP queries

View full thread

I am curious about the right model for Android local MCPs. E.g. you might just want a query/response model in which case content provider is great, but you might also want to trigger UI (e.g. show activity) which has more restrictions

So either you leverage an Android channel where the caller forwards its foreground nature to the callee, or you have the callee respond with an intent API that the caller should invoke, which maybe gives the caller more control security wise.

Is there really no emerging "Android local MCP" standard? (local as in app to app e.g. content provider) Google shipped AppFunctions, FUCK THAT, it's only for apps to expose functions to Gemini. We need a standard protocol / SDK so that apps can: - List MCPs available locally - Answer MCP queries

cc @ericmigi.com curious if that's come up for Index 01. I can't imagine you'd a bajillion PRs to support every possible intent based integration. Android IS designed for app to app communications. E.g. MCP over content provider seems fairly straightforward. This could be a small standard protocol.

very selfishly I want to build my own little MCP app that can do things locally (my Android already has lots of keys / accesses / integrations to be able to do stuff, no cloud needed!) And I want to talk to it via Index 01