1
0
mirror of https://github.com/ponces/treble_aosp.git synced 2024-11-22 05:26:14 +00:00
treble_aosp/patches/trebledroid/platform_packages_modules_DeviceLock/0001-Don-t-crash-when-we-get-no-DeviceLockManager.patch
2024-06-18 10:56:01 +01:00

30 lines
1.3 KiB
Diff

From ce509a6a4788e696de672d7d772853cc49c5b38e Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 18 Oct 2023 17:44:59 -0400
Subject: [PATCH] Don't crash when we get no DeviceLockManager
Change-Id: Iaba659694e706c82a95ec2e99feb26e2bc6314e0
---
.../devicelockcontroller/SystemDeviceLockManagerImpl.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/DeviceLockController/src/com/android/devicelockcontroller/SystemDeviceLockManagerImpl.java b/DeviceLockController/src/com/android/devicelockcontroller/SystemDeviceLockManagerImpl.java
index 93540aec..4916c823 100644
--- a/DeviceLockController/src/com/android/devicelockcontroller/SystemDeviceLockManagerImpl.java
+++ b/DeviceLockController/src/com/android/devicelockcontroller/SystemDeviceLockManagerImpl.java
@@ -48,7 +48,10 @@ public final class SystemDeviceLockManagerImpl implements SystemDeviceLockManage
final DeviceLockManager deviceLockManager = context.getSystemService(
DeviceLockManager.class);
- mIDeviceLockService = deviceLockManager.getService();
+ if (deviceLockManager != null)
+ mIDeviceLockService = deviceLockManager.getService();
+ else
+ mIDeviceLockService = null;
}
private SystemDeviceLockManagerImpl() {
--
2.34.1