Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for device specific key handlers #33

Open
wants to merge 1,180 commits into
base: thirteen
Choose a base branch
from

Conversation

sherifrahim
Copy link

This is a squash commit of the following changes,
only modified for the new SDK.

Author: Alexander Hofbauer alex@derhofbauer.at
Date: Thu Apr 12 01:24:24 2012 +0200

  Dispatch keys to a device specific key handler

  Injects a device key handler into the input path to handle additional
  keys (as found on some docks with a hardware keyboard).

  Configurable via overlay settings config_deviceKeyHandlerLib and
  config_deviceKeyHandlerClass.

  Change-Id: I6678c89c7530fdb1d4d516ba4f1d2c9e30ce79a4

Author: Jorge Ruesga jorge@ruesga.com
Date: Thu Jan 24 02:34:49 2013 +0100

  DeviceKeyHandle: The device should consume only known keys

  When the device receive the key, only should consume it if the device
  know about the key. Otherwise, the key must be handle by the active app.
  Also make mDeviceKeyHandler private (is not useful outside this class)

  Change-Id: I4b9ea57b802e8c8c88c8b93a63d510f5952b0700
  Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

Author: Danesh Mondegarian daneshm90@gmail.com
Date: Sun Oct 20 00:34:48 2013 -0700

  DeviceKeyHandler : Allow handling keyevents while screen off

  Some devices require the keyevents to be processed while the screen
  is off, this patchset addresses that by moving the filter up in the call
  hierarchy.

  Change-Id: If71beecc81aa5e453dcd08aba72b7bea5c210590

Author: Steve Kondik steve@cyngn.com
Date: Sun Sep 11 00:49:41 2016 -0700

  policy: Use PathClassLoader for loading the keyhandler

   * Fix crash on start due to getCacheDir throwing an exception.
   * We can't do this anymore due to the new storage/crypto in N.

  Change-Id: I28426a5df824460ebc74aa19068192adb00d4f7c

Author: Zhao Wei Liew zhaoweiliew@gmail.com
Date: Sun Nov 20 08:20:15 2016 +0800

  PhoneWindowManager: Support multiple key handlers

  Convert the string overlay to a string-array overlay
  to allow devices to specify an array of key handlers.

  Note that the keyhandlers towards the start of the
  array take precedence when loading.

  Change-Id: Iaaab737f1501a97d7016d8d519ccf127ca059218

Author: Paul Keith javelinanddart@gmail.com
Date: Thu Nov 23 21:47:51 2017 +0100

  fw/b: Return a KeyEvent instead of a boolean in KeyHandler

  * Allows handlers to modify the event before sending it off
    to another KeyHandler class, to handle things like rotation

  Change-Id: I481107e050f6323c5897260a5d241e64b4e031ac

Change-Id: Ie65a89cd7efd645622d99d47699df847bc3ad96b

maxwen and others added 30 commits August 20, 2022 00:02
abc ezio84: use existing lockscreen doubletap gesture listener
and abcutils screenoff action

Change-Id: If8fadba5d75319c734a65d64e5afc9f8c1c77c1f
Change-Id: I844e36469b0e3b0168eecb62f6e8b0e9b2bff40e
From time to time we need to filter out certain features because not every
device is created equal. This makes it easy to call from one place instead
of adding the same code time and time again.

As of right now this class includes checks for

- Fingerprint support
- Fingerprint support & enrollment
- NFC
- WiFi
- Camera
- Bluetooth
- Mobile connection
- Alterative ambient display (OnePlus devices)
- A/B device support

Change-Id: Ia27dc8d49a78c843f2a185f3aef195f17cc090aa
Signed-off-by: Saikiran <bjsaikiran@gmail.com>
Change-Id: Ibadea83b68c012c08e47c3622ba96a37c8ddf1b9
As dumb as this sounds, this is actually useful for a few mods such as
the carrier label and special captive portal for chinese users.

Change-Id: Ida10723ec3a17bad28c9f6c4d4c73ec3e9a9a981
Change-Id: Ie65d8ebe354996ae8d67ac950d635a1169830931
Signed-off-by: Saikiran <bjsaikiran@gmail.com>
code borrowed from com.android.systemui.statusbar.policy.KeyButtonView

Signed-off-by: PainKiller3 <ninadpatil100@gmail.com>
Change-Id: Id0b8addc460afae030eac0a2bf064fb21aa2c4dc
Signed-off-by: Saikiran <bjsaikiran@gmail.com>
…nheit

This one is a weird one because up until a few days ago, I didn't think
I would need. Basically what this does is check the device's MCC and bounce
it off an array of MCC's that belong to countries that use fahrenheit.

- If no MCC is found (whether is a WiFi only tablet or the user has their phone
in airplane mode), the method returns false (Celsius). Celsius is used by 99 %
of all people so is not a bad option.

Inspired by Henrique Silva <jhenrique09.mcz@hotmail.com> and his commit below
https://gerrit.pixelexperience.org/#/c/frameworks_base/+/1606/

We're going to end up using this for two things, our battery temp thingy in
Settings and also for what Henrique used it for, the keyguard weather default.

Change-Id: I49c7a397c794e7852ab0be4bd3182710fa3b19b0
Signed-off-by: Saikiran <bjsaikiran@gmail.com>
Change-Id: I4742eaeea94c4495361bdfe2b855ae0de0aa24c1
Signed-off-by: Arghya Chanda <arghyac35@gmail.com>
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
Some devices with notch have set config_fillMainBuiltInDisplayCutout to false. This results in Utils returning true for hasNotch. Instead let's check if the bounding path of the cutout region is defined. Also return false if NoCutoutOverlay is active.

Change-Id: Ib134312d1c49b8ad8c086a1271cc29f6df020f3c
Signed-off-by: Arghya Chanda <arghyac35@gmail.com>
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
abc: extracted from DUI

Change-Id: I2ac0bf9cf6641a475ea9a3c9b714550bc55ee13b
Signed-off-by: DennySPB <dennyspb@gmail.com>
Signed-off-by: DennySPb <dennyspb@gmail.com>
Signed-off-by: saikiran2001 <bjsaikiran@gmail.com>
HIDL fingerprint implementations have no way of providing this info.

Change-Id: I1eeda59c84868715338b6707247a9c7eecca1af3
* on some shades like peach/pink ,the inactive row is quite identical to the active row's tint on dark mode. We might wight to use a1 shades and modified coloraccentprimary to fix this issue.

Signed-off-by: strwbrry143 <alexfinhart@gmail.com>
The secondary accent in light mode does not have a good contrast
to the previously white icon.

Previously: https://imgur.com/a/XHpDHDJ
Now: https://imgur.com/a/QCk3QwC

Change-Id: Ib61ad4803e0e3c6cc9163408137c7a16742922b6
Co-authored-by: Arian <arian.kulmer@web.de>
Co-authored-by: Akash Srivastava <akashniki@gmail.com>
Change-Id: Icc3444be95a177fb4b6ef77cbf582d696381b9dc
Signed-off-by: NurKeinNeid <mralexman3000@gmail.com>
…ckscreen. It doesn't fit well and makes clock font look distorted.

* These look bad
Change-Id: Ic8819c9b9cf5d1469a47f3d16cd10918285f40f9
Scrolling cache helps make short scrolls/flings smooth but will
cause stutter when long flings are made. This patch disables
scrolling cache when long flings are made.

This patch also fixes a related bug where scrolling cache will
not be enabled properly when transitioning from flinging to scrolling.

Patch Set 2: Calculate threshold based on maximum velocity (Sang Tae Park)

Change-Id: Iad52a35120212c871ffd35df6184aeb678ee44aa
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
when 3rd party app put an extra with a bad serial object
to start a service or sendbroadcast to system_server.
It will cause system_server crash because of
classNotFoundException.

A test demo apk will cause system_server crash.
It really affact the system stability

Intent intent = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
intent.putExtra(Intent.EXTRA_REFERRER, new serial()
/*a Serializable class object*/);
sendBroadcast(intent);

Test: use the test apk attached in the issue below, system_server will
crash every time. And it'll be OK with this CL.

https://code.google.com/p/android/issues/detail?id=261031

Change-Id: Id505571dcbf88c0ba9c1677ec0f1f08688c1bb95
Signed-off-by: yangbingqian <bqyang720@gmail.com>
 * "java.lang.NullPointerException: Attempt to invoke virtual
    method 'void android.os.DropBoxManager.addText(java.lang.String,
    java.lang.String)' on a null object reference"

Change-Id: I418ba99caa4f55b184fabee4ad610ca3e5e7c66f
Signed-off-by: AdrianDC <radian.dc@gmail.com>
These warnings take up significant portion of the entire stderr output
during builds, and aren't important at all.

Silence it so that other more meaningful stderr outputs could be noticed.

Change-Id: If05955a6c392f3d5bfe0a4e2b424da2a08fc2f75
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Change-Id: I5ed66b9ca78f9fb3359cbee5c746ec2e50371970
Signed-off-by: David Viteri <davidteri91@gmail.com>
Myself5 and others added 28 commits October 1, 2022 03:59
* Design based on "PA Battery" entirely rewritten in Kotlin with design adjustments

Co-authored-by: TheStrix <parthbhatia98@gmail.com>
Change-Id: Ic1b74a07d645c0ccedf7015303755f6fe7a3a923
* @ /neobuddy89: Only for hidden and text battery styles.

Change-Id: I27f745e3458fda7c415a75d6e52f183e327cb498
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* It was too far from the right corner of the screen

Change-Id: I993516c74c9a1bb6eac6d4be1e48f40ef47e60e1
Change-Id: Iae3316dd88c69f9f4ccca6a234933a7761ec971d
Avoid unnecessary processing time when the battery icon won't get scaled anyway.

Signed-off-by: spezi77 <spezi7713@gmx.net>
Change-Id: Ib8b9fca0a8cb949b47f30339e6d70dc61d2215aa
@ /neobuddy89:
* Adapt to our setup
* Do not add separate tunable

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Change-Id: Ie44266241caa496e80df84d2413dba44093484ee
* Squashed and forwarded ported from A11.

Author: Pranav Vashi <neobuddy89@gmail.com>
Date:   Sat Mar 26 09:59:36 2022 +0530

    base: Remove QS battery location settings

[palaych: Remove battery estimate switcher]

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: palaych <palaych@arrowos.net>
Change-Id: Ic2202e6c4ca0d076f996d4a4d031cbd202efd1bc
 * Thanks to beanstown106 for the initial longpress action calls in
   PhoneWindowManager (improved by lineage guys)

 * Remove the settings pref if the device doesn't have flashlight

 * Vibrate when toggling torch to let the user know of unwanted toggling
   in the pocket (even if vibration is disabled by user)

 * Allow torch action also on ambient display

[AEX Edits] :
- Port to S
- simplify code

[mydongistiny]:
- Fixed for android10

[DennySPB] :
- base: ScreenOff torch: Allow to disable torch when screen is on

[mickaelmendes50] :
- Adapt to AOSPA

 * We don't allow users to use the Double Press power option,
   so remove the non used code.
 * Removed "double press power to toggle torch"
 * Removed "handle camera gesture here instead of extensions"
 * Removed "Add 170ms delay for double tap action"

[ghostrider-reborn: updated for 13]

Change-Id: I12da044f86c7b625872607529cf8524615cf576b
Co-authored-by: DennySPb <dennyspb@gmail.com>
Co-authored-by: Mesquita <mesquita@aospa.co>
Signed-off-by: Adin Kwok <adin.kwok@carbonrom.org>
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: Arghya Chanda <arghyac35@gmail.com>
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Port over linked volumes from 12.1

Implement linked volumes and add upgrade path.

Change-Id: Ibbeff656fcaaa4a2ff79de530b48b216df271b21

frameworks: read VOLUME_LINK_NOTIFICATION from proper table

Change-Id: I15e9caa18f307a51a732c7a59013bbbb234a7477
Signed-off-by: Roman Birg <roman@cyngn.com>
(cherry picked from commit 1b7cfa1716017e0d03c9693428c21d8e11c5dc0a)

fix Notification volume slider linking

Change-Id: I0f74485f5c8c2aa7698cf9ba1c60c2c8c967798d
Signed-off-by: Roman Birg <roman@cyngn.com>

Improve SeekBarVolumizer behavior with unlinked streams

- Fix notification stream enabling at 0 volume
- Fix the notification slider being set when moving ringer stream

Change-Id: If3705cc833c07f726f8ad7b1ec79a42e86e8ff22
Signed-off-by: Roman Birg <roman@cyngn.com>

base: Fix notification sounds for wifi only devices

The linking of voice & notification doesn't take into account the
fact that a device may not actually have voice capabilities.  Whenever
checking whether or not to link notification and ring volumes, also
verify that the device really is voice capable.

Change-Id: Iae49302d3b5934d36b182e289e4975f5dd85b834

frameworks: fix setting up linked notification stream on boot

updateStreamVolumeAlias() was previously responsible for checking the
linked notification variable and mapping the notification stream, but
the setting to read whether the notifications were linked was read in
after that method had run which was responsible for linking them.
Extract the logic and re-run it again after reading the persisted
settings.

Change-Id: Ia62bf3ca072def54ec6ebf4f9e865d9c913e3bc4
Signed-off-by: Roman Birg <roman@cyngn.com>

fixup volume stream linking

- Make the SeekBarVolumizer move notification and ringer streams when
 linked and moving ringer.

- Fix initial state causing volume stream seek bar to be set to 0
  initially

- Clean up AudioService initialization code

Change-Id: Ia11a7a392e5eb3ef862147843e365d5f20eaf90a
Signed-off-by: Roman Birg <roman@cyngn.com>

SystemUI: Fix volume panel inconsistencies

* Use xml drawables everywhere
* Add muted notification icon
* Use AOSP naming scheme for drawables

Change-Id: I14a3af9a7aecf4828f81a8e39855608e452848d6

Misc fixes

Change-Id: Ia94b0a6655e52f5949f031360f525c871cd8df14
Signed-off-by: Meninblack007 <sanyam.53jain@gmail.com>

Use STREAM_RING on non-voice capable devices

* That's what Google does.

Change-Id: Iac88d161eb1dccbbb5c538d5e04d8d1fc43edef2
(cherry picked from commit 981e89eb6b99c058a9b3bf533e6494ab44a4b241)

VolumeDialog: Fix mismerge

Fixes not disappearing cast pickers

* Commit 568585b introduced a new LinearLayout for the volume rows
* Remove unused booleans

Change-Id: I0660d10872cc1098fdd67b618a20ea0f8e926e68

Fix VOLUME_LINK_NOTIFICATION javadoc

* Fixes checkapi:
  frameworks/base/core/java/android/provider/Settings.java:8920: error:
  Added field android.provider.Settings.Secure.VOLUME_LINK_NOTIFICATION [AddedField]

Change-Id: I4da34de53ce23e90d5f2eff72ef0a15034f08ec1

Change-Id: I7695aa15bc85e8ff19747ba7cd6700e190c7d988
For some reason Google decided that permanently zooming the wallpaper by 10%
and ruining its' quality in order to show a "zoom out depth animation" was a
good design choice.
Make this user configurable in order to get our pixels back.

Change-Id: Ifbd50ea250b1a3ffb83b6fe7ba54e92939caeaa1
Thanks to Nicolas Dhouailly <ndhouailly@gmail.com>
for the original commit for 10 in
ChangeID Ia1465c7ce47ffa6da719e40140857b94646ac402

Complete rewrite for 11 taking advantage of existing
	 GestureNavigationSettingsObserver

@eyosen: Adapted to 12

Change-Id: Ibf0a8083845ca1a171cb8bb8a8569765fc96e99b
Feature: yt/KSCOPE-23
Change-Id: Ia9447ca17f6b24152b64526c25710a77e1388ce6
Signed-off-by: LibXZR <i@xzr.moe>
CIELAB, while far from perfect, still provides a better lightness metric
than HSL. Switch to CIELAB in order to reduce falsely-detected dark
wallpapers that cause contrast issues.

Change-Id: I52d310ff9113bbca97caa7e9a380dc169bba4ea8
Signed-off-by: Pranav <npv12@iitbbs.ac.in>
* The icon was initially shown but not again after a reboot
* Reason is, that the user setup isn't completed again
  and therefore the variable mCurrentUserSetup will never
  hold true again
* Fix this by calling onUserSetupChanged once manually to
  get a proper initial state
* Similar code exists in other places in SystemUI as well:
  NavigationBar.java, NetworkControllerImpl.java, ...
  -> Looks like this one was forgotten

Change-Id: I02295a70a82696e7c0c6ade93c96e661140886f0
Change-Id: I96eec1e945b59b3d19eefe70b133ec286439c382
Change-Id: I9fc154bfede9393976119f0c5e4efa97f90e532a
neobuddy89:
* Reverse logic. Enabled animation by default.

ArrowOS:
* Add keys into backup and validators.

Change-Id: Idecaa59547159d0a2b0ecdb55a207377bd466710
NotificationShadeWindowController's are not gracefully closed, which
leads to top parts of the screen is being obscured by invisible shade window.
And also, "ripple" is actually still exists due to lightRevealScrim are
being started by onKeyguardFadingAwayChanged, which is not what user expect
when they want to disable the effect.

So in order to handle those cases, lets intercept it from the
AuthRippleController instead.

[palaych] With system settings we need to pass UserHandle.USER_CURRENT to make sure we are getting proper value.

Change-Id: I85ab96368c8b0099700f3de18ba95ce63eaac443
* Caffeine Tile icon designed by Andrew Fluck

[Adin Kwok] Add long press to infinity to caffeine qs tile

[ghostrider-reborn] Updated for android 12

Co-authored-by: Adin Kwok <adin@adin.dev>
Change-Id: If54ea27ddf179c2de39b61850163e14173727698
Signed-off-by: Adithya <gh0strider.2k18.reborn@gmail.com>
- shares the screenshot taken to Google Lens
- informs the user to install Google Lens if it is not installed
Devices with OLED display suffer from
status-bar's notification items and nagivation bar's software keys
causing permanent burn-ins when used long-term.

Moving all items in the area
both horizontally and vertically workarounds this problem.

This new feature can be enabled by setting
config_statusBarBurnInProtection to true.

The shifting interval can be configured with config_shift_interval.
The default shifting interval is 60 seconds.

Forward-ported to oreo-mr1.

Change-Id: I8df1ebc8bc0f359fe5a6a1fe11aa6201237a7359

SystemUI: rework statusbar burn-in protection controller

* Turns out that this controller was instantiated twice resulting in two timers running simultaneously which resulted in views to shift abruptly.
  Since the shift amount was too low it was not noticeable at all. So now we instantiate it once with all final dependencies and inject PhoneStatusBarView in fragment transaction.
* Finalized many instance variables and a reference to the main handler is kept instead of creating new ones in each cycle
* simplified / generalised the shift algorithm a bit so that it's easily configurable
* added a callback to reload shift vars on screen density changes
* additional changes:
* use the same controller for navigation handle, saves some cpu time

Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>

SystemUI: inject BurnInProtectionController

Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>

[jhonboy121]: use the scoped SysUISingleton annotation

SystemUI: BurnInProtectionController: rewrite in kotlin and improvements
* ditched TimerTask in favor of coroutines

Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>

[jhonboy121]:
* adapted to A13
* use BurnInHelper util functions for calculating offset

Co-authored-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
@neobuddy89: Use same toggle for wireless charging animation too.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
…tform/frameworks/base into thirteen

Android 13.0.0 Release 8 (TP1A.221005.003)

# gpg verification failed.
This is a squash commit of the following changes,
only modified for the new SDK.

  Author: Alexander Hofbauer <alex@derhofbauer.at>
  Date:   Thu Apr 12 01:24:24 2012 +0200

      Dispatch keys to a device specific key handler

      Injects a device key handler into the input path to handle additional
      keys (as found on some docks with a hardware keyboard).

      Configurable via overlay settings config_deviceKeyHandlerLib and
      config_deviceKeyHandlerClass.

      Change-Id: I6678c89c7530fdb1d4d516ba4f1d2c9e30ce79a4

  Author: Jorge Ruesga <jorge@ruesga.com>
  Date:   Thu Jan 24 02:34:49 2013 +0100

      DeviceKeyHandle: The device should consume only known keys

      When the device receive the key, only should consume it if the device
      know about the key. Otherwise, the key must be handle by the active app.
      Also make mDeviceKeyHandler private (is not useful outside this class)

      Change-Id: I4b9ea57b802e8c8c88c8b93a63d510f5952b0700
      Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

  Author: Danesh Mondegarian <daneshm90@gmail.com>
  Date:   Sun Oct 20 00:34:48 2013 -0700

      DeviceKeyHandler : Allow handling keyevents while screen off

      Some devices require the keyevents to be processed while the screen
      is off, this patchset addresses that by moving the filter up in the call
      hierarchy.

      Change-Id: If71beecc81aa5e453dcd08aba72b7bea5c210590

  Author: Steve Kondik <steve@cyngn.com>
  Date:   Sun Sep 11 00:49:41 2016 -0700

      policy: Use PathClassLoader for loading the keyhandler

       * Fix crash on start due to getCacheDir throwing an exception.
       * We can't do this anymore due to the new storage/crypto in N.

      Change-Id: I28426a5df824460ebc74aa19068192adb00d4f7c

  Author: Zhao Wei Liew <zhaoweiliew@gmail.com>
  Date:   Sun Nov 20 08:20:15 2016 +0800

      PhoneWindowManager: Support multiple key handlers

      Convert the string overlay to a string-array overlay
      to allow devices to specify an array of key handlers.

      Note that the keyhandlers towards the start of the
      array take precedence when loading.

      Change-Id: Iaaab737f1501a97d7016d8d519ccf127ca059218

  Author: Paul Keith <javelinanddart@gmail.com>
  Date:   Thu Nov 23 21:47:51 2017 +0100

      fw/b: Return a KeyEvent instead of a boolean in KeyHandler

      * Allows handlers to modify the event before sending it off
        to another KeyHandler class, to handle things like rotation

      Change-Id: I481107e050f6323c5897260a5d241e64b4e031ac

Change-Id: Ie65a89cd7efd645622d99d47699df847bc3ad96b
@xyzuan xyzuan force-pushed the thirteen branch 2 times, most recently from 4bee44c to 5966d08 Compare April 8, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.