1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 08:36:19 +00:00
treble_evolution/patches/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch
2024-04-24 15:13:17 +00:00

27 lines
1.0 KiB
Diff

From 3c97761832e1f00d2e1f135e381eb8596dcaecd2 Mon Sep 17 00:00:00 2001
From: Raphael Mounier <mounierr07@gmail.com>
Date: Sat, 6 Aug 2022 18:08:36 +0200
Subject: [PATCH 03/51] Fix env empty string - ANDROID_STORAGE
Huawei hi6250 define in init.hi6250.rc ANDROID_STORAGE to "", so check empty string and replace with default path. Apply change for all env directory
---
core/java/android/os/Environment.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index 536ef31f334a..bebab95189d7 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -1523,7 +1523,7 @@ public class Environment {
static File getDirectory(String variableName, String defaultPath) {
String path = System.getenv(variableName);
- return path == null ? new File(defaultPath) : new File(path);
+ return ((path == null || path.isEmpty()) ? new File(defaultPath) : new File(path));
}
@NonNull
--
2.25.1