Skip to content
Commit 2bc36417 authored by Aurélien Pomini's avatar Aurélien Pomini
Browse files

Create static inner class for UiModeManager

UiModeManager instances register a callback to the service on creation.

This is problematic since the callback will store the instance of the
class under the hood and prevent it from being garbage collected.

Instead, use a static inner class containing only what is required for
the callbacks.

Also move the mService object, which is a IBinder.stub.asInterface(..),
inside the static inner class.

This follows the same pattern as in WallpaperManager.

Fixes: 289811808
Test: atest UiModeManagerTest
Change-Id: I60a348483cde684891b7468eb45f28422b0e4a5d
parent c8a7e355
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment