OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.device.vibration; | 5 package org.chromium.device.vibration; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.pm.PackageManager; | 8 import android.content.pm.PackageManager; |
9 import android.media.AudioManager; | 9 import android.media.AudioManager; |
10 import android.os.Vibrator; | 10 import android.os.Vibrator; |
11 import android.util.Log; | 11 import android.util.Log; |
12 | 12 |
13 import org.chromium.base.VisibleForTesting; | 13 import org.chromium.base.VisibleForTesting; |
14 import org.chromium.device.VibrationManager; | 14 import org.chromium.device.VibrationManager; |
15 import org.chromium.mojo.system.MojoException; | 15 import org.chromium.mojo.system.MojoException; |
16 import org.chromium.services.shell.InterfaceFactory; | 16 import org.chromium.services.service_manager.InterfaceFactory; |
17 | 17 |
18 /** | 18 /** |
19 * Android implementation of the vibration manager service defined in | 19 * Android implementation of the vibration manager service defined in |
20 * device/vibration/vibration_manager.mojom. | 20 * device/vibration/vibration_manager.mojom. |
21 */ | 21 */ |
22 public class VibrationManagerImpl implements VibrationManager { | 22 public class VibrationManagerImpl implements VibrationManager { |
23 private static final String TAG = "VibrationManagerImpl"; | 23 private static final String TAG = "VibrationManagerImpl"; |
24 | 24 |
25 private static final long MINIMUM_VIBRATION_DURATION_MS = 1; // 1 millisecon
d | 25 private static final long MINIMUM_VIBRATION_DURATION_MS = 1; // 1 millisecon
d |
26 private static final long MAXIMUM_VIBRATION_DURATION_MS = 10000; // 10 secon
ds | 26 private static final long MAXIMUM_VIBRATION_DURATION_MS = 10000; // 10 secon
ds |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 public Factory(Context context) { | 101 public Factory(Context context) { |
102 mContext = context; | 102 mContext = context; |
103 } | 103 } |
104 | 104 |
105 @Override | 105 @Override |
106 public VibrationManager createImpl() { | 106 public VibrationManager createImpl() { |
107 return new VibrationManagerImpl(mContext); | 107 return new VibrationManagerImpl(mContext); |
108 } | 108 } |
109 } | 109 } |
110 } | 110 } |
OLD | NEW |