Merge "Revert "Ignore GrantCredentials call with unexpected calling uid."" into pi-dev am: 888ba5ee1a am: 1d3492e181 am: 427ee435bd am: 5c9473a962
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13028859 Change-Id: Iba39a9957df9d4c22759d8ac482f16de9ca0d8b0
This commit is contained in:
@@ -16,23 +16,16 @@
|
|||||||
package android.accounts;
|
package android.accounts;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.ActivityTaskManager;
|
import android.content.res.Resources;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.IBinder;
|
|
||||||
import android.os.Process;
|
|
||||||
import android.os.RemoteException;
|
|
||||||
import android.os.UserHandle;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.android.internal.R;
|
import com.android.internal.R;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -49,7 +42,6 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
|
|||||||
private Account mAccount;
|
private Account mAccount;
|
||||||
private String mAuthTokenType;
|
private String mAuthTokenType;
|
||||||
private int mUid;
|
private int mUid;
|
||||||
private int mCallingUid;
|
|
||||||
private Bundle mResultBundle = null;
|
private Bundle mResultBundle = null;
|
||||||
protected LayoutInflater mInflater;
|
protected LayoutInflater mInflater;
|
||||||
|
|
||||||
@@ -82,20 +74,6 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
IBinder activityToken = getActivityToken();
|
|
||||||
mCallingUid = ActivityTaskManager.getService().getLaunchedFromUid(activityToken);
|
|
||||||
} catch (RemoteException re) {
|
|
||||||
// Couldn't figure out caller details
|
|
||||||
Log.w(getClass().getSimpleName(), "Unable to get caller identity \n" + re);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!UserHandle.isSameApp(mCallingUid, Process.SYSTEM_UID) && mCallingUid != mUid) {
|
|
||||||
setResult(Activity.RESULT_CANCELED);
|
|
||||||
finish();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
String accountTypeLabel;
|
String accountTypeLabel;
|
||||||
try {
|
try {
|
||||||
accountTypeLabel = getAccountLabel(mAccount);
|
accountTypeLabel = getAccountLabel(mAccount);
|
||||||
|
|||||||
Reference in New Issue
Block a user