Donate to
e Foundation
|
Murena
handsets with /e/OS | Own a part of Murena!
Learn more
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
android_frameworks_base
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
e
os
android_frameworks_base
Commits
9db70d29
Commit
9db70d29
authored
5 years ago
by
Treehugger Robot
Committed by
Gerrit Code Review
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Removing an extra installd call."
parents
e07c0cff
54bc47ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
services/core/java/com/android/server/pm/PackageDexOptimizer.java
+8
-21
8 additions, 21 deletions
.../core/java/com/android/server/pm/PackageDexOptimizer.java
with
8 additions
and
21 deletions
services/core/java/com/android/server/pm/PackageDexOptimizer.java
+
8
−
21
View file @
9db70d29
...
@@ -271,10 +271,7 @@ public class PackageDexOptimizer {
...
@@ -271,10 +271,7 @@ public class PackageDexOptimizer {
return
DEX_OPT_SKIPPED
;
return
DEX_OPT_SKIPPED
;
}
}
// TODO(calin): there's no need to try to create the oat dir over and over again,
String
oatDir
=
getPackageOatDirIfSupported
(
pkg
);
// especially since it involve an extra installd call. We should create
// if (if supported) on the fly during the dexopt call.
String
oatDir
=
createOatDirIfSupported
(
pkg
,
isa
);
Log
.
i
(
TAG
,
"Running dexopt (dexoptNeeded="
+
dexoptNeeded
+
") on: "
+
path
Log
.
i
(
TAG
,
"Running dexopt (dexoptNeeded="
+
dexoptNeeded
+
") on: "
+
path
+
" pkg="
+
pkg
.
applicationInfo
.
packageName
+
" isa="
+
isa
+
" pkg="
+
pkg
.
applicationInfo
.
packageName
+
" isa="
+
isa
...
@@ -639,7 +636,7 @@ public class PackageDexOptimizer {
...
@@ -639,7 +636,7 @@ public class PackageDexOptimizer {
}
}
/**
/**
*
Create
s oat dir for the specified package if needed and supported.
*
Get
s oat dir for the specified package if needed and supported.
* In certain cases oat directory
* In certain cases oat directory
* <strong>cannot</strong> be created:
* <strong>cannot</strong> be created:
* <ul>
* <ul>
...
@@ -647,29 +644,19 @@ public class PackageDexOptimizer {
...
@@ -647,29 +644,19 @@ public class PackageDexOptimizer {
* <li>Package location is not a directory, i.e. monolithic install.</li>
* <li>Package location is not a directory, i.e. monolithic install.</li>
* </ul>
* </ul>
*
*
* @return Absolute path to the oat directory or null, if oat director
y
* @return Absolute path to the oat directory or null, if oat director
ies
*
can
not
be created
.
* not
needed or unsupported for the package
.
*/
*/
@Nullable
@Nullable
private
String
creat
eOatDirIfSupported
(
PackageParser
.
Package
pkg
,
String
dexInstructionSet
)
{
private
String
getPackag
eOatDirIfSupported
(
PackageParser
.
Package
pkg
)
{
if
(!
pkg
.
canHaveOatDir
())
{
if
(!
pkg
.
canHaveOatDir
())
{
return
null
;
return
null
;
}
}
File
codePath
=
new
File
(
pkg
.
codePath
);
File
codePath
=
new
File
(
pkg
.
codePath
);
if
(
codePath
.
isDirectory
())
{
if
(!
codePath
.
isDirectory
())
{
// TODO(calin): why do we create this only if the codePath is a directory? (i.e for
return
null
;
// cluster packages). It seems that the logic for the folder creation is
// split between installd and here.
File
oatDir
=
getOatDir
(
codePath
);
try
{
mInstaller
.
createOatDir
(
oatDir
.
getAbsolutePath
(),
dexInstructionSet
);
}
catch
(
InstallerException
e
)
{
Slog
.
w
(
TAG
,
"Failed to create oat dir"
,
e
);
return
null
;
}
return
oatDir
.
getAbsolutePath
();
}
}
return
null
;
return
getOatDir
(
codePath
).
getAbsolutePath
()
;
}
}
static
File
getOatDir
(
File
codePath
)
{
static
File
getOatDir
(
File
codePath
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment