diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/os/Hardware.java | 49 | ||||
-rwxr-xr-x | core/java/android/os/IVibratorService.aidl (renamed from core/java/android/os/IHardwareService.aidl) | 11 | ||||
-rw-r--r-- | core/java/android/os/Vibrator.java | 6 | ||||
-rw-r--r-- | core/jni/Android.mk | 1 | ||||
-rw-r--r-- | core/jni/AndroidRuntime.cpp | 2 | ||||
-rw-r--r-- | core/jni/android_os_Hardware.cpp | 62 |
6 files changed, 4 insertions, 127 deletions
diff --git a/core/java/android/os/Hardware.java b/core/java/android/os/Hardware.java deleted file mode 100644 index efc5617..0000000 --- a/core/java/android/os/Hardware.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.os; - -/** - * {@hide} - */ -public class Hardware -{ - - - /* ******************************************************************************** - * - * - * - * - * - * - * - * - * Don't add anything else to this class. Add it to HardwareService instead. - * - * - * - * - * - * - * - * ********************************************************************************/ - - - public static native boolean getFlashlightEnabled(); - public static native void setFlashlightEnabled(boolean on); - public static native void enableCameraFlash(int milliseconds); -} diff --git a/core/java/android/os/IHardwareService.aidl b/core/java/android/os/IVibratorService.aidl index 34f30a7..c98fb56 100755 --- a/core/java/android/os/IHardwareService.aidl +++ b/core/java/android/os/IVibratorService.aidl @@ -17,19 +17,10 @@ package android.os; /** {@hide} */ -interface IHardwareService +interface IVibratorService { - // Vibrator support void vibrate(long milliseconds, IBinder token); void vibratePattern(in long[] pattern, int repeat, IBinder token); void cancelVibrate(IBinder token); - - // flashlight support - boolean getFlashlightEnabled(); - void setFlashlightEnabled(boolean on); - void enableCameraFlash(int milliseconds); - - // for the phone - void setAttentionLight(boolean on, int color); } diff --git a/core/java/android/os/Vibrator.java b/core/java/android/os/Vibrator.java index 51dcff1..1895cf8 100644 --- a/core/java/android/os/Vibrator.java +++ b/core/java/android/os/Vibrator.java @@ -23,14 +23,14 @@ package android.os; */ public class Vibrator { - IHardwareService mService; + IVibratorService mService; private final Binder mToken = new Binder(); /** @hide */ public Vibrator() { - mService = IHardwareService.Stub.asInterface( - ServiceManager.getService("hardware")); + mService = IVibratorService.Stub.asInterface( + ServiceManager.getService("vibrator")); } /** diff --git a/core/jni/Android.mk b/core/jni/Android.mk index b9042f9..edb0b78 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -54,7 +54,6 @@ LOCAL_SRC_FILES:= \ android_os_SystemClock.cpp \ android_os_SystemProperties.cpp \ android_os_UEventObserver.cpp \ - android_os_Hardware.cpp \ android_net_LocalSocketImpl.cpp \ android_net_NetUtils.cpp \ android_net_wifi_Wifi.cpp \ diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index d069d7d..9f617fb 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -130,7 +130,6 @@ extern int register_android_os_ParcelFileDescriptor(JNIEnv *env); extern int register_android_os_Power(JNIEnv *env); extern int register_android_os_StatFs(JNIEnv *env); extern int register_android_os_SystemProperties(JNIEnv *env); -extern int register_android_os_Hardware(JNIEnv* env); extern int register_android_os_SystemClock(JNIEnv* env); extern int register_android_os_FileObserver(JNIEnv *env); extern int register_android_os_FileUtils(JNIEnv *env); @@ -1166,7 +1165,6 @@ static const RegJNIRec gRegJNI[] = { REG_JNI(register_android_text_KeyCharacterMap), REG_JNI(register_android_os_Process), REG_JNI(register_android_os_Binder), - REG_JNI(register_android_os_Hardware), REG_JNI(register_android_view_Display), REG_JNI(register_android_nio_utils), REG_JNI(register_android_graphics_PixelFormat), diff --git a/core/jni/android_os_Hardware.cpp b/core/jni/android_os_Hardware.cpp deleted file mode 100644 index 8007662..0000000 --- a/core/jni/android_os_Hardware.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2006, The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -#include <hardware_legacy/flashlight.h> -#include <hardware_legacy/power.h> - -#include <nativehelper/jni.h> -#include <android_runtime/AndroidRuntime.h> -#include <nativehelper/JNIHelp.h> - -namespace android { - -static jint -getFlashlightEnabled(JNIEnv *env, jobject clazz) -{ - return get_flashlight_enabled(); -} - -static void -setFlashlightEnabled(JNIEnv *env, jobject clazz, jboolean on) -{ - set_flashlight_enabled(on); -} - -static void -enableCameraFlash(JNIEnv *env, jobject clazz, jint milliseconds) -{ - enable_camera_flash(milliseconds); -} - -// ============================================================================ -/* - * JNI registration. - */ - -static JNINativeMethod g_methods[] = { - /* name, signature, funcPtr */ - { "getFlashlightEnabled", "()Z", (void*)getFlashlightEnabled }, - { "setFlashlightEnabled", "(Z)V", (void*)setFlashlightEnabled }, - { "enableCameraFlash", "(I)V", (void*)enableCameraFlash }, -}; - -int register_android_os_Hardware(JNIEnv* env) -{ - return AndroidRuntime::registerNativeMethods(env, - "android/os/Hardware", g_methods, NELEM(g_methods)); -} - -}; // namespace android |