1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 09:46:19 +00:00
treble_evolution/patches/platform_packages_modules_DeviceLock/0001-Don-t-crash-when-we-get-no-DeviceLockManager.patch
2024-04-24 15:13:17 +00:00

30 lines
1.3 KiB
Diff

From d6e25483a85b782d60ff23318e6aa3cbf881b355 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 e376aaeb..af90d23e 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.25.1