mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-08-01 19:06:21 -04:00
Fixups + Churn
Signed-off-by: Tavi <tavi@divested.dev>
This commit is contained in:
parent
dbfbdc93cf
commit
dda4cd7ab5
26 changed files with 34 additions and 182 deletions
|
@ -1,4 +1,4 @@
|
|||
From 14461bfefeef4f00cab8c6335eec7a701915ef5b Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Rakesh Kumar <rakesh.kumar@ittiam.com>
|
||||
Date: Thu, 30 May 2024 11:17:48 +0000
|
||||
Subject: [PATCH] StagefrightRecoder: Disabling B-frame support
|
||||
|
@ -21,7 +21,7 @@ Change-Id: I4098655eb9687fb633085333bc140634441566e6
|
|||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
|
||||
index a6558ab3d44..0d8e9952527 100644
|
||||
index a6558ab3d4..0d8e995252 100644
|
||||
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
|
||||
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
|
||||
@@ -1646,6 +1646,11 @@ status_t StagefrightRecorder::setupVideoEncoder(
|
||||
|
|
|
@ -1,147 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Pinyao Ting <pinyaoting@google.com>
|
||||
Date: Thu, 30 Nov 2023 23:12:39 +0000
|
||||
Subject: [PATCH] Added throttle when reporting shortcut usage
|
||||
|
||||
Bug: 304290201
|
||||
Test: manual
|
||||
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:76121eb73d4c40829d5513b073871333520fe0a2)
|
||||
Merged-In: I96370cbd4f6a55f894c1a93307e5f82dfd394652
|
||||
Change-Id: I96370cbd4f6a55f894c1a93307e5f82dfd394652
|
||||
---
|
||||
.../android/server/pm/ShortcutPackage.java | 35 +++++++++++++++++++
|
||||
.../android/server/pm/ShortcutService.java | 12 +++----
|
||||
.../server/pm/ShortcutManagerTest2.java | 2 ++
|
||||
3 files changed, 41 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/pm/ShortcutPackage.java b/services/core/java/com/android/server/pm/ShortcutPackage.java
|
||||
index 0a98002feb14..36e775a3a237 100644
|
||||
--- a/services/core/java/com/android/server/pm/ShortcutPackage.java
|
||||
+++ b/services/core/java/com/android/server/pm/ShortcutPackage.java
|
||||
@@ -19,17 +19,20 @@ import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.UserIdInt;
|
||||
import android.content.ComponentName;
|
||||
+import android.app.usage.UsageStatsManagerInternal;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.content.res.Resources;
|
||||
import android.os.PersistableBundle;
|
||||
+import android.os.SystemClock;
|
||||
import android.text.format.Formatter;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
import android.util.Slog;
|
||||
|
||||
+import com.android.internal.annotations.GuardedBy;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.util.Preconditions;
|
||||
import com.android.internal.util.XmlUtils;
|
||||
@@ -103,6 +106,11 @@ class ShortcutPackage extends ShortcutPackageItem {
|
||||
private static final String KEY_BITMAPS = "bitmaps";
|
||||
private static final String KEY_BITMAP_BYTES = "bitmapBytes";
|
||||
|
||||
+ @VisibleForTesting
|
||||
+ public static final int REPORT_USAGE_BUFFER_SIZE = 3;
|
||||
+
|
||||
+ private final Object mLock = new Object();
|
||||
+
|
||||
/**
|
||||
* All the shortcuts from the package, keyed on IDs.
|
||||
*/
|
||||
@@ -122,6 +130,9 @@ class ShortcutPackage extends ShortcutPackageItem {
|
||||
|
||||
private long mLastKnownForegroundElapsedTime;
|
||||
|
||||
+ @GuardedBy("mLock")
|
||||
+ private List<Long> mLastReportedTime = new ArrayList<>();
|
||||
+
|
||||
private ShortcutPackage(ShortcutUser shortcutUser,
|
||||
int packageUserId, String packageName, ShortcutPackageInfo spi) {
|
||||
super(shortcutUser, packageUserId, packageName,
|
||||
@@ -1144,6 +1155,30 @@ class ShortcutPackage extends ShortcutPackageItem {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ void reportShortcutUsed(@NonNull final UsageStatsManagerInternal usageStatsManagerInternal,
|
||||
+ @NonNull final String shortcutId) {
|
||||
+ synchronized (mLock) {
|
||||
+ final long currentTS = SystemClock.elapsedRealtime();
|
||||
+ final ShortcutService s = mShortcutUser.mService;
|
||||
+ if (mLastReportedTime.isEmpty()
|
||||
+ || mLastReportedTime.size() < REPORT_USAGE_BUFFER_SIZE) {
|
||||
+ mLastReportedTime.add(currentTS);
|
||||
+ } else if (currentTS - mLastReportedTime.get(0) > s.mSaveDelayMillis) {
|
||||
+ mLastReportedTime.remove(0);
|
||||
+ mLastReportedTime.add(currentTS);
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+ final long token = s.injectClearCallingIdentity();
|
||||
+ try {
|
||||
+ usageStatsManagerInternal.reportShortcutUsage(getPackageName(), shortcutId,
|
||||
+ getUser().getUserId());
|
||||
+ } finally {
|
||||
+ s.injectRestoreCallingIdentity(token);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
public void dump(@NonNull PrintWriter pw, @NonNull String prefix) {
|
||||
pw.println();
|
||||
|
||||
diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java
|
||||
index 2cfc3461c697..6d57f7163b87 100644
|
||||
--- a/services/core/java/com/android/server/pm/ShortcutService.java
|
||||
+++ b/services/core/java/com/android/server/pm/ShortcutService.java
|
||||
@@ -290,7 +290,7 @@ public class ShortcutService extends IShortcutService.Stub {
|
||||
private CompressFormat mIconPersistFormat;
|
||||
private int mIconPersistQuality;
|
||||
|
||||
- private int mSaveDelayMillis;
|
||||
+ int mSaveDelayMillis;
|
||||
|
||||
private final IPackageManager mIPackageManager;
|
||||
private final PackageManagerInternal mPackageManagerInternal;
|
||||
@@ -2045,10 +2045,11 @@ public class ShortcutService extends IShortcutService.Stub {
|
||||
shortcutId, packageName, userId));
|
||||
}
|
||||
|
||||
+ final ShortcutPackage ps;
|
||||
synchronized (mLock) {
|
||||
throwIfUserLockedL(userId);
|
||||
|
||||
- final ShortcutPackage ps = getPackageShortcutsForPublisherLocked(packageName, userId);
|
||||
+ ps = getPackageShortcutsForPublisherLocked(packageName, userId);
|
||||
|
||||
if (ps.findShortcutById(shortcutId) == null) {
|
||||
Log.w(TAG, String.format("reportShortcutUsed: package %s doesn't have shortcut %s",
|
||||
@@ -2057,12 +2058,7 @@ public class ShortcutService extends IShortcutService.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
- final long token = injectClearCallingIdentity();
|
||||
- try {
|
||||
- mUsageStatsManagerInternal.reportShortcutUsage(packageName, shortcutId, userId);
|
||||
- } finally {
|
||||
- injectRestoreCallingIdentity(token);
|
||||
- }
|
||||
+ ps.reportShortcutUsed(mUsageStatsManagerInternal, shortcutId);
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
|
||||
index 6b86ef0e0704..579657981ff9 100644
|
||||
--- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
|
||||
+++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java
|
||||
@@ -1809,6 +1809,8 @@ public class ShortcutManagerTest2 extends BaseShortcutManagerTest {
|
||||
|
||||
public void testReportShortcutUsed() {
|
||||
mRunningUsers.put(USER_10, true);
|
||||
+ mService.updateConfigurationLocked(
|
||||
+ ShortcutService.ConfigConstants.KEY_SAVE_DELAY_MILLIS + "=1");
|
||||
|
||||
runWithCaller(CALLING_PACKAGE_1, USER_10, () -> {
|
||||
reset(mMockUsageStatsManagerInternal);
|
|
@ -1,4 +1,4 @@
|
|||
From 4f7911704b5e53dd50ef736de84205f17827b975 Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Kiran S <krns@google.com>
|
||||
Date: Mon, 13 May 2024 05:49:06 +0000
|
||||
Subject: [PATCH] Restrict USB poups while setup is in progress
|
||||
|
@ -14,7 +14,7 @@ Change-Id: I7d54534696fd73f3b94c5b4250142eed9341c5d8
|
|||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/services/usb/java/com/android/server/usb/UsbSettingsManager.java b/services/usb/java/com/android/server/usb/UsbSettingsManager.java
|
||||
index de9ede397c130..195360df7dbfb 100644
|
||||
index de9ede397c13..195360df7dbf 100644
|
||||
--- a/services/usb/java/com/android/server/usb/UsbSettingsManager.java
|
||||
+++ b/services/usb/java/com/android/server/usb/UsbSettingsManager.java
|
||||
@@ -16,6 +16,8 @@
|
||||
|
@ -26,7 +26,7 @@ index de9ede397c130..195360df7dbfb 100644
|
|||
import android.app.PendingIntent;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ComponentName;
|
||||
@@ -36,6 +38,7 @@
|
||||
@@ -36,6 +38,7 @@ import android.os.Binder;
|
||||
import android.os.Environment;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
|
@ -34,7 +34,7 @@ index de9ede397c130..195360df7dbfb 100644
|
|||
import android.util.AtomicFile;
|
||||
import android.util.Log;
|
||||
import android.util.Slog;
|
||||
@@ -756,10 +759,28 @@ private void resolveActivity(Intent intent, UsbDevice device) {
|
||||
@@ -756,10 +759,28 @@ class UsbSettingsManager {
|
||||
defaultPackage = mDevicePreferenceMap.get(new DeviceFilter(device));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From 31562d59f523d73b8c92d0327370cac98904992a Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Brian Delwiche <delwiche@google.com>
|
||||
Date: Mon, 22 Apr 2024 16:43:29 +0000
|
||||
Subject: [PATCH] [BACKPORT] Fix heap-buffer overflow in sdp_utils.cc
|
||||
Subject: [PATCH] Fix heap-buffer overflow in sdp_utils.cc
|
||||
|
||||
Fuzzer identifies a case where sdpu_compare_uuid_with_attr crashes with
|
||||
an out of bounds comparison. Although the bug claims this is due to a
|
||||
|
@ -24,7 +24,7 @@ Change-Id: Ib536cbeac454efbf6af3d713c05c8e3e077e069b
|
|||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/stack/sdp/sdp_utils.c b/stack/sdp/sdp_utils.c
|
||||
index e9df4606893..d1dd94e138c 100644
|
||||
index e9df46068..d1dd94e13 100644
|
||||
--- a/stack/sdp/sdp_utils.c
|
||||
+++ b/stack/sdp/sdp_utils.c
|
||||
@@ -850,13 +850,20 @@ BOOLEAN sdpu_compare_uuid_with_attr (tBT_UUID *p_btuuid, tSDP_DISC_ATTR *p_attr)
|
||||
|
|
|
@ -38,10 +38,10 @@ Such ops are being constructed due to another bug.
|
|||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
|
||||
index 6fde3b531fbb..2d26cc53832f 100644
|
||||
index 65a704bfe947..662794c7b4c2 100644
|
||||
--- a/services/core/java/com/android/server/appop/AppOpsService.java
|
||||
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
|
||||
@@ -5231,15 +5231,13 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
@@ -5252,15 +5252,13 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
String lastPkg = null;
|
||||
for (int i=0; i<allOps.size(); i++) {
|
||||
AppOpsManager.PackageOps pkg = allOps.get(i);
|
||||
|
|
|
@ -15,10 +15,10 @@ crashes.
|
|||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
|
||||
index 2d26cc53832f..425b36da5ed9 100644
|
||||
index 662794c7b4c2..b27769fdd03f 100644
|
||||
--- a/services/core/java/com/android/server/appop/AppOpsService.java
|
||||
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
|
||||
@@ -5231,6 +5231,9 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
@@ -5252,6 +5252,9 @@ public class AppOpsService extends IAppOpsService.Stub {
|
||||
String lastPkg = null;
|
||||
for (int i=0; i<allOps.size(); i++) {
|
||||
AppOpsManager.PackageOps pkg = allOps.get(i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue