Java. lang. SecurityException: under uid 10090 but it is really 10060,10090

Source: Internet
Author: User

Java. lang. SecurityException: under uid 10090 but it is really 10060,10090
E/DatabaseUtils (1255): java. lang. SecurityException: Package com. flyaudio. skin does not belong to 10090
E/DatabaseUtils (1255): at android. app. AppOpsManager. checkPackage (AppOpsManager. java: 1133)
E/DatabaseUtils (1255): at android. content. ContentProvider. getCallingPackage (ContentProvider. java: 570)
E/DatabaseUtils (1255): at com. android. providers. settings. SettingsProvider. call (SettingsProvider. java: 635)
E/DatabaseUtils (1255): at android. content. ContentProvider $ Transport. call (ContentProvider. java: 325)
E/DatabaseUtils (1255): at android. content. ContentProviderNative. onTransact (ContentProviderNative. java: 275)
E/DatabaseUtils (1255): at android. OS .Binder.exe cTransact (Binder. java: 404)
E/DatabaseUtils (1255): at dalvik. system. NativeStart. run (Native Method)
W/AppOps (1255): Bad call: specified package com. flyaudio. skin under uid 10090 but it is really 10060



Android4.4.4 this problem occurs on the Qualcomm platform.

The trace code knows that it is Settings. System. putInt (resolver, Settings. System. SCREEN_BRIGHTNESS, brightness); an error occurs.

Find a solution from the Internet:

Modify/frameworks/base/core/java/android/app/ContextImpl. java


Private ContextImpl (ContextImpl container, ActivityThread mainThread, LoadedApk packageInfo, IBinder activityToken, UserHandle user, boolean restricted, Display display, Configuration overrideConfiguration) is changed to the following:


private ContextImpl(ContextImpl container, ActivityThread mainThread,            LoadedApk packageInfo, IBinder activityToken, UserHandle user, boolean restricted,            Display display, Configuration overrideConfiguration) {        mOuterContext = this;        mMainThread = mainThread;        mActivityToken = activityToken;        mRestricted = restricted;        if (user == null) {            user = Process.myUserHandle();        }        mUser = user;        mPackageInfo = packageInfo;                mResourcesManager = ResourcesManager.getInstance();        mDisplay = display;        mOverrideConfiguration = overrideConfiguration;        final int displayId = getDisplayId();        CompatibilityInfo compatInfo = null;        if (container != null) {            compatInfo = container.getDisplayAdjustments(displayId).getCompatibilityInfo();        }        if (compatInfo == null && displayId == Display.DEFAULT_DISPLAY) {            compatInfo = packageInfo.getCompatibilityInfo();        }        mDisplayAdjustments.setCompatibilityInfo(compatInfo);        mDisplayAdjustments.setActivityToken(activityToken);        Resources resources = packageInfo.getResources(mainThread);        if (resources != null) {            if (activityToken != null                    || displayId != Display.DEFAULT_DISPLAY                    || overrideConfiguration != null                    || (compatInfo != null && compatInfo.applicationScale                            != resources.getCompatibilityInfo().applicationScale)) {                resources = mResourcesManager.getTopLevelResources(                        packageInfo.getResDir(), displayId,                        overrideConfiguration, compatInfo, activityToken);            }        }        mResources = resources;        if (container != null) {            mBasePackageName = container.mBasePackageName;            mOpPackageName = container.mOpPackageName;        } else {            mBasePackageName = packageInfo.mPackageName;            ApplicationInfo ainfo = packageInfo.getApplicationInfo();            if (ainfo.uid == Process.SYSTEM_UID && ainfo.uid != Process.myUid()) {                // Special case: system components allow themselves to be loaded in to other                // processes.  For purposes of app ops, we must then consider the context as                // belonging to the package of this process, not the system itself, otherwise                // the package+uid verifications in app ops will fail.                mOpPackageName = ActivityThread.currentPackageName();            } else {                mOpPackageName = mBasePackageName;            }        }mContentResolver = new ApplicationContentResolver(this, mainThread, user);    }
Recompile the framework

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.