Only check INTERACT_ACROSS_USERS_FULL when user handle is not current
Bug: 326057017 Test: atest; open app info pages from both primary and secondary profile -> verify they open as expected Flag: EXEMPT bug fix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:78ee160c20eeb41bb7eccfde9af772a9b1a958d6) Merged-In: I83ab4461f28e7f40c676099213c840a1a7dc932a Change-Id: I83ab4461f28e7f40c676099213c840a1a7dc932a
This commit is contained in:
parent
b86100f354
commit
dcf8f310ee
2 changed files with 10 additions and 10 deletions
|
|
@ -136,14 +136,14 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
|
|||
mPackageName = intent.getData().getSchemeSpecificPart();
|
||||
}
|
||||
}
|
||||
if (!hasInteractAcrossUsersPermission()) {
|
||||
Log.w(TAG, "Intent not valid.");
|
||||
finish();
|
||||
return "";
|
||||
}
|
||||
if (intent != null && intent.hasExtra(Intent.EXTRA_USER_HANDLE)) {
|
||||
mUserId = ((UserHandle) intent.getParcelableExtra(
|
||||
Intent.EXTRA_USER_HANDLE)).getIdentifier();
|
||||
mUserId = ((UserHandle) intent.getParcelableExtra(Intent.EXTRA_USER_HANDLE))
|
||||
.getIdentifier();
|
||||
if (mUserId != UserHandle.myUserId() && !hasInteractAcrossUsersFullPermission()) {
|
||||
Log.w(TAG, "Intent not valid.");
|
||||
finish();
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
mUserId = UserHandle.myUserId();
|
||||
}
|
||||
|
|
@ -171,7 +171,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
|
|||
}
|
||||
|
||||
@VisibleForTesting
|
||||
protected boolean hasInteractAcrossUsersPermission() {
|
||||
protected boolean hasInteractAcrossUsersFullPermission() {
|
||||
Activity activity = getActivity();
|
||||
if (!(activity instanceof SettingsActivity)) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ public class AppInfoWithHeaderTest {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasInteractAcrossUsersPermission() {
|
||||
protected boolean hasInteractAcrossUsersFullPermission() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -267,7 +267,7 @@ public class AppInfoWithHeaderTest {
|
|||
|
||||
private static final class TestFragmentWithoutPermission extends TestFragment {
|
||||
@Override
|
||||
protected boolean hasInteractAcrossUsersPermission() {
|
||||
protected boolean hasInteractAcrossUsersFullPermission() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue