Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1097a84 authored by Dmitry Dementyev's avatar Dmitry Dementyev
Browse files

Revert "Ignore GrantCredentials call with unexpected calling uid."

This reverts commit 4f008458.

Reason for revert: Build breakage - b/172932743

Bug: 172932743
Change-Id: Iee0a5e2b84e5d89a206b099f75a15e714a332ff4
parent 4f008458
Loading
Loading
Loading
Loading
+6 −28
Original line number Diff line number Diff line
@@ -16,23 +16,16 @@
package android.accounts;

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.Intent;
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.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.android.internal.R;

import java.io.IOException;
@@ -49,7 +42,6 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
    private Account mAccount;
    private String mAuthTokenType;
    private int mUid;
    private int mCallingUid;
    private Bundle mResultBundle = null;
    protected LayoutInflater mInflater;

@@ -82,20 +74,6 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
            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;
        try {
            accountTypeLabel = getAccountLabel(mAccount);