Skip to content

Commit 88dbb45

Browse files
timwangdevfacebook-github-bot
authored andcommitted
Use class canonical name for PARTIAL_WAKE_LOCK tag (#24673)
Summary: When acquiring the `PARTIAL_WAKE_LOCK`, Android requires a tag to identify the source, normally the class name. This tag will show on dumpsys call and Google Play developer console. `getSimpleName` will work fine as long as not enable ProGuard, in my case, it transformed the class name to just `"c"`, and I take my half day to find where the `c` comes from. `getCanonicalName` will add the package path, which is more friendly for developers. Later we can even let the developer choose the tag name, but this will require API break changes. [Android] [Changed] - Use class canonical name for PARTIAL_WAKE_LOCK tag Pull Request resolved: #24673 Differential Revision: D15164306 Pulled By: cpojer fbshipit-source-id: fd65f9e5250c180b0053940b17877fe36af5d48b
1 parent bdb1d43 commit 88dbb45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/HeadlessJsTaskService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static void acquireWakeLockNow(Context context) {
7575
Assertions.assertNotNull((PowerManager) context.getSystemService(POWER_SERVICE));
7676
sWakeLock = powerManager.newWakeLock(
7777
PowerManager.PARTIAL_WAKE_LOCK,
78-
HeadlessJsTaskService.class.getSimpleName());
78+
HeadlessJsTaskService.class.getCanonicalName());
7979
sWakeLock.setReferenceCounted(false);
8080
sWakeLock.acquire();
8181
}

0 commit comments

Comments
 (0)