Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f4d783b authored by Sean Stout's avatar Sean Stout Committed by Android (Google) Code Review
Browse files

Merge "Adding support for showing timers" into ub-deskclock-gatling

parents ba27a4de 420539df
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -109,6 +109,12 @@
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SHOW_TIMERS" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.VOICE" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.DISMISS_ALARM" />

+16 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ public class HandleApiCalls extends Activity {

    private Context mAppContext;

    public static final String ACTION_SHOW_TIMERS = "android.intent.action.SHOW_TIMERS";

    @Override
    protected void onCreate(Bundle icicle) {
        try {
@@ -83,6 +85,9 @@ public class HandleApiCalls extends Activity {
                case AlarmClock.ACTION_SET_TIMER:
                    handleSetTimer(intent);
                    break;
                case ACTION_SHOW_TIMERS:
                    handleShowTimers(intent);
                    break;
                case AlarmClock.ACTION_DISMISS_ALARM:
                    handleDismissAlarm(intent);
                    break;
@@ -373,6 +378,17 @@ public class HandleApiCalls extends Activity {
        LogUtils.i("HandleApiCalls show alarms");
    }

    private void handleShowTimers(Intent intent) {
        // Change to the timers tab.
        UiDataModel.getUiDataModel().setSelectedTab(TIMERS);

        // Open DeskClock which is now positioned on the timers tab.
        startActivity(new Intent(this, DeskClock.class));

        Events.sendTimerEvent(R.string.action_show, R.string.label_intent);
        LogUtils.i("HandleApiCalls show timers");
    }

    private void handleSetTimer(Intent intent) {
        // If no length is supplied, show the timer setup view.
        if (!intent.hasExtra(AlarmClock.EXTRA_LENGTH)) {