Code example for Context

Methods: getSystemServiceregisterReceiver

0
                    < (SystemClock.uptimeMillis() + millis)) {
                // If this vibration will end before the time passed in, let 
                // the new vibration play. 
                return false; 
            } 
            return true; 
        } 
    } 
 
    VibratorService(Context context) {
        // Reset the hardware to a default state, in case this is a runtime 
        // restart instead of a fresh boot. 
        vibratorOff(); 
 
        mContext = context;
        PowerManager pm = (PowerManager)context.getSystemService(
                Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "*vibrator*");
        mWakeLock.setReferenceCounted(true);
 
        mAppOpsService = IAppOpsService.Stub.asInterface(ServiceManager.getService(Context.APP_OPS_SERVICE));