Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
94f5f44b
Commit
94f5f44b
authored
2 years ago
by
Thiébaud Weksteen
Committed by
Gerrit Code Review
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Call PermissionEnforcer helper methods"
parents
cee5e47a
f6ba1e78
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
services/core/java/com/android/server/DynamicSystemService.java
+26
-0
26 additions, 0 deletions
...es/core/java/com/android/server/DynamicSystemService.java
services/core/java/com/android/server/SerialService.java
+4
-0
4 additions, 0 deletions
services/core/java/com/android/server/SerialService.java
with
30 additions
and
0 deletions
services/core/java/com/android/server/DynamicSystemService.java
+
26
−
0
View file @
94f5f44b
...
...
@@ -77,6 +77,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
startInstallation
(
String
dsuSlot
)
throws
RemoteException
{
super
.
startInstallation_enforcePermission
();
IGsiService
service
=
getGsiService
();
mGsiService
=
service
;
// priority from high to low: sysprop -> sdcard -> /data
...
...
@@ -124,6 +126,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
int
createPartition
(
String
name
,
long
size
,
boolean
readOnly
)
throws
RemoteException
{
super
.
createPartition_enforcePermission
();
IGsiService
service
=
getGsiService
();
int
status
=
service
.
createPartition
(
name
,
size
,
readOnly
);
if
(
status
!=
IGsiService
.
INSTALL_OK
)
{
...
...
@@ -135,6 +139,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
closePartition
()
throws
RemoteException
{
super
.
closePartition_enforcePermission
();
IGsiService
service
=
getGsiService
();
if
(
service
.
closePartition
()
!=
0
)
{
Slog
.
i
(
TAG
,
"Partition installation completes with error"
);
...
...
@@ -146,6 +152,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
finishInstallation
()
throws
RemoteException
{
super
.
finishInstallation_enforcePermission
();
IGsiService
service
=
getGsiService
();
if
(
service
.
closeInstall
()
!=
0
)
{
Slog
.
i
(
TAG
,
"Failed to finish installation"
);
...
...
@@ -157,12 +165,16 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
GsiProgress
getInstallationProgress
()
throws
RemoteException
{
super
.
getInstallationProgress_enforcePermission
();
return
getGsiService
().
getInstallProgress
();
}
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
abort
()
throws
RemoteException
{
super
.
abort_enforcePermission
();
return
getGsiService
().
cancelGsiInstall
();
}
...
...
@@ -183,12 +195,16 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
isEnabled
()
throws
RemoteException
{
super
.
isEnabled_enforcePermission
();
return
getGsiService
().
isGsiEnabled
();
}
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
remove
()
throws
RemoteException
{
super
.
remove_enforcePermission
();
try
{
GsiServiceCallback
callback
=
new
GsiServiceCallback
();
synchronized
(
callback
)
{
...
...
@@ -205,6 +221,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
setEnable
(
boolean
enable
,
boolean
oneShot
)
throws
RemoteException
{
super
.
setEnable_enforcePermission
();
IGsiService
gsiService
=
getGsiService
();
if
(
enable
)
{
try
{
...
...
@@ -229,6 +247,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
setAshmem
(
ParcelFileDescriptor
ashmem
,
long
size
)
{
super
.
setAshmem_enforcePermission
();
try
{
return
getGsiService
().
setGsiAshmem
(
ashmem
,
size
);
}
catch
(
RemoteException
e
)
{
...
...
@@ -239,6 +259,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
submitFromAshmem
(
long
size
)
{
super
.
submitFromAshmem_enforcePermission
();
try
{
return
getGsiService
().
commitGsiChunkFromAshmem
(
size
);
}
catch
(
RemoteException
e
)
{
...
...
@@ -249,6 +271,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
boolean
getAvbPublicKey
(
AvbPublicKey
dst
)
{
super
.
getAvbPublicKey_enforcePermission
();
try
{
return
getGsiService
().
getAvbPublicKey
(
dst
)
==
0
;
}
catch
(
RemoteException
e
)
{
...
...
@@ -259,6 +283,8 @@ public class DynamicSystemService extends IDynamicSystemService.Stub {
@Override
@EnforcePermission
(
android
.
Manifest
.
permission
.
MANAGE_DYNAMIC_SYSTEM
)
public
long
suggestScratchSize
()
throws
RemoteException
{
super
.
suggestScratchSize_enforcePermission
();
return
getGsiService
().
suggestScratchSize
();
}
}
This diff is collapsed.
Click to expand it.
services/core/java/com/android/server/SerialService.java
+
4
−
0
View file @
94f5f44b
...
...
@@ -37,6 +37,8 @@ public class SerialService extends ISerialManager.Stub {
@EnforcePermission
(
android
.
Manifest
.
permission
.
SERIAL_PORT
)
public
String
[]
getSerialPorts
()
{
super
.
getSerialPorts_enforcePermission
();
ArrayList
<
String
>
ports
=
new
ArrayList
<
String
>();
for
(
int
i
=
0
;
i
<
mSerialPorts
.
length
;
i
++)
{
String
path
=
mSerialPorts
[
i
];
...
...
@@ -51,6 +53,8 @@ public class SerialService extends ISerialManager.Stub {
@EnforcePermission
(
android
.
Manifest
.
permission
.
SERIAL_PORT
)
public
ParcelFileDescriptor
openSerialPort
(
String
path
)
{
super
.
openSerialPort_enforcePermission
();
for
(
int
i
=
0
;
i
<
mSerialPorts
.
length
;
i
++)
{
if
(
mSerialPorts
[
i
].
equals
(
path
))
{
return
native_open
(
path
);
...
...
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