From 0007799794824cd4dcfb3d544fbb580402e54c97 Mon Sep 17 00:00:00 2001 From: iris-wy Date: Thu, 28 May 2015 10:47:12 +0800 Subject: [PATCH] modify Enhance API modify Enhance API --- cocos/platform/android/CCEnhanceAPI-android.cpp | 2 +- .../{IGameTunningService.aidl => IGameTuningService.aidl} | 2 +- .../android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java | 8 ++++---- templates/cocos2dx_files.json | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename cocos/platform/android/java/src/com/enhance/gameservice/{IGameTunningService.aidl => IGameTuningService.aidl} (88%) diff --git a/cocos/platform/android/CCEnhanceAPI-android.cpp b/cocos/platform/android/CCEnhanceAPI-android.cpp index 424fc51e4a..29e1122ba4 100644 --- a/cocos/platform/android/CCEnhanceAPI-android.cpp +++ b/cocos/platform/android/CCEnhanceAPI-android.cpp @@ -93,7 +93,7 @@ int EnhanceAPI::setLowPowerMode(bool enable) { JniMethodInfo t; int ret = -1; - if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "fastLoading", "(Z)I")) + if(JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setLowPowerMode", "(Z)I")) { ret = t.env->CallStaticIntMethod(t.classID, t.methodID, enable); } diff --git a/cocos/platform/android/java/src/com/enhance/gameservice/IGameTunningService.aidl b/cocos/platform/android/java/src/com/enhance/gameservice/IGameTuningService.aidl similarity index 88% rename from cocos/platform/android/java/src/com/enhance/gameservice/IGameTunningService.aidl rename to cocos/platform/android/java/src/com/enhance/gameservice/IGameTuningService.aidl index 6bce7eeaff..f584c53d5b 100644 --- a/cocos/platform/android/java/src/com/enhance/gameservice/IGameTunningService.aidl +++ b/cocos/platform/android/java/src/com/enhance/gameservice/IGameTuningService.aidl @@ -1,6 +1,6 @@ package com.enhance.gameservice; -interface IGameTunningService +interface IGameTuningService { int setPreferredResolution(int resolution); int setFramePerSecond(int fps); diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index a9a5923656..44a8dad820 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -49,7 +49,7 @@ import android.view.Display; import android.view.WindowManager; import android.content.ServiceConnection; //Enhance API modification -import com.enhance.gameservice.IGameTunningService; //Enhance API modification +import com.enhance.gameservice.IGameTuningService; //Enhance API modification public class Cocos2dxHelper { // =========================================================== @@ -77,7 +77,7 @@ public class Cocos2dxHelper { private static Cocos2dxHelperListener sCocos2dxHelperListener; private static Set onActivityResultListeners = new LinkedHashSet(); //Enhance API modification begin - private static IGameTunningService mGameServiceBinder = null; + private static IGameTuningService mGameServiceBinder = null; private static final int BOOST_TIME = 7; //Enhance API modification end @@ -118,7 +118,7 @@ public class Cocos2dxHelper { sInited = true; //Enhance API modification begin - activity.getApplicationContext().bindService(new Intent(IGameTunningService.class.getName()), connection, Context.BIND_AUTO_CREATE); + activity.getApplicationContext().bindService(new Intent(IGameTuningService.class.getName()), connection, Context.BIND_AUTO_CREATE); //Enhance API modification end } } @@ -126,7 +126,7 @@ public class Cocos2dxHelper { //Enhance API modification begin private static ServiceConnection connection = new ServiceConnection() { public void onServiceConnected(ComponentName name, IBinder service) { - mGameServiceBinder = IGameTunningService.Stub.asInterface(service); + mGameServiceBinder = IGameTuningService.Stub.asInterface(service); fastLoading(BOOST_TIME); } diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index e0d6a98564..61284e2324 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -858,7 +858,7 @@ "cocos/platform/android/java/lint.xml", "cocos/platform/android/java/proguard-project.txt", "cocos/platform/android/java/project.properties", - "cocos/platform/android/java/src/com/enhance/gameservice/IGameTunningService.aidl", + "cocos/platform/android/java/src/com/enhance/gameservice/IGameTuningService.aidl", "cocos/platform/android/java/src/com/chukong/cocosplay/client/CocosPlayClient.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxAccelerometer.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java", @@ -885,8 +885,8 @@ "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerDelegate.java", "cocos/platform/android/java/src/org/cocos2dx/lib/GameControllerUtils.java", "cocos/platform/android/javaactivity-android.cpp", - "cocos/platform/android/CCEnhanceAPI-android.cpp", - "cocos/platform/android/CCEnhanceAPI-android.h", + "cocos/platform/android/CCEnhanceAPI-android.cpp", + "cocos/platform/android/CCEnhanceAPI-android.h", "cocos/platform/android/jni/CocosPlayClient.cpp", "cocos/platform/android/jni/CocosPlayClient.h", "cocos/platform/android/jni/DPIJni.cpp",