Skip to content

Instantly share code, notes, and snippets.

View anayw2001's full-sized avatar
💭
heck

Anay Wadhera anayw2001

💭
heck
View GitHub Profile
@anayw2001
anayw2001 / SharingSlice.kt
Created January 10, 2024 04:18
How to use the Nearby Sharing slice
val sliceUri = Uri.parse("content://com.google.android.gms.nearby.sharing/scan")
val sliceManager = SliceViewManager.getInstance(context)
sliceManager.registerSliceCallback(sliceUri, slice -> {
for (targetItem in slice.items.reversed()) {
// Each row containing a target has the hints LIST_ITEM and ACTIVITY.
if (!(targetItem.format == SLICE && targetItem.hints.containsAll(listOf(LIST_ITEM, ACTIVITY)))) {
continue
}
val targetSlice = targetItem.slice
var deviceName: String? = null
@anayw2001
anayw2001 / 0001-Keyguard-Lock-icon-improvements.patch
Created October 14, 2020 04:53
Keyguard lock icon dismissal patch
From e42cef46c99b458ae828d0f60518c2469c0f4e07 Mon Sep 17 00:00:00 2001
From: Dil3mm4 <dil3mm4.dev@gmail.com>
Date: Sat, 19 Oct 2019 03:55:08 -0400
Subject: [PATCH] Keyguard: Lock icon improvements
There was a ~300ms delay (I think) between the actual dismissal of the lock icon from keyguard locked to unlocked (only with no security method activated).
So, mKeyguardIndicationController.setVisible(false) has been moved to KeyguardgoingAway() to anticipate the icon dismissal with a small setAlpha hack in KeyguardIndicationController.
Change-Id: Ia926cd27e96bb450ed8f5ed9c686556fd647fa45
@anayw2001
anayw2001 / 0001-StatusBar-dismiss-qs-when-screen-s-going-off-if-show.patch
Last active October 14, 2020 04:48
Patch for fixing QS expansion when expanded on keyguard
From c7f9647e0c8216b91cc655649eb8f1970aa73192 Mon Sep 17 00:00:00 2001
From: Dil3mm4 <dil3mm4.dev@gmail.com>
Date: Tue, 13 Oct 2020 09:29:19 +0000
Subject: [PATCH] StatusBar: dismiss qs when screen's going off if showing
test: expand to full QS state, lock device, unlock device, ensure QS isn't expanded anymore
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index a5cc1a83fc8..e96b3164c5f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
https://github.com/Jertlok/statix_device_huawei_angler/commit/f7cd1b65082f57488906c525e8cccb57a3ed9986
https://github.com/Jertlok/statix_device_huawei_angler/commit/752ff5932c0dc2f096fcb18f216221eb1e135e19
https://github.com/camcory/device_moto_shamu/commit/ffaf3653f6c45cb9d17d2c098071ceff49a1718c
https://github.com/camcory/device_moto_shamu/commit/445e47888f36a86605cc095c53e0a7a1dff6598d
https://github.com/camcory/device_moto_shamu/commit/de891c7e0601b601e6d31747f665ce242d7f3dd8
https://github.com/camcory/device_moto_shamu/commit/d4177022f4abce37a727c70b385a83754a8a59c1