Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
fe16873a
Commit
fe16873a
authored
4 years ago
by
Dmitry Dementyev
Committed by
Android (Google) Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Ignore GrantCredentials call with unexpected calling uid." into pi-dev
parents
6717abba
ece586e3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/java/android/accounts/GrantCredentialsPermissionActivity.java
+28
-6
28 additions, 6 deletions
.../android/accounts/GrantCredentialsPermissionActivity.java
with
28 additions
and
6 deletions
core/java/android/accounts/GrantCredentialsPermissionActivity.java
+
28
−
6
View file @
fe16873a
...
...
@@ -16,16 +16,23 @@
package
android.accounts
;
import
android.app.Activity
;
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.app.ActivityManager
;
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
;
...
...
@@ -42,6 +49,7 @@ 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
;
...
...
@@ -77,6 +85,20 @@ public class GrantCredentialsPermissionActivity extends Activity implements View
return
;
}
try
{
IBinder
activityToken
=
getActivityToken
();
mCallingUid
=
ActivityManager
.
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment