Merge "Define permission for system apps to query size of block" into lmp-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
59093d925d
@@ -1130,6 +1130,12 @@
|
|||||||
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
|
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
|
||||||
android:protectionLevel="signature" />
|
android:protectionLevel="signature" />
|
||||||
|
|
||||||
|
<!-- @hide Allows querying state of PersistentDataBlock
|
||||||
|
<p>Not for use by third-party applications. -->
|
||||||
|
<permission android:name="android.permission.ACCESS_PDB_STATE"
|
||||||
|
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
|
||||||
|
android:protectionLevel="signature" />
|
||||||
|
|
||||||
|
|
||||||
<!-- =========================================== -->
|
<!-- =========================================== -->
|
||||||
<!-- Permissions associated with audio capture -->
|
<!-- Permissions associated with audio capture -->
|
||||||
|
|||||||
@@ -433,7 +433,10 @@ public class PersistentDataBlockService extends SystemService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDataBlockSize() {
|
public int getDataBlockSize() {
|
||||||
|
if (mContext.checkCallingPermission(Manifest.permission.ACCESS_PDB_STATE)
|
||||||
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
enforceUid(Binder.getCallingUid());
|
enforceUid(Binder.getCallingUid());
|
||||||
|
}
|
||||||
|
|
||||||
DataInputStream inputStream;
|
DataInputStream inputStream;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user