From db7d4da3e5e51662ae561632ad104473d1f825c4 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 21 May 2013 15:09:02 -0700 Subject: [PATCH] Clean up IntentCompatUtils a bit Change-Id: I803aa6c2160bfa1ffe992b28e7eb6e8a320c9762 --- .../android/inputmethod/compat/IntentCompatUtils.java | 9 ++++----- .../latin/setup/LauncherIconVisibilityManager.java | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/java/src/com/android/inputmethod/compat/IntentCompatUtils.java b/java/src/com/android/inputmethod/compat/IntentCompatUtils.java index df2e22fe8..965a2a891 100644 --- a/java/src/com/android/inputmethod/compat/IntentCompatUtils.java +++ b/java/src/com/android/inputmethod/compat/IntentCompatUtils.java @@ -21,16 +21,15 @@ import android.content.Intent; public final class IntentCompatUtils { // Note that Intent.ACTION_USER_INITIALIZE have been introduced in API level 17 // (Build.VERSION_CODE.JELLY_BEAN_MR1). - public static final String ACTION_USER_INITIALIZE = - (String)CompatUtils.getFieldValue(null, null, + private static final String ACTION_USER_INITIALIZE = + (String)CompatUtils.getFieldValue(null /* receiver */, null /* defaultValue */, CompatUtils.getField(Intent.class, "ACTION_USER_INITIALIZE")); private IntentCompatUtils() { // This utility class is not publicly instantiable. } - public static boolean has_ACTION_USER_INITIALIZE(final Intent intent) { - return ACTION_USER_INITIALIZE != null && intent != null - && ACTION_USER_INITIALIZE.equals(intent.getAction()); + public static boolean is_ACTION_USER_INITIALIZE(final String action) { + return ACTION_USER_INITIALIZE != null && ACTION_USER_INITIALIZE.equals(action); } } diff --git a/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java b/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java index 6a7cd9b6f..604ebeeb6 100644 --- a/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java +++ b/java/src/com/android/inputmethod/latin/setup/LauncherIconVisibilityManager.java @@ -91,7 +91,7 @@ public final class LauncherIconVisibilityManager extends BroadcastReceiver { } else if (Intent.ACTION_BOOT_COMPLETED.equals(action)) { Log.i(TAG, "Boot has been completed"); return true; - } else if (IntentCompatUtils.has_ACTION_USER_INITIALIZE(intent)) { + } else if (IntentCompatUtils.is_ACTION_USER_INITIALIZE(action)) { Log.i(TAG, "User initialize"); return true; }