Simplify Zen mode voice activity.

Zen mode voice activity now only sets the notification mode to alarms mode
or off. A duration may be specified if it was in the original intent.

Change-Id: Ica472ca9c6dcbce473832f4f922baf225df4951b
Bug: 21024455
This commit is contained in:
Barnaby James
2015-05-10 16:24:05 -07:00
parent 69a03f7517
commit 0474b723e1
10 changed files with 31 additions and 634 deletions

View File

@@ -16,8 +16,6 @@
package com.android.settings.utils;
import com.android.settings.R;
import android.app.Activity;
import android.app.Fragment;
import android.app.VoiceInteractor;
@@ -27,7 +25,6 @@ import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import android.util.Log;
/**
@@ -67,45 +64,17 @@ abstract public class VoiceSettingsActivity extends Activity {
* not null, then it will be read to the user.
*/
protected void notifySuccess(CharSequence prompt) {
if (prompt != null) {
Toast.makeText(this, prompt, Toast.LENGTH_LONG).show();
}
if (getVoiceInteractor() != null) {
getVoiceInteractor().submitRequest(new CompleteVoiceRequest(prompt, null));
}
}
protected void setHeader(String label) {
TextView header = (TextView) findViewById(R.id.voice_fragment_header);
if (header != null) {
if (label != null) {
header.setText(label);
header.setVisibility(View.VISIBLE);
} else {
header.setVisibility(View.GONE);
}
}
}
/**
* Indicates when the setting could not be changed.
*/
protected void notifyFailure(CharSequence prompt) {
if (prompt != null) {
Toast.makeText(this, prompt, Toast.LENGTH_LONG).show();
}
if (getVoiceInteractor() != null) {
getVoiceInteractor().submitRequest(new AbortVoiceRequest(prompt, null));
}
}
protected void showFragment(Fragment fragment, String tag) {
getFragmentManager()
.beginTransaction()
.replace(R.id.voice_fragment_root, fragment, tag)
.commit();
}
}