am 30348b0d: Merge change I086d681f into eclair-mr2

Merge commit '30348b0de11b6c6cba43dfc7960e4d2084af6d8b' into eclair-mr2-plus-aosp

* commit '30348b0de11b6c6cba43dfc7960e4d2084af6d8b':
  Remove HardwareService and move vibrator support to VibratorService.
This commit is contained in:
Mike Lockwood
2009-11-25 11:54:18 -08:00
committed by Android Git Automerger
18 changed files with 288 additions and 403 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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"));
}
/**