2015-07-07 14:25:41 -07:00
|
|
|
package org.thoughtcrime.securesms.util;
|
|
|
|
|
|
|
|
import android.app.Activity;
|
2017-11-27 12:18:14 -08:00
|
|
|
import android.app.AlarmManager;
|
2015-09-29 13:14:22 -07:00
|
|
|
import android.app.NotificationManager;
|
2015-07-07 14:25:41 -07:00
|
|
|
import android.content.Context;
|
2015-11-04 10:42:19 -08:00
|
|
|
import android.media.AudioManager;
|
2015-08-24 15:24:31 -07:00
|
|
|
import android.net.ConnectivityManager;
|
2017-03-26 16:55:43 +02:00
|
|
|
import android.os.PowerManager;
|
2017-12-05 11:52:03 -08:00
|
|
|
import android.os.Vibrator;
|
2015-10-28 10:24:55 -07:00
|
|
|
import android.telephony.TelephonyManager;
|
2015-07-07 14:25:41 -07:00
|
|
|
import android.view.WindowManager;
|
|
|
|
import android.view.inputmethod.InputMethodManager;
|
|
|
|
|
|
|
|
public class ServiceUtil {
|
|
|
|
public static InputMethodManager getInputMethodManager(Context context) {
|
|
|
|
return (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static WindowManager getWindowManager(Context context) {
|
|
|
|
return (WindowManager) context.getSystemService(Activity.WINDOW_SERVICE);
|
|
|
|
}
|
2015-08-24 15:24:31 -07:00
|
|
|
|
|
|
|
public static ConnectivityManager getConnectivityManager(Context context) {
|
|
|
|
return (ConnectivityManager) context.getSystemService(Activity.CONNECTIVITY_SERVICE);
|
|
|
|
}
|
2015-09-29 13:14:22 -07:00
|
|
|
|
|
|
|
public static NotificationManager getNotificationManager(Context context) {
|
|
|
|
return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
|
|
|
}
|
2015-10-28 10:24:55 -07:00
|
|
|
|
|
|
|
public static TelephonyManager getTelephonyManager(Context context) {
|
|
|
|
return (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
|
|
|
|
}
|
2015-11-04 10:42:19 -08:00
|
|
|
|
|
|
|
public static AudioManager getAudioManager(Context context) {
|
|
|
|
return (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
|
|
|
|
}
|
2017-03-26 16:55:43 +02:00
|
|
|
|
|
|
|
public static PowerManager getPowerManager(Context context) {
|
|
|
|
return (PowerManager)context.getSystemService(Context.POWER_SERVICE);
|
|
|
|
}
|
2017-11-27 12:18:14 -08:00
|
|
|
|
|
|
|
public static AlarmManager getAlarmManager(Context context) {
|
|
|
|
return (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
|
|
|
|
}
|
2017-12-05 11:52:03 -08:00
|
|
|
|
|
|
|
public static Vibrator getVibrator(Context context) {
|
|
|
|
return (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
|
|
|
|
}
|
2015-07-07 14:25:41 -07:00
|
|
|
}
|