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

Commit 2b40635f authored by Daniel Huang's avatar Daniel Huang Committed by Android (Google) Code Review
Browse files

Merge "Use EXTRA_ENTRYPOINT to log entry point for metrics" into udc-qpr-dev

parents 1806b303 f76c528e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.settings.inputmethod;

import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
@@ -53,8 +54,7 @@ public class KeyboardSettingsPreferenceController extends BasePreferenceControll
            if (mCachedDevice.getAddress().equals(hardKeyboardDeviceInfo.mBluetoothAddress)) {
                Intent intent = new Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS);
                intent.putExtra(
                        NewKeyboardSettingsUtils.EXTRA_INTENT_FROM,
                        "com.android.settings.inputmethod.KeyboardSettingsPreferenceController");
                        Settings.EXTRA_ENTRYPOINT, SettingsEnums.CONNECTED_DEVICES_SETTINGS);
                intent.putExtra(
                        Settings.EXTRA_INPUT_DEVICE_IDENTIFIER,
                        hardKeyboardDeviceInfo.mDeviceIdentifier);
+0 −6
Original line number Diff line number Diff line
@@ -33,12 +33,6 @@ import java.util.List;
 */
public class NewKeyboardSettingsUtils {

    /**
     * Record the class name of the intent sender for metrics.
     */
    public static final String EXTRA_INTENT_FROM =
            "com.android.settings.inputmethod.EXTRA_INTENT_FROM";

    static final String EXTRA_TITLE = "keyboard_layout_picker_title";
    static final String EXTRA_USER_ID = "user_id";
    static final String EXTRA_INPUT_DEVICE_IDENTIFIER = "input_device_identifier";
+3 −3
Original line number Diff line number Diff line
@@ -123,9 +123,9 @@ public final class PhysicalKeyboardFragment extends SettingsPreferenceFragment
        }
        InputDeviceIdentifier inputDeviceIdentifier = activity.getIntent().getParcelableExtra(
                KeyboardLayoutPickerFragment.EXTRA_INPUT_DEVICE_IDENTIFIER);
        String intentFromWhere =
                activity.getIntent().getStringExtra(NewKeyboardSettingsUtils.EXTRA_INTENT_FROM);
        if (intentFromWhere != null) {
        int intentFromWhere =
                activity.getIntent().getIntExtra(android.provider.Settings.EXTRA_ENTRYPOINT, -1);
        if (intentFromWhere != -1) {
            mMetricsFeatureProvider.action(
                    getContext(), SettingsEnums.ACTION_OPEN_PK_SETTINGS_FROM, intentFromWhere);
        }
+2 −3
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.settings.inputmethod;

import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.hardware.input.InputManager;
@@ -66,9 +67,7 @@ public class PhysicalKeyboardPreferenceController extends AbstractPreferenceCont
            return false;
        }
        Intent intent = new Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS);
        intent.putExtra(
                NewKeyboardSettingsUtils.EXTRA_INTENT_FROM,
                "com.android.settings.inputmethod.PhysicalKeyboardPreferenceController");
        intent.putExtra(Settings.EXTRA_ENTRYPOINT, SettingsEnums.KEYBOARD_SETTINGS);
        mContext.startActivity(intent);
        return true;
    }