Utils.sendMessage(toNonNull(context), toNonNull(replyTo), cannot_connect_to_host_on_port, hostname, Integer.valueOf(port));
return null;
}
- Utils.sendMessage(toNonNull(context), toNonNull(replyTo), photo_sent);
+ Utils.sendConfirmMessage(toNonNull(context), toNonNull(replyTo), photo_sent);
return null;
}
}
//ignored
}
}
- Utils.sendMessage(context, replyTo, file_sent);
+ Utils.sendConfirmMessage(context, replyTo, file_sent);
}
}
//ignored
}
}
- Utils.sendMessage(context, replyTo, file_received);
+ Utils.sendConfirmMessage(context, replyTo, file_received);
}
}
return;
camera.stopPreview();
stopCamera();
- Utils.sendMessage(toNonNull(context), toNonNull(replyTo), sending_photo);
+ Utils.sendConfirmMessage(toNonNull(context), toNonNull(replyTo), sending_photo);
new SendDataAsyncTask(toNonNull(context), toNonNull(replyTo), toNonNull(hostname), port, data).execute();
}
}
}
if(exitCode == 0 && new File(filename).exists())
- Utils.sendMessage(toNonNull(context), toNonNull(replyTo), screencap_successful);
+ Utils.sendConfirmMessage(toNonNull(context), toNonNull(replyTo), screencap_successful);
else
Utils.sendMessage(toNonNull(context), toNonNull(replyTo), screencap_failed);
}
man.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
savedRingVolume=man.getStreamVolume(AudioManager.STREAM_RING);
man.setStreamVolume(AudioManager.STREAM_RING, man.getStreamMaxVolume(AudioManager.STREAM_RING), 0);
- Utils.sendMessage(context, replyTo, ringing);
+ Utils.sendConfirmMessage(context, replyTo, ringing);
ringtone.play();
}
private static void stopAlarm(final Context context, final Address replyTo){
Utils.unregisterOngoing(context, toNonNull(OngoingEvent.RING));
final AudioManager man=(AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
- Utils.sendMessage(context, replyTo, no_longer_ringing);
+ Utils.sendConfirmMessage(context, replyTo, no_longer_ringing);
ringtone.stop();
man.setStreamVolume(AudioManager.STREAM_RING, savedRingVolume, 0);
man.setRingerMode(savedRingerMode);
if(on) {
adapter.enable();
- Utils.sendMessage(context, replyTo, enabling_bluetooth);
+ Utils.sendConfirmMessage(context, replyTo, enabling_bluetooth);
}
else {
adapter.disable();
- Utils.sendMessage(context, replyTo, disabling_bluetooth);
+ Utils.sendConfirmMessage(context, replyTo, disabling_bluetooth);
}
}
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
final String name=Utils.callerId(context, nr);
if(name==null)
- Utils.sendMessage(context, replyTo, dialing, nr);
+ Utils.sendConfirmMessage(context, replyTo, dialing, nr);
else
- Utils.sendMessage(context, replyTo, dialing, nr+" ("+name+")");
+ Utils.sendConfirmMessage(context, replyTo, dialing, nr+" ("+name+")");
context.startActivity(intent);
}
Intent.FLAG_ACTIVITY_NEW_TASK|
Intent.FLAG_ACTIVITY_NO_USER_ACTION|
Intent.FLAG_FROM_BACKGROUND);
- Utils.sendMessage(context, toNonNull(replyTo), showing_dialog);
+ Utils.sendConfirmMessage(context, toNonNull(replyTo), showing_dialog);
context.startActivity(intent);
}
Utils.sendMessage(context, replyTo, last_known_location);
locationListener.onLocationChanged(lastKnownLocation);
}
- Utils.sendMessage(context, replyTo, listening_for_location_updates);
+ Utils.sendConfirmMessage(context, replyTo, listening_for_location_updates);
man.requestLocationUpdates(provider, minTime, minDistance, locationListener);
}
public static void lock(final Context context, final Address replyTo) {
final DevicePolicyManager dpm=(DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
dpm.lockNow();
- Utils.sendMessage(context, replyTo, device_locked);
+ Utils.sendConfirmMessage(context, replyTo, device_locked);
}
/**
final Intent intent=new Intent("com.android.music.musicservicecommand");
intent.putExtra("command", command);
context.sendBroadcast(intent);
- Utils.sendMessage(context, replyTo, command_sent);
+ Utils.sendConfirmMessage(context, replyTo, command_sent);
}
/**
final LocationManager man=(LocationManager) context.getApplicationContext().getSystemService(Context.LOCATION_SERVICE);
man.removeUpdates(locationListener);
locationListener=null;
- Utils.sendMessage(context, replyTo, no_longer_listening_for_location_updates);
+ Utils.sendConfirmMessage(context, replyTo, no_longer_listening_for_location_updates);
}
/**
*/
public static void rm(final Context context, final Address replyTo, final String filename){
if(new File(filename).delete())
- Utils.sendMessage(context, replyTo, file_deleted);
+ Utils.sendConfirmMessage(context, replyTo, file_deleted);
else
Utils.sendMessage(context, replyTo, error_while_deleting_file);
}
final DevicePolicyManager dpm=(DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
dpm.resetPassword("", 0);
- Utils.sendMessage(context, replyTo, password_cleared);
+ Utils.sendConfirmMessage(context, replyTo, password_cleared);
}
/**
final DevicePolicyManager dpm=(DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
dpm.resetPassword(password, 0);
- Utils.sendMessage(context, replyTo, password_set);
+ Utils.sendConfirmMessage(context, replyTo, password_set);
}
/**
final SmsManager manager=SmsManager.getDefault();
final ArrayList<String> messages=manager.divideMessage(text);
if(messages.size() > 1)
- Utils.sendMessage(context, replyTo, message_was_split_into_parts, Integer.valueOf(messages.size()));
+ Utils.sendConfirmMessage(context, replyTo, message_was_split_into_parts, Integer.valueOf(messages.size()));
final ArrayList<PendingIntent> sents=new ArrayList<PendingIntent>(messages.size());
final ArrayList<PendingIntent> delivereds=new ArrayList<PendingIntent>(messages.size());
@Override
public void onInit(final int status) {
if(status==TextToSpeech.SUCCESS){
- Utils.sendMessage(context, replyTo, speaking);
+ Utils.sendConfirmMessage(context, replyTo, speaking);
tts.speak(text, TextToSpeech.QUEUE_ADD, null);
} else
Utils.sendMessage(context, replyTo, tts_engine_not_available);
*/
public static void toast(final Context context, final Address replyTo, final String text, final int duration){
Toast.makeText(context,text,duration).show();
- Utils.sendMessage(context, replyTo, toast_shown);
+ Utils.sendConfirmMessage(context, replyTo, toast_shown);
}
/**
*/
public static void vibrate(final Context context, final Address replyTo, final long ms){
final Vibrator v=(Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
- Utils.sendMessage(context, replyTo, vibrating);
+ Utils.sendConfirmMessage(context, replyTo, vibrating);
v.vibrate(ms);
}
intent.setData(uri);
intent.setFlags(Intent.FLAG_FROM_BACKGROUND|Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
- Utils.sendMessage(context, replyTo, url_opened);
+ Utils.sendConfirmMessage(context, replyTo, url_opened);
} catch(ActivityNotFoundException e){
Utils.sendMessage(context, replyTo, no_activity_found_for_this_url);
} catch(Exception e){
final WifiManager man=(WifiManager) context.getSystemService(Context.WIFI_SERVICE);
man.setWifiEnabled(on);
if(on)
- Utils.sendMessage(context, replyTo, enabling_wifi);
+ Utils.sendConfirmMessage(context, replyTo, enabling_wifi);
else
- Utils.sendMessage(context, replyTo, disabling_wifi);
+ Utils.sendConfirmMessage(context, replyTo, disabling_wifi);
}
/**
public static void disable(final Context context, final Address replyTo, final Command command){
PreferenceManager.getDefaultSharedPreferences(context).edit()
.putBoolean(command+"disabled", true).commit();
- Utils.sendMessage(context, replyTo, command_disabled, command);
+ Utils.sendConfirmMessage(context, replyTo, command_disabled, command);
}
/**
public static void enable(final Context context, final Address replyTo, final Command command){
PreferenceManager.getDefaultSharedPreferences(context).edit()
.remove(command+"disabled").commit();
- Utils.sendMessage(context, replyTo, command_enabled, command);
+ Utils.sendConfirmMessage(context, replyTo, command_enabled, command);
}
* @param replyTo reply Address
*/
public static void poll(final Context context, final Address replyTo) {
- Utils.sendMessage(context, replyTo, starting_long_polling_if_stopped);
+ Utils.sendConfirmMessage(context, replyTo, starting_long_polling_if_stopped);
context.startService(new Intent(context, FonBotMainService.class));
}
return;
}
context.startActivity(intent);
- Utils.sendMessage(context, replyTo, app_launched);
+ Utils.sendConfirmMessage(context, replyTo, app_launched);
}
/**
try{
if(enable){
getITelephony(context).enableDataConnectivity();
- Utils.sendMessage(context, replyTo, enabling_data);
+ Utils.sendConfirmMessage(context, replyTo, enabling_data);
} else {
getITelephony(context).disableDataConnectivity();
- Utils.sendMessage(context, replyTo, disabling_data);
+ Utils.sendConfirmMessage(context, replyTo, disabling_data);
}
} catch(Exception e){
Utils.sendMessage(context, replyTo, exception_while_getting_itelephony,
public static void gps(final Context context, final Address replyTo, final boolean enabled) {
Secure.setLocationProviderEnabled(context.getContentResolver(), LocationManager.GPS_PROVIDER, enabled);
if(enabled)
- Utils.sendMessage(context, replyTo, enabling_gps);
+ Utils.sendConfirmMessage(context, replyTo, enabling_gps);
else
- Utils.sendMessage(context, replyTo, disabling_gps);
+ Utils.sendConfirmMessage(context, replyTo, disabling_gps);
}
/**
public static void glocation(final Context context, final Address replyTo, final boolean enabled) {
Secure.setLocationProviderEnabled(context.getContentResolver(), LocationManager.NETWORK_PROVIDER, enabled);
if(enabled)
- Utils.sendMessage(context, replyTo, enabling_network_location);
+ Utils.sendConfirmMessage(context, replyTo, enabling_network_location);
else
- Utils.sendMessage(context, replyTo, disabling_network_location);
+ Utils.sendConfirmMessage(context, replyTo, disabling_network_location);
}
/**
*/
public static void reboot(final Context context, final Address replyTo, final @Nullable String reason) {
final PowerManager pm=(PowerManager) context.getSystemService(Context.POWER_SERVICE);
- Utils.sendMessage(context, replyTo, rebooting);
+ Utils.sendConfirmMessage(context, replyTo, rebooting);
try {
pm.reboot(reason);
} catch (final Exception e){
public static void notify(final Context context, final Address replyTo, final int id) {
final NotificationManager man=(NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
man.cancel(id);
- Utils.sendMessage(context, replyTo, notification_canceled);
+ Utils.sendConfirmMessage(context, replyTo, notification_canceled);
}
/**
setContentText(text).
setSmallIcon(android.R.drawable.stat_notify_sync_noanim).
build());
- Utils.sendMessage(context, replyTo, notification_shown);
+ Utils.sendConfirmMessage(context, replyTo, notification_shown);
}
/**
*/
public static void torch(final Context context, final Address replyTo){
context.sendBroadcast(new Intent("net.cactii.flash2.TOGGLE_FLASHLIGHT"));
- Utils.sendMessage(context, replyTo, toggling_torch_state);
+ Utils.sendConfirmMessage(context, replyTo, toggling_torch_state);
}
/**