Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_vold
Commits
bac5eb96
Commit
bac5eb96
authored
12 years ago
by
Jean-Baptiste Queru
Committed by
android code review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "Delay disk inserted broadcast until disk is ready"
parents
5cf6325c
3dafc26e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
DirectVolume.cpp
DirectVolume.cpp
+10
-7
No files found.
DirectVolume.cpp
View file @
bac5eb96
...
...
@@ -113,6 +113,16 @@ int DirectVolume::handleBlockEvent(NetlinkEvent *evt) {
}
else
{
handlePartitionAdded
(
dp
,
evt
);
}
/* Send notification iff disk is ready (ie all partitions found) */
if
(
getState
()
==
Volume
::
State_Idle
)
{
char
msg
[
255
];
snprintf
(
msg
,
sizeof
(
msg
),
"Volume %s %s disk inserted (%d:%d)"
,
getLabel
(),
getMountpoint
(),
mDiskMajor
,
mDiskMinor
);
mVm
->
getBroadcaster
()
->
sendBroadcast
(
ResponseCode
::
VolumeDiskInserted
,
msg
,
false
);
}
}
else
if
(
action
==
NetlinkEvent
::
NlActionRemove
)
{
if
(
!
strcmp
(
devtype
,
"disk"
))
{
handleDiskRemoved
(
dp
,
evt
);
...
...
@@ -148,8 +158,6 @@ void DirectVolume::handleDiskAdded(const char *devpath, NetlinkEvent *evt) {
mDiskNumParts
=
1
;
}
char
msg
[
255
];
int
partmask
=
0
;
int
i
;
for
(
i
=
1
;
i
<=
mDiskNumParts
;
i
++
)
{
...
...
@@ -169,11 +177,6 @@ void DirectVolume::handleDiskAdded(const char *devpath, NetlinkEvent *evt) {
#endif
setState
(
Volume
::
State_Pending
);
}
snprintf
(
msg
,
sizeof
(
msg
),
"Volume %s %s disk inserted (%d:%d)"
,
getLabel
(),
getMountpoint
(),
mDiskMajor
,
mDiskMinor
);
mVm
->
getBroadcaster
()
->
sendBroadcast
(
ResponseCode
::
VolumeDiskInserted
,
msg
,
false
);
}
void
DirectVolume
::
handlePartitionAdded
(
const
char
*
devpath
,
NetlinkEvent
*
evt
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment