Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
663bfe8d
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
663bfe8d
编写于
5月 04, 2020
作者:
J
Jason Simmons
提交者:
GitHub
5月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove the ResourceCleaner from the Android embedding (#18072)
上级
763d5207
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
0 addition
and
118 deletion
+0
-118
ci/licenses_golden/licenses_flutter
ci/licenses_golden/licenses_flutter
+0
-2
shell/platform/android/BUILD.gn
shell/platform/android/BUILD.gn
+0
-2
shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java
...oid/io/flutter/embedding/engine/loader/FlutterLoader.java
+0
-2
shell/platform/android/io/flutter/embedding/engine/loader/ResourceCleaner.java
...d/io/flutter/embedding/engine/loader/ResourceCleaner.java
+0
-91
shell/platform/android/io/flutter/embedding/engine/loader/ResourcePaths.java
...oid/io/flutter/embedding/engine/loader/ResourcePaths.java
+0
-19
tools/android_lint/project.xml
tools/android_lint/project.xml
+0
-2
未找到文件。
ci/licenses_golden/licenses_flutter
浏览文件 @
663bfe8d
...
...
@@ -702,9 +702,7 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/D
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/DartMessenger.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/PlatformMessageHandler.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/loader/ResourceCleaner.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/loader/ResourceExtractor.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/loader/ResourcePaths.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/plugins/FlutterPlugin.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/plugins/PluginRegistry.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/plugins/activity/ActivityAware.java
...
...
shell/platform/android/BUILD.gn
浏览文件 @
663bfe8d
...
...
@@ -152,9 +152,7 @@ android_java_sources = [
"io/flutter/embedding/engine/dart/DartMessenger.java",
"io/flutter/embedding/engine/dart/PlatformMessageHandler.java",
"io/flutter/embedding/engine/loader/FlutterLoader.java",
"io/flutter/embedding/engine/loader/ResourceCleaner.java",
"io/flutter/embedding/engine/loader/ResourceExtractor.java",
"io/flutter/embedding/engine/loader/ResourcePaths.java",
"io/flutter/embedding/engine/plugins/FlutterPlugin.java",
"io/flutter/embedding/engine/plugins/PluginRegistry.java",
"io/flutter/embedding/engine/plugins/activity/ActivityAware.java",
...
...
shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java
浏览文件 @
663bfe8d
...
...
@@ -295,8 +295,6 @@ public class FlutterLoader {
/** Extract assets out of the APK that need to be cached as uncompressed files on disk. */
private
void
initResources
(
@NonNull
Context
applicationContext
)
{
new
ResourceCleaner
(
applicationContext
).
start
();
if
(
BuildConfig
.
DEBUG
||
BuildConfig
.
JIT_RELEASE
)
{
final
String
dataDirPath
=
PathUtils
.
getDataDirectory
(
applicationContext
);
final
String
packageName
=
applicationContext
.
getPackageName
();
...
...
shell/platform/android/io/flutter/embedding/engine/loader/ResourceCleaner.java
已删除
100644 → 0
浏览文件 @
763d5207
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
io.flutter.embedding.engine.loader
;
import
android.content.Context
;
import
android.os.AsyncTask
;
import
android.os.Handler
;
import
android.util.Log
;
import
io.flutter.BuildConfig
;
import
java.io.File
;
import
java.io.FilenameFilter
;
/** A class to clean up orphaned resource directories after unclean shutdowns. */
class
ResourceCleaner
{
private
static
final
String
TAG
=
"ResourceCleaner"
;
private
static
final
long
DELAY_MS
=
5000
;
private
static
class
CleanTask
extends
AsyncTask
<
Void
,
Void
,
Void
>
{
private
final
File
[]
mFilesToDelete
;
CleanTask
(
File
[]
filesToDelete
)
{
mFilesToDelete
=
filesToDelete
;
}
boolean
hasFilesToDelete
()
{
return
mFilesToDelete
!=
null
&&
mFilesToDelete
.
length
>
0
;
}
@Override
protected
Void
doInBackground
(
Void
...
unused
)
{
if
(
BuildConfig
.
DEBUG
)
{
Log
.
i
(
TAG
,
"Cleaning "
+
mFilesToDelete
.
length
+
" resources."
);
}
for
(
File
file
:
mFilesToDelete
)
{
if
(
file
.
exists
())
{
deleteRecursively
(
file
);
}
}
return
null
;
}
private
void
deleteRecursively
(
File
parent
)
{
if
(
parent
.
isDirectory
())
{
for
(
File
child
:
parent
.
listFiles
())
{
deleteRecursively
(
child
);
}
}
parent
.
delete
();
}
}
private
final
Context
mContext
;
ResourceCleaner
(
Context
context
)
{
mContext
=
context
;
}
void
start
()
{
File
cacheDir
=
mContext
.
getCacheDir
();
if
(
cacheDir
==
null
)
{
return
;
}
final
CleanTask
task
=
new
CleanTask
(
cacheDir
.
listFiles
(
new
FilenameFilter
()
{
@Override
public
boolean
accept
(
File
dir
,
String
name
)
{
boolean
result
=
name
.
startsWith
(
ResourcePaths
.
TEMPORARY_RESOURCE_PREFIX
);
return
result
;
}
}));
if
(!
task
.
hasFilesToDelete
())
{
return
;
}
new
Handler
()
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
task
.
executeOnExecutor
(
AsyncTask
.
THREAD_POOL_EXECUTOR
);
}
},
DELAY_MS
);
}
}
shell/platform/android/io/flutter/embedding/engine/loader/ResourcePaths.java
已删除
100644 → 0
浏览文件 @
763d5207
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package
io.flutter.embedding.engine.loader
;
import
android.content.Context
;
import
java.io.File
;
import
java.io.IOException
;
class
ResourcePaths
{
// The filename prefix used by Chromium temporary file APIs.
public
static
final
String
TEMPORARY_RESOURCE_PREFIX
=
".org.chromium.Chromium."
;
// Return a temporary file that will be cleaned up by the ResourceCleaner.
public
static
File
createTempFile
(
Context
context
,
String
suffix
)
throws
IOException
{
return
File
.
createTempFile
(
TEMPORARY_RESOURCE_PREFIX
,
"_"
+
suffix
,
context
.
getCacheDir
());
}
}
tools/android_lint/project.xml
浏览文件 @
663bfe8d
...
...
@@ -74,8 +74,6 @@
<src
file=
"../../../flutter/shell/platform/android/io/flutter/view/FlutterMain.java"
/>
<src
file=
"../../../flutter/shell/platform/android/io/flutter/view/ResourceExtractor.java"
/>
<src
file=
"../../../flutter/shell/platform/android/io/flutter/view/TextureRegistry.java"
/>
<src
file=
"../../../flutter/shell/platform/android/io/flutter/view/ResourcePaths.java"
/>
<src
file=
"../../../flutter/shell/platform/android/io/flutter/view/ResourceCleaner.java"
/>
<src
file=
"../../../flutter/shell/platform/android/io/flutter/view/FlutterRunArguments.java"
/>
<src
file=
"../../../flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java"
/>
<src
file=
"../../../flutter/shell/platform/android/io/flutter/view/AccessibilityViewEmbedder.java"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录