Add optional logging to investigate URI grants.
Developers are seeing odd reports of URI permission grants
disappearing unexpectedly. This optional logging can be enabled to
show exactly where granting/revoking is happening.
Bug: 30978171
Change-Id: I8a5a976f42d4b71270e69c5597dfcb5d89e18848
(cherry picked from commit d16b1258b2)
This commit is contained in:
committed by
Jeff Sharkey
parent
221330f9f9
commit
c0ee776046
@@ -19,6 +19,7 @@ package com.android.server.am;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
|
||||||
import com.android.server.am.ActivityManagerService.GrantUri;
|
import com.android.server.am.ActivityManagerService.GrantUri;
|
||||||
@@ -93,7 +94,16 @@ final class UriPermission {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateModeFlags() {
|
private void updateModeFlags() {
|
||||||
|
final int oldModeFlags = modeFlags;
|
||||||
modeFlags = ownedModeFlags | globalModeFlags | persistableModeFlags | persistedModeFlags;
|
modeFlags = ownedModeFlags | globalModeFlags | persistableModeFlags | persistedModeFlags;
|
||||||
|
|
||||||
|
if (Log.isLoggable(TAG, Log.VERBOSE) && (modeFlags != oldModeFlags)) {
|
||||||
|
Slog.d(TAG,
|
||||||
|
"Permission for " + targetPkg + " to " + uri + " is changing from 0x"
|
||||||
|
+ Integer.toHexString(oldModeFlags) + " to 0x"
|
||||||
|
+ Integer.toHexString(modeFlags),
|
||||||
|
new Throwable());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user