summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/compat/LauncherActivityInfoCompatVL.java
diff options
context:
space:
mode:
authorKenny Guy <kennyguy@google.com>2014-06-24 10:29:28 +0100
committerKenny Guy <kennyguy@google.com>2014-06-24 11:43:19 +0100
commit7bc272a11b701a32d2ed91277341c382cbd84aeb (patch)
treedd38c26e211acf7988f4cdccdca9f46958b56044 /src/com/android/launcher3/compat/LauncherActivityInfoCompatVL.java
parent01453e855fa87ee19f61223b2b1a6965071ee95a (diff)
downloadandroid_packages_apps_Trebuchet-7bc272a11b701a32d2ed91277341c382cbd84aeb.tar.gz
android_packages_apps_Trebuchet-7bc272a11b701a32d2ed91277341c382cbd84aeb.tar.bz2
android_packages_apps_Trebuchet-7bc272a11b701a32d2ed91277341c382cbd84aeb.zip
Revert Cls stopping now-master running on googlefood
This reverts commits 01453e855fa87ee19f61223b2b1a6965071ee95a. and 242bbe1b72e4978dde8a662d164cd186305e14a7. "Add content description to bagded icons." "Remove reflection now we are building against L" Bug: 15833449 Change-Id: I81a5316f5619a9cd3b6ab9fd03b2ba96657b7f68
Diffstat (limited to 'src/com/android/launcher3/compat/LauncherActivityInfoCompatVL.java')
-rw-r--r--src/com/android/launcher3/compat/LauncherActivityInfoCompatVL.java46
1 files changed, 34 insertions, 12 deletions
diff --git a/src/com/android/launcher3/compat/LauncherActivityInfoCompatVL.java b/src/com/android/launcher3/compat/LauncherActivityInfoCompatVL.java
index b52cf1de2..76125bd6a 100644
--- a/src/com/android/launcher3/compat/LauncherActivityInfoCompatVL.java
+++ b/src/com/android/launcher3/compat/LauncherActivityInfoCompatVL.java
@@ -17,44 +17,66 @@
package com.android.launcher3.compat;
import android.content.ComponentName;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.LauncherActivityInfo;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
public class LauncherActivityInfoCompatVL extends LauncherActivityInfoCompat {
- private LauncherActivityInfo mLauncherActivityInfo;
+ private Object mLauncherActivityInfo;
+ private Class mLauncherActivityInfoClass;
+ private Method mGetComponentName;
+ private Method mGetUser;
+ private Method mGetLabel;
+ private Method mGetIcon;
+ private Method mGetApplicationFlags;
+ private Method mGetFirstInstallTime;
+ private Method mGetBadgedIcon;
- LauncherActivityInfoCompatVL(LauncherActivityInfo launcherActivityInfo) {
+ LauncherActivityInfoCompatVL(Object launcherActivityInfo) {
super();
mLauncherActivityInfo = launcherActivityInfo;
+ mLauncherActivityInfoClass = ReflectUtils.getClassForName(
+ "android.content.pm.LauncherActivityInfo");
+ mGetComponentName = ReflectUtils.getMethod(mLauncherActivityInfoClass, "getComponentName");
+ mGetUser = ReflectUtils.getMethod(mLauncherActivityInfoClass, "getUser");
+ mGetLabel = ReflectUtils.getMethod(mLauncherActivityInfoClass, "getLabel");
+ mGetIcon = ReflectUtils.getMethod(mLauncherActivityInfoClass, "getIcon", int.class);
+ mGetApplicationFlags = ReflectUtils.getMethod(mLauncherActivityInfoClass,
+ "getApplicationFlags");
+ mGetFirstInstallTime = ReflectUtils.getMethod(mLauncherActivityInfoClass,
+ "getFirstInstallTime");
+ mGetBadgedIcon = ReflectUtils.getMethod(mLauncherActivityInfoClass, "getBadgedIcon",
+ int.class);
}
public ComponentName getComponentName() {
- return mLauncherActivityInfo.getComponentName();
+ return (ComponentName) ReflectUtils.invokeMethod(mLauncherActivityInfo, mGetComponentName);
}
public UserHandleCompat getUser() {
- return UserHandleCompat.fromUser(mLauncherActivityInfo.getUser());
+ return UserHandleCompat.fromUser((UserHandle) ReflectUtils.invokeMethod(
+ mLauncherActivityInfo, mGetUser));
}
public CharSequence getLabel() {
- return mLauncherActivityInfo.getLabel();
+ return (CharSequence) ReflectUtils.invokeMethod(mLauncherActivityInfo, mGetLabel);
}
public Drawable getIcon(int density) {
- return mLauncherActivityInfo.getIcon(density);
+ return (Drawable) ReflectUtils.invokeMethod(mLauncherActivityInfo, mGetIcon, density);
}
- public ApplicationInfo getApplicationInfo() {
- return mLauncherActivityInfo.getApplicationInfo();
+ public int getApplicationFlags() {
+ return (Integer) ReflectUtils.invokeMethod(mLauncherActivityInfo, mGetApplicationFlags);
}
public long getFirstInstallTime() {
- return mLauncherActivityInfo.getFirstInstallTime();
+ return (Long) ReflectUtils.invokeMethod(mLauncherActivityInfo, mGetFirstInstallTime);
}
public Drawable getBadgedIcon(int density) {
- return mLauncherActivityInfo.getBadgedIcon(density);
+ return (Drawable) ReflectUtils.invokeMethod(mLauncherActivityInfo, mGetBadgedIcon, density);
}
}