Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
device_xiaomi_sm8350-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
LMODroid-Devices
device_xiaomi_sm8350-common
Commits
e07fbb97
Commit
e07fbb97
authored
4 years ago
by
Demon000
Browse files
Options
Downloads
Patches
Plain Diff
sm6250-common: init: override dalvik heap config based on total RAM
parent
149534d3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
BoardConfigCommon.mk
+4
-0
4 additions, 0 deletions
BoardConfigCommon.mk
init/Android.bp
+27
-0
27 additions, 0 deletions
init/Android.bp
init/init.cpp
+75
-0
75 additions, 0 deletions
init/init.cpp
with
106 additions
and
0 deletions
BoardConfigCommon.mk
+
4
−
0
View file @
e07fbb97
...
...
@@ -80,6 +80,10 @@ BOARD_KERNEL_CMDLINE += video=vfb:640x400,bpp=32,memsize=3072000
DEVICE_MANIFEST_FILE
:=
$(
COMMON_PATH
)
/manifest.xml
DEVICE_MATRIX_FILE
:=
$(
COMMON_PATH
)
/compatibility_matrix.xml
# Init
TARGET_INIT_VENDOR_LIB
:=
//
$(
COMMON_PATH
)
:libinit_xiaomi_sm6250
TARGET_RECOVERY_DEVICE_MODULES
:=
libinit_xiaomi_sm6250
# Partitions
BOARD_BOOTIMAGE_PARTITION_SIZE
:=
134217728
BOARD_CACHEIMAGE_PARTITION_SIZE
:=
402653184
...
...
This diff is collapsed.
Click to expand it.
init/Android.bp
0 → 100644
+
27
−
0
View file @
e07fbb97
//
// Copyright (C) 2020 The LineageOS Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
cc_library_static {
name: "libinit_xiaomi_sm6250",
recovery_available: true,
srcs: [
"init.cpp"
],
include_dirs: [
"system/core/base/include",
"system/core/init"
]
}
This diff is collapsed.
Click to expand it.
init/init.cpp
0 → 100644
+
75
−
0
View file @
e07fbb97
/*
* Copyright (C) 2020 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include
<cstdlib>
#include
<fstream>
#include
<string.h>
#include
<sys/sysinfo.h>
#include
<unistd.h>
#include
<android-base/properties.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include
<sys/_system_properties.h>
#include
"vendor_init.h"
#include
"property_service.h"
using
android
::
base
::
GetProperty
;
using
android
::
init
::
property_set
;
char
const
*
heapstartsize
;
char
const
*
heapgrowthlimit
;
char
const
*
heapsize
;
char
const
*
heapminfree
;
char
const
*
heapmaxfree
;
char
const
*
heaptargetutilization
;
void
check_device
()
{
struct
sysinfo
sys
;
sysinfo
(
&
sys
);
if
(
sys
.
totalram
>=
5ull
*
1024
*
1024
*
1024
)
{
// from - phone-xhdpi-6144-dalvik-heap.mk
heapstartsize
=
"16m"
;
heapgrowthlimit
=
"256m"
;
heapsize
=
"512m"
;
heaptargetutilization
=
"0.5"
;
heapminfree
=
"8m"
;
heapmaxfree
=
"32m"
;
}
else
if
(
sys
.
totalram
>=
3ull
*
1024
*
1024
*
1024
)
{
// from - phone-xhdpi-4096-dalvik-heap.mk
heapstartsize
=
"8m"
;
heapgrowthlimit
=
"192m"
;
heapsize
=
"512m"
;
heaptargetutilization
=
"0.6"
;
heapminfree
=
"8m"
;
heapmaxfree
=
"16m"
;
}
}
void
vendor_load_properties
()
{
check_device
();
property_set
(
"dalvik.vm.heapstartsize"
,
heapstartsize
);
property_set
(
"dalvik.vm.heapgrowthlimit"
,
heapgrowthlimit
);
property_set
(
"dalvik.vm.heapsize"
,
heapsize
);
property_set
(
"dalvik.vm.heaptargetutilization"
,
heaptargetutilization
);
property_set
(
"dalvik.vm.heapminfree"
,
heapminfree
);
property_set
(
"dalvik.vm.heapmaxfree"
,
heapmaxfree
);
}
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