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

Commit 0104d9bb authored by Andrew Lee's avatar Andrew Lee
Browse files

Create call settings intent in DialerSettingsActivity.

- Remove helper method in DialtactsActivity.
+ Create intent in DialerSettingsActivity.

This is the only place the method is called; it seems that this code
to create the intent should live in DialerSettingsActivity instead
of DialtactsActivity.

Bug: 18114923
Change-Id: I129b716c2a247994647c123f1cbd945b7ef36778
parent 076e9841
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -914,13 +914,6 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
        mActionBarController.onSearchUiExited();
    }

    /** Returns an Intent to launch Call Settings screen */
    public static Intent getCallSettingsIntent() {
        final Intent intent = new Intent(TelecomManager.ACTION_SHOW_CALL_SETTINGS);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        return intent;
    }

    @Override
    public void onBackPressed() {
        if (mIsDialpadShown) {
+6 −3
Original line number Diff line number Diff line
@@ -52,17 +52,20 @@ public class DialerSettingsActivity extends AnalyticsPreferenceActivity {
        // Only show call setting menus if the current user is the primary/owner user.
        if (isPrimaryUser()) {
            final TelephonyManager telephonyManager =
                    (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
                    (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
            // Show "Call Settings" if there is one SIM and "Phone Accounts" if there are more.
            if (telephonyManager.getPhoneCount() <= 1) {
                final Header callSettingsHeader = new Header();
                Intent callSettingsIntent = new Intent(TelecomManager.ACTION_SHOW_CALL_SETTINGS);
                callSettingsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

                callSettingsHeader.titleRes = R.string.call_settings_label;
                callSettingsHeader.summaryRes = R.string.call_settings_description;
                callSettingsHeader.intent = DialtactsActivity.getCallSettingsIntent();
                callSettingsHeader.intent = callSettingsIntent;
                target.add(callSettingsHeader);
            } else {
                final Header phoneAccountSettingsHeader = new Header();
                final Intent phoneAccountSettingsIntent =
                Intent phoneAccountSettingsIntent =
                        new Intent(TelecomManager.ACTION_CHANGE_PHONE_ACCOUNTS);
                phoneAccountSettingsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);