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.execTransact(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高通平台出现这个问题。
跟踪代码知道是Settings.System.putInt(resolver, Settings.System.SCREEN_BRIGHTNESS, brightness);出错。
从网上找到解决办法:
修改/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)改成如下:
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); }
重新编译framework