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

Commit 38149402 authored by Aleksandr Litovchenko's avatar Aleksandr Litovchenko
Browse files

Upstream Wear Keyguard changes

1. KeyguardService#dismissKeyguardToLaunch. It will be called if watch is keyguarded and user does button presses to launch Pay or Assistant. Applied only for watches.
2. KeyguardService#onSystemKeyPressed. Passes stem button press to keyguard.
3. Launch android.intent.action.VOICE_ASSIST_RETAIL for retail assistant button press.
4. Allow ACTION_VOICE_ASSIST to be disabled at runtime.

Bug: 204870856
Tests: manual
Change-Id: Ibc7fd2d57d0f01bdfca4ea3054fb833fb01b5471
(cherry picked from commit 848b4576561120c875430f4fd38806142a08a115)
parent b805e0fa
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -17039,6 +17039,15 @@ public final class Settings {
             */
            public static final String CLOCKWORK_SYSUI_MAIN_ACTIVITY =
                    "clockwork_sysui_main_activity";
            /**
             * Setting to disable power button long press launching Assistant. It's boolean, i.e.
             * enabled = 1, disabled = 0. By default, this setting is enabled.
             *
             * @hide
             */
            public static final String CLOCKWORK_LONG_PRESS_TO_ASSISTANT_ENABLED =
                    "clockwork_long_press_to_assistant_enabled";
        }
    }
+15 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.internal.policy;

import android.content.Intent;
import com.android.internal.policy.IKeyguardDrawnCallback;
import com.android.internal.policy.IKeyguardDismissCallback;
import com.android.internal.policy.IKeyguardStateCallback;
@@ -113,7 +114,20 @@ oneway interface IKeyguardService {

    /**
     * Notifies the Keyguard that the power key was pressed while locked and launched Home rather
     * than putting the device to sleep or waking up.
     * than putting the device to sleep or waking up. Note that it's called only if the device is
     * interactive.
     */
    void onShortPowerPressedGoHome();

    /**
     * Notifies the Keyguard that it needs to bring up a bouncer and then launch the intent as soon
     * as user unlocks the watch.
     */
    void dismissKeyguardToLaunch(in Intent intentToLaunch);

    /**
     * Notifies the Keyguard that a key was pressed while locked so the Keyguard can handle it.
     * Note that it's called only if the device is interactive.
     */
    void onSystemKeyPressed(int keycode);
}
+1 −0
Original line number Diff line number Diff line
@@ -656,6 +656,7 @@ public class SettingsBackupTest {
                    Settings.Global.Wearable.WRIST_ORIENTATION_MODE,
                    Settings.Global.Wearable.CLOCKWORK_SYSUI_PACKAGE,
                    Settings.Global.Wearable.CLOCKWORK_SYSUI_MAIN_ACTIVITY,
                    Settings.Global.Wearable.CLOCKWORK_LONG_PRESS_TO_ASSISTANT_ENABLED,
                    Settings.Global.Wearable.WEAR_ACTIVITY_AUTO_RESUME_TIMEOUT_SET_BY_USER);

    private static final Set<String> BACKUP_DENY_LIST_SECURE_SETTINGS =
+12 −0
Original line number Diff line number Diff line
@@ -583,6 +583,18 @@ public class KeyguardService extends Service {
            checkPermission();
            mKeyguardViewMediator.onShortPowerPressedGoHome();
        }

        @Override
        public void dismissKeyguardToLaunch(Intent intentToLaunch) {
            checkPermission();
            mKeyguardViewMediator.dismissKeyguardToLaunch(intentToLaunch);
        }

        @Override
        public void onSystemKeyPressed(int keycode) {
            checkPermission();
            mKeyguardViewMediator.onSystemKeyPressed(keycode);
        }
    };
}
+8 −0
Original line number Diff line number Diff line
@@ -2746,6 +2746,14 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
        // do nothing
    }

    public void dismissKeyguardToLaunch(Intent intentToLaunch) {
        // do nothing
    }

    public void onSystemKeyPressed(int keycode) {
        // do nothing
    }

    public ViewMediatorCallback getViewMediatorCallback() {
        return mViewMediatorCallback;
    }
Loading