@Override public boolean beforeCall(Object who, Method method, Object... args) { List<ShortcutInfo> shortcutList = findFirstShortcutList(args); if (shortcutList != null) { String hostPkg = getHostPkg(); for (ShortcutInfo shortcutInfo : shortcutList) { replaceShortcutInfo(shortcutInfo, hostPkg, getPM()); } } return super.beforeCall(who, method, args); }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public boolean beforeCall(Object who, Method method, Object... args) { ShortcutInfo shortcutInfo = findFirstShortcutInfo(args); replaceShortcutInfo(shortcutInfo, getHostPkg(), getPM()); return super.beforeCall(who, method, args); }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("getManifestShortcuts")); // TODO: 18/3/3 Support dynamic shortcut ? addMethodProxy(new ReplaceCallingPkgMethodProxy("getDynamicShortcuts")); addMethodProxy(new ReplacePkgAndShortcutListMethodProxy("setDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("addDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("createShortcutResultIntent")); addMethodProxy(new ReplaceCallingPkgMethodProxy("disableShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("enableShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getRemainingCallCount")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getRateLimitResetTime")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getIconMaxDimensions")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getMaxShortcutCountPerActivity")); addMethodProxy(new ReplaceCallingPkgMethodProxy("reportShortcutUsed")); addMethodProxy(new ReplaceCallingPkgMethodProxy("onApplicationActive")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getPinnedShortcuts")); addMethodProxy(new ReplacePkgAndShortcutMethodProxy("requestPinShortcut")); }
addInjector(new ShortcutServiceStub()); addInjector(new DevicePolicyManagerStub());
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("getManifestShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("setDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("addDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("createShortcutResultIntent")); addMethodProxy(new ReplaceCallingPkgMethodProxy("disableShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("enableShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getRemainingCallCount")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getRateLimitResetTime")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getIconMaxDimensions")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getMaxShortcutCountPerActivity")); addMethodProxy(new ReplaceCallingPkgMethodProxy("reportShortcutUsed")); addMethodProxy(new ReplaceCallingPkgMethodProxy("onApplicationActive")); } }
@Override protected void onBindMethods() { super.onBindMethods(); addMethodProxy(new ReplaceCallingPkgMethodProxy("getManifestShortcuts")); // TODO: 18/3/3 Support dynamic shortcut ? addMethodProxy(new ReplaceCallingPkgMethodProxy("getDynamicShortcuts")); addMethodProxy(new ReplacePkgAndShortcutListMethodProxy("setDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("addDynamicShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("createShortcutResultIntent")); addMethodProxy(new ReplaceCallingPkgMethodProxy("disableShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("enableShortcuts")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getRemainingCallCount")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getRateLimitResetTime")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getIconMaxDimensions")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getMaxShortcutCountPerActivity")); addMethodProxy(new ReplaceCallingPkgMethodProxy("reportShortcutUsed")); addMethodProxy(new ReplaceCallingPkgMethodProxy("onApplicationActive")); addMethodProxy(new ReplaceCallingPkgMethodProxy("getPinnedShortcuts")); addMethodProxy(new ReplacePkgAndShortcutMethodProxy("requestPinShortcut")); }
@Override public boolean beforeCall(Object who, Method method, Object... args) { List<ShortcutInfo> shortcutList = findFirstShortcutList(args); if (shortcutList != null) { String hostPkg = getHostPkg(); for (ShortcutInfo shortcutInfo : shortcutList) { replaceShortcutInfo(shortcutInfo, hostPkg, getPM()); } } return super.beforeCall(who, method, args); }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public boolean beforeCall(Object who, Method method, Object... args) { ShortcutInfo shortcutInfo = findFirstShortcutInfo(args); replaceShortcutInfo(shortcutInfo, getHostPkg(), getPM()); return super.beforeCall(who, method, args); }
addInjector(new ShortcutServiceStub()); addInjector(new DevicePolicyManagerStub());
addInjector(new ShortcutServiceStub()); addInjector(new DevicePolicyManagerStub());