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

Commit 5ae21a32 authored by rachelzhang's avatar rachelzhang
Browse files

Bugfix: voice setting up timer should go to timers view

Bug: 17899446
Change-Id: I7e490561e30c65d7d5a21c7923e30019dfcf8097
parent ed10d65c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -204,7 +204,8 @@ public class HandleApiCalls extends Activity {
            Utils.showInUseNotifications(this);
            Utils.showInUseNotifications(this);
        } else {
        } else {
            startActivity(new Intent(this, DeskClock.class)
            startActivity(new Intent(this, DeskClock.class)
                    .putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.TIMER_TAB_INDEX));
                    .putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.TIMER_TAB_INDEX)
                    .putExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, true));
        }
        }
    }
    }


+15 −2
Original line number Original line Diff line number Diff line
@@ -218,9 +218,22 @@ public class TimerFragment extends DeskClockFragment implements OnSharedPreferen
        boolean goToSetUpView;
        boolean goToSetUpView;
        // Process extras that were sent to the app and were intended for the timer fragment
        // Process extras that were sent to the app and were intended for the timer fragment
        final Intent newIntent = getActivity().getIntent();
        final Intent newIntent = getActivity().getIntent();
        if (newIntent != null && newIntent.getBooleanExtra(
        if (newIntent != null
                TimerFullScreenFragment.GOTO_SETUP_VIEW, false)) {
                && newIntent.getBooleanExtra(TimerFullScreenFragment.GOTO_SETUP_VIEW, false)) {
            goToSetUpView = true;
            goToSetUpView = true;
        } else if (newIntent != null
                && newIntent.getBooleanExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, false)) {
            // We use this extra to identify if a. this activity is launched from api call,
            // and b. this fragment is resumed for the first time. If both are true,
            // we should show the timer view instead of setup view.
            goToSetUpView = false;
            // Show the first timer because that's the newly created one
            highlightPageIndicator(0);
            mViewPager.setCurrentItem(0);

            // Reset the extra to false to ensure when next time the fragment resume,
            // we no longer care if it's from api call or not.
            newIntent.putExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, false);
        } else {
        } else {
            if (mViewState != null) {
            if (mViewState != null) {
                final int currPage = mViewState.getInt(CURR_PAGE);
                final int currPage = mViewState.getInt(CURR_PAGE);
+1 −0
Original line number Original line Diff line number Diff line
@@ -43,6 +43,7 @@ public class Timers {
    public static final String NOTIF_TIMES_UP_SHOW = "notif_times_up_show";
    public static final String NOTIF_TIMES_UP_SHOW = "notif_times_up_show";
    public static final String NOTIF_TIMES_UP_CANCEL = "notif_times_up_cancel";
    public static final String NOTIF_TIMES_UP_CANCEL = "notif_times_up_cancel";
    public static final String FROM_ALERT = "from_alert";
    public static final String FROM_ALERT = "from_alert";
    public static final String FIRST_LAUNCH_FROM_API_CALL = "first_launch_from_api_call";


    public static final String TIMESUP_MODE = "times_up";
    public static final String TIMESUP_MODE = "times_up";