Skip to content

Conversation

@gwolf2u
Copy link
Member

@gwolf2u gwolf2u commented Dec 31, 2025

No description provided.

AshutoshSundresh and others added 30 commits December 31, 2025 07:19
- shares the screenshot taken to Google Lens
- informs the user to install Google Lens if it is not installed

Squashed:

    From: cjh1249131356 <cjh1249131356@gmail.com>
    Date: Wed, 6 Jul 2022 15:35:31 +0800
    Subject: SystemUI: Make Lens work without independent package installed

    Reference: crdroidandroid/android_packages_apps_Launcher3@35169a6

    Signed-off-by: cjh1249131356 <cjh1249131356@gmail.com>
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Pranav Vashi <neobuddy89@gmail.com>
    Date: Sun, 26 Feb 2023 00:16:39 +0530
    Subject: SystemUI: Do not add lens screenshot without google package enabled

    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: someone5678 <someone5678@users.noreply.github.com>
    Date: Thu, 27 Jun 2024 09:33:41 +0900
    Subject: LensScreenshotReceiver: Return when failed to start activity

    Change-Id: Iab29516dae6414a5c36168af3643e23006b99ac9
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: someone5678 <someone5678@users.noreply.github.com>
    Date: Fri, 12 Jul 2024 13:39:38 +0900
    Subject: fixup! SystemUI: Integrate Google Lens into Screenshot UI

    * Make Lens activity works on Work Profile

    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Co-authored-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.

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

Squashed:

    From: jhonboy121 <alfredmathew05@gmail.com>
    Date: Sun, 11 Sep 2022 20:36:57 +0530
    Subject: SystemUI: BurnInProtectionController: offset less aggressively

    Change-Id: Ib37b0fde6edfc34cad8876d2e01ba4f37f323036
    Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Fabian Leutenegger <fabian.leutenegger@bluewin.ch>
    Date: Wed, 2 Aug 2023 20:06:20 +0200
    Subject: SystemUI: Make setNavigationBarView and setPhoneStatusBarView nullable

     * this fixes a potential npe on devices without navbar or statusbar

    Change-Id: Ia8e0ff844e24f67685ba20ac61a88d3256c9c648
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Co-authored-by: jhonboy121 <alfredmathew05@gmail.com>
Co-authored-by: Pranav Vashi <neobuddy89@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>
Squashed:
   From: Hikari-no-Tenshi <kyryljan.serhij@gmail.com>
   Date: Fri, 7 Feb 2020 23:39:42 +0200
   Subject: [PATCH] Allow devices to set proximity sensor type for ambient  display [1/2]

   true - wake-up
   false - non wake-up

    From: Pranav Vashi <neobuddy89@gmail.com>
    Date: Wed, 29 Dec 2021 11:30:11 +0530
    Subject: [PATCH] Allow to wake the screen instead of pulsing [1/2]

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* Disabled by default

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Inspired by MIUI and Essential

CutoutFullscreenController: Adapted from https://github.com/LineageOS/android_lineage-sdk/blob/lineage-16.0/sdk/src/java/org/lineageos/internal/applications/LongScreen.java

Change-Id: I37a6c0a29e7a5fbd9bded530f5de947cce5c7c25
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Disables a percentage of pixels on screen to reduce power consumption.
If enabled with battery saver, don't scale brightness at 0.5f for UX.

Includes:
 - Option to enable on battery saver
 - User chosen grid
 - Burn-in protection

Configurable via overlay and disabled by defualt:
  "config_supportSmartPixels"

Squashed:

    From: Sergii Pylypenko <x.pelya.x@gmail.com>
    Date: Sun, 8 Apr 2018 17:55:02 -0700
    Subject: SystemUI: Screen-dimmer-pixel-filter

    Major credits to Sergii Pylypenko

    Change-Id: Ib2d7e18ad8fe2313dbf7593bf55a2cfec03ce567
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Adin Kwok <adin.kwok@carbonrom.org>
    Date: Wed, 18 Apr 2018 01:05:27 -0700
    Subject: Smart Pixels: Switch to registered receiver

    Switching to a registered receiver allows to properly handle updates
    on enabling of battery saver mode and switching of users.

    Also only update screen filter with burn-in protection when the
    device is in an interactive state.

    Test: Service starts after rebooting with it enabled
          Service starts on battery saver mode (user toggle)
          Service starts on battery saver mode (auto-enabled)
          Service re-adjusts on user switch to current user settings
          Filter updates after selected timeout

    Change-Id: Iced17fd5cc49e0163754bf75782f8465b54e859b
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Adin Kwok <adin.kwok@carbonrom.org>
    Date: Sat, 21 Apr 2018 01:46:50 -0700
    Subject: Smart Pixels: Dynamically register receiver

    Don't keep the receiver registered if it isn't enabled.

    Change-Id: If6975df536598ee19d0ee17ec4150ae1b055e18c
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Pranav Vashi <neobuddy89@gmail.com>
    Date: Sun, 26 Mar 2023 11:49:54 +0530
    Subject: SmartPixels: Use CoreStartable interface for receiver

    * Also clean up and add check whether smart pixels is supported.

    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Adin Kwok <adin.kwok@carbonrom.org>
    Date: Mon, 22 Oct 2018 13:00:13 -0700
    Subject: Smart Pixels: Update default grid pattern

    Change-Id: I826a5a2fdc3aaa9c64f59fbe8b28c8757ca31c58
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
    From: Anay Wadhera <anay1018@gmail.com>
    Date: Mon, 28 Feb 2022 17:03:54 -0800
    Subject: SystemUI: mark smartpixels as a trusted overlay

    Change-Id: I1b5e17f5b4397e61350746b161d58366a19a1fc9
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Change-Id: Id3c78548cb090ab2da11f543da31c5a408fb9fe9
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
 With SmartPixels enabled, UDFPS does not work well.
 The higher the percentage of pixels to be disabled,
 the worse UDFPS works.

 Fix this by disabling SmartPixels when UDFPS is working.

Change-Id: Ic478aa5d3a541d1ce533cfce7dacfd8ddec99ad0
Co-authored-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Fade (default), CRT, and Scale

Credit and respect to xplodwild for paving the way
back in the KitKat days!

History of the ElectronBeam class can be found here
https://github.com/DirtyUnicorns/android_frameworks_base/commits/kitkat/services/java/com/android/server/power/ElectronBeam.java

*** Changes for Android 10 by bigrushdog ***
Various updates needed for Surface related API in the ElectronBeam animation class

[AgentFabulous | POSP]
- Rebase and rewrite ElectronBeam class on top of ColorFade
- Add usage of class-common Transaction instance
- Add support for respecting wide-color and protected-content
- Fixup for new API

@neobuddy89:
Updated for Android 14.

Change-Id: I58d269d44c901a8c0471807e3cf05c2054205d28
Co-Authored-By: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
…nimation

* Kind of an oddly specific use case here but to reproduce:
  - Enable CRT Screen Off Animation
  - Start playing a video from Netflix
  - Turn off screen using  power key, you should see the crash then

Co-authored by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Matt Filetto <matt.filetto@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* Move logic to RotationButtonController rather defining in NavigationBarView.

Co-authored-by: Ido Ben-Hur <idoybh2@gmail.com>
Change-Id: I870ce1dd54a97d85c418e5c4f1d00023871a2ec5
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
@idoybh edits: Adapted to A11's settings backup
[jhonboy121]: adapt to A12 changes in DozeParameters. Also in the og commit DOZE_ALWAYS_ON was being read from System namespace instead of Secure, fixed it here. Make use of SettingsProxy utlity classes for settings / getting values

Change-Id: I831583fde68de15788e3d7ecab55d864726d140f

Commit message #2:

base: check whether device is charging when alwaysOnChargingEnabled is called

* Using settings for this is quite redundant. And if you toggle aod on charge after plugging in then aod won't turn on unless you unplug and plug again (since DOZE_ON_CHARGE_NOW is set only if aod on charge is enabled and device is plugged in"

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

Commit message #3:

base: fix deadlock between activity manager and power manager

* Using the battery manager intent to query plugged in status was the root cause of deadlock,
  so inside power manager, user mIsPowered and setting value instead of using the intent based power status

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

[jhonboy121]: adapted to A13

Co-authored-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: jhonboy121 <alfredmathew05@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* Update detection logic when device is plugged in and is charging.
* Fix issue in PowerManagerService - mIsPowered is updated dynamically and
  so it should be checked everytime, not just in init.
* When plugging out, let device wake up. This should fix odd blinking issues
  in some devices.
* Add DOZE_ON_CHARGE to content observer, duh.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
From sunset to sunrise or at a custom time

Squashed:

    From: Ido Ben-Hur <idoybh2@gmail.com>
    Date: Tue, 16 Mar 2021 13:53:27 +0200
    Subject: AutoAODService: Add support for mixed time & sun modes [1/2]

    Also refactor some code

    Change-Id: I3a78dec88f532766d00e0d1d276c27dc9d3dc68f
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Ido Ben-Hur <idoybh2@gmail.com>
    Date: Fri, 26 Mar 2021 08:45:31 +0300
    Subject: AutoAODService: Account for disabled doze

    Change-Id: I30f52c4e3db2a27f9cde01662a25eee33e225414
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Ido Ben-Hur <idoybh2@gmail.com>
    Date: Fri, 9 Apr 2021 13:33:41 +0300
    Subject: AutoAODService: Slightly improve code and docs

    * Correctly link local vars and functions in docs
    * Make vars we can final
    * Don't use String.valueOf() where we don't have to
    * Should be Integer.parseInt() and not Integer.valueOf()

    Change-Id: I5892858c7142113ad3c9c87ddf00e58b18508207
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
    From: Ido Ben-Hur <idoybh2@gmail.com>
    Date: Wed, 2 Mar 2022 19:05:43 +0200
    Subject: AutoAODService: Improve some code

    And call using the right handler on settings change

    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Ido Ben-Hur <idoybh2@gmail.com>
    Date: Thu, 31 Mar 2022 20:59:38 +0300
    Subject: AutoAODService: Use Calendar.add instead of Calendar.roll

    Roll doesn't always give the intended result which can cause an alarm to be set to the distance past/future on the end of the month
    Also make sure we cancel previous alarms before setting new ones, just incase

    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: cjh1249131356 <cjh1249131356@gmail.com>
    Date: Fri, 20 May 2022 22:41:49 +0800
    Subject: base: Fix scheduled AOD

    - Always init state when settings change observed, as we need to update scheduled time, not only auto mode.
    - Fix an edge case which can be reproduced with following steps:
      Set phone to 00:00
      Set an overnight schedule time (23:00 ~ 07:00 etc)

      Then three Calendar instances hold following dates:
      current: 2022/05/20 00:00
      since: 2022/05/20 23:00
      till: 2022/05/20 07:00

      According to the first if condition, till date will be 2022/05/21 07:00
      Then issue comes, till time can never be reached until you set a till time after since time.

    Signed-off-by: cjh1249131356 <cjh1249131356@gmail.com>
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Ido Ben-Hur <idoybh2@gmail.com>
    Date: Sun, 11 Dec 2022 15:52:01 +0200
    Subject: AutoAODService: Properly handle reboots & fix some logic

    Use shared preferences to find whether the user aborted current scheduled session
    In case that happens - don't automatically toggle AOD on boot until we passed the next alarm

    In addition:
    * Don't toggle AOD onTwilightStateChanged nor in mTimeChangedReceiver - they should just change the alarms
    * Properly re-init on ALL setting changes, not just mode
    * Never disable AOD on boot just because the setting is disabled
    * Never trigger doze / screen on when interactive

    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

    From: Ido Ben-Hur <idoybh2@gmail.com>
    Date: Mon, 9 Jan 2023 06:55:56 +0200
    Subject: AutoAODService: Better check for doze enablement

    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Change-Id: Ib76ecb1855ac215de6d7cd2f2346abfce6cc2214
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Automatically pause media when muted. Resume if unmuted within a minute.

Co-Authored-By: Stylogey <stylogey@gmail.com>
Change-Id: I5d37478b3739309dcaae4eb6a0e4aac6c87f120f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
- Allow overriding device configs while using GMS as device configurator package

Change-Id: Ie7327610feca7a390915511088dfef831c946853

DeviceConfigUtils: Make debug optional

Change-Id: I65ffac8fd0a9971297b8d721d860face571a2d44
(cherry picked from commit 9f54af5392d7ca70e1e495fc97560538459844e7)

DeviceConfig: Change setProperties behavior

Change-Id: I7cf1574f423c7362e6a7c9d8a002e4b20e5e7f87
(cherry picked from commit f94a2c97e7bf53ee6681183f2394878369e99470)

* Adapt to Android 14

Change-Id: I6ece899c13f12ee299ba24b02f2b4ab96f3d92fb
Signed-off-by: someone5678 <someone5678@users.noreply.github.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* @neobuddy89: Forward Port to Android 11/12/13/14/16

neobuddy89:
* Remove now playing package usage. Rely on metadata changes.
* Improve doze pulse broadcast usage.
* Add minor fixes and NPE guards.
* Use BG executor for smooth UX.

Co-authored-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Thanks to prochy-exe for pointing it out.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* Currently, it disables only if Animator scale is 0.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
[SahilSonar - POSP]: Forward port to android-12.0.0
idoybh: Adapt to A13

Change-Id: I381c351131241e45ddb6049706d6c302c2eee946

base: allow disable of screenshot shutter sound [1/2]

[SahilSonar - POSP]
 - Forward port to android-12.0.0

idoybh: Adapt to A13

Change-Id: I47d52bba21170118af87d35376d81d7569587a2f

SystemUI: Screenshots: Refactor shutter sound logic

* Commit 2f09bac introduced some
  duplicated code
* Move it to an own method to reduce the footprint in the AOSP code parts
  and to reduce duplication

[SahilSonar - POSP]
  - Forward port to androi-12.0.0

idoybh: Adapt to A13

Change-Id: I57eaaee4db401d16cc6ef65c68604cdb4053ca01
Signed-off-by: Anushek Prasal <anushekprasal@gmail.com>

SystemUI: Fix shutter sound

* When shutter sound for camera is forced on as required in some states,
  (config_camera_sound_forced, set via mcc/mnc), we also want to
  (or should) play it when a screenshot is taken from the preview
  instead of an actual picture
* This change is loosely based on
  https://android-review.googlesource.com/c/platform/frameworks/base/+/1517742/
  but uses publicly available APIs

Testing:
- Set config_camera_sound_forced to true and push a build to device
- Turn down all stream volumes to muted
- Take screenshot of any normal screen
  -> No sound played
- Open camera, take screenshot
  -> Sound played
- Turn up volume and repeat the screenshots
  -> Sound played in all cases

[SahilSonar - POSP]
 - Forward port to android-12.0.0

idoybh: Adapt to A13

@neobuddy89:
* Remove enforcing shutter sound via prop.
* Adapt for A15 QPR1 new screenshot controller

Change-Id: I381c351131241e45ddb6049706d6c302c2eee946
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This reverts commit a226111.

Just no.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This reverts commit 150831e.

Just no

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
* So that we can use themed wifi icons.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
- Doesn't make sense to limit zenmode to just 12 hours when there's
24 hours on the clock. I get that someone at Google was looking at it
like 'we only work 12 hours a day' and that's probably where that came
from but real people sometimes need their phone quiet for more than 12
hours in a day.

Change-Id: Ibf4b5ec7412b3b9656622065e28280f42cc57f94
Signed-off-by: ZeNiXxX <zenixxx.havoc@gmail.com>
Signed-off-by: spezi77 <spezi7713@gmx.net>
Original change: GrapheneOS-Archive/platform_frameworks_base-old#27

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
- some hals fail to report success/failure (for ex. realme fp hals)

[DarkJoker360 - Switch to overlays]
[timjosten - Adapt to 12.1.0_r8 merge changes]
[ghostrider-reborn - Simplify code]

Change-Id: I442ce063280af36a04c25fcbc3dd45a90f196988
Signed-off-by: SagarMakhar <sagarmakhar@gmail.com>
Signed-off-by: DarkJoker360 <simoespo159@gmail.com>
Signed-off-by: Sarthak Roy <sarthakroy2002@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
@neobuddy89: Updated for A12, A13, A14, A16

Squashed:

    From: ShevT <evgeny.shishkov@gmail.com>
    Date: Wed, 23 Feb 2022 22:37:52 +0300
    Subject: OnTheGoTile: Fixed refresh state when turning off tile

    Test:
    1) Click on the tile. The On-The-Go mode is activated.
       The tile becomes active.
    2) Click on the tile again. On-The-Go mode turns off.
       The tile remains active until we close quick settings and reopen.

    Let's fix this.

Change-Id: Ic345f83723a48e3a7d610926fb9b47fab7ef878f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
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.