diff options
Diffstat (limited to 'services/java')
8 files changed, 40 insertions, 31 deletions
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java index 212796c..98b5f66 100644 --- a/services/java/com/android/server/AlarmManagerService.java +++ b/services/java/com/android/server/AlarmManagerService.java @@ -91,7 +91,7 @@ class AlarmManagerService extends IAlarmManager.Stub { = new Intent().addFlags(Intent.FLAG_FROM_BACKGROUND); private static final IncreasingTimeOrder sIncreasingTimeOrder = new IncreasingTimeOrder(); - private static final boolean WAKEUP_STATS = true; + private static final boolean WAKEUP_STATS = false; private final Context mContext; diff --git a/services/java/com/android/server/AppOpsService.java b/services/java/com/android/server/AppOpsService.java index 7af95f3..c6c4a94 100644 --- a/services/java/com/android/server/AppOpsService.java +++ b/services/java/com/android/server/AppOpsService.java @@ -552,6 +552,17 @@ public class AppOpsService extends IAppOpsService.Stub { } @Override + public int checkPackage(int uid, String packageName) { + synchronized (this) { + if (getOpsLocked(uid, packageName, true) != null) { + return AppOpsManager.MODE_ALLOWED; + } else { + return AppOpsManager.MODE_ERRORED; + } + } + } + + @Override public int noteOperation(int code, int uid, String packageName) { verifyIncomingUid(uid); verifyIncomingOp(code); @@ -560,7 +571,7 @@ public class AppOpsService extends IAppOpsService.Stub { if (ops == null) { if (DEBUG) Log.d(TAG, "noteOperation: no op for code " + code + " uid " + uid + " package " + packageName); - return AppOpsManager.MODE_IGNORED; + return AppOpsManager.MODE_ERRORED; } Op op = getOpLocked(ops, code, true); if (op.duration == -1) { @@ -594,7 +605,7 @@ public class AppOpsService extends IAppOpsService.Stub { if (ops == null) { if (DEBUG) Log.d(TAG, "startOperation: no op for code " + code + " uid " + uid + " package " + packageName); - return AppOpsManager.MODE_IGNORED; + return AppOpsManager.MODE_ERRORED; } Op op = getOpLocked(ops, code, true); final int switchCode = AppOpsManager.opToSwitch(code); diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 9bf2d3b..7f9dc26 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -965,8 +965,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { // Find the first Provisioning Network NetworkInfo provNi = null; for (NetworkInfo ni : getAllNetworkInfo()) { - if (ni.getDetailedState() - == NetworkInfo.DetailedState.CONNECTED_TO_PROVISIONING_NETWORK) { + if (ni.isConnectedToProvisioningNetwork()) { provNi = ni; break; } @@ -2919,7 +2918,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { NetworkInfo.State state = info.getState(); if (VDBG || (state == NetworkInfo.State.CONNECTED) || - (state == NetworkInfo.State.DISCONNECTED)) { + (state == NetworkInfo.State.DISCONNECTED) || + (state == NetworkInfo.State.SUSPENDED)) { log("ConnectivityChange for " + info.getTypeName() + ": " + state + "/" + info.getDetailedState()); @@ -2934,7 +2934,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { if (ConnectivityManager.isNetworkTypeMobile(info.getType()) && (0 != Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0)) - && (state == NetworkInfo.State.CONNECTED)) { + && ((state == NetworkInfo.State.CONNECTED) + || info.isConnectedToProvisioningNetwork())) { checkMobileProvisioning(CheckMp.MAX_TIMEOUT_MS); } @@ -2947,8 +2948,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { } else if (info.getDetailedState() == DetailedState.CAPTIVE_PORTAL_CHECK) { handleCaptivePortalTrackerCheck(info); - } else if (info.getDetailedState() == - DetailedState.CONNECTED_TO_PROVISIONING_NETWORK) { + } else if (info.isConnectedToProvisioningNetwork()) { /** * TODO: Create ConnectivityManager.TYPE_MOBILE_PROVISIONING * for now its an in between network, its a network that @@ -4418,8 +4418,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { // If provisioning network handle as a special case, // otherwise launch browser with the intent directly. NetworkInfo ni = getProvisioningNetworkInfo(); - if ((ni != null) && ni.getDetailedState() == - NetworkInfo.DetailedState.CONNECTED_TO_PROVISIONING_NETWORK) { + if ((ni != null) && ni.isConnectedToProvisioningNetwork()) { if (DBG) log("handleMobileProvisioningAction: on provisioning network"); MobileDataStateTracker mdst = (MobileDataStateTracker) mNetTrackers[ConnectivityManager.TYPE_MOBILE]; diff --git a/services/java/com/android/server/DropBoxManagerService.java b/services/java/com/android/server/DropBoxManagerService.java index 5008270..29b04da 100644 --- a/services/java/com/android/server/DropBoxManagerService.java +++ b/services/java/com/android/server/DropBoxManagerService.java @@ -24,6 +24,7 @@ import android.content.IntentFilter; import android.content.pm.PackageManager; import android.database.ContentObserver; import android.net.Uri; +import android.os.Binder; import android.os.Debug; import android.os.DropBoxManager; import android.os.FileUtils; @@ -265,8 +266,13 @@ public final class DropBoxManagerService extends IDropBoxManagerService.Stub { } public boolean isTagEnabled(String tag) { - return !"disabled".equals(Settings.Global.getString( - mContentResolver, Settings.Global.DROPBOX_TAG_PREFIX + tag)); + final long token = Binder.clearCallingIdentity(); + try { + return !"disabled".equals(Settings.Global.getString( + mContentResolver, Settings.Global.DROPBOX_TAG_PREFIX + tag)); + } finally { + Binder.restoreCallingIdentity(token); + } } public synchronized DropBoxManager.Entry getNextEntry(String tag, long millis) { diff --git a/services/java/com/android/server/am/ProcessStatsService.java b/services/java/com/android/server/am/ProcessStatsService.java index 55409c2..43ae46f 100644 --- a/services/java/com/android/server/am/ProcessStatsService.java +++ b/services/java/com/android/server/am/ProcessStatsService.java @@ -413,6 +413,7 @@ public final class ProcessStatsService extends IProcessStats.Stub { mWriteLock.lock(); try { synchronized (mAm) { + mProcessStats.mTimePeriodEndRealtime = SystemClock.elapsedRealtime(); mProcessStats.writeToParcel(current, 0); } if (historic != null) { diff --git a/services/java/com/android/server/am/ReceiverList.java b/services/java/com/android/server/am/ReceiverList.java index b19cc5d..fa8c1df 100644 --- a/services/java/com/android/server/am/ReceiverList.java +++ b/services/java/com/android/server/am/ReceiverList.java @@ -69,7 +69,7 @@ final class ReceiverList extends ArrayList<BroadcastFilter> } void dumpLocal(PrintWriter pw, String prefix) { - pw.print(prefix); pw.print("app="); pw.print(app.toShortString()); + pw.print(prefix); pw.print("app="); pw.print(app != null ? app.toShortString() : null); pw.print(" pid="); pw.print(pid); pw.print(" uid="); pw.print(uid); pw.print(" user="); pw.println(userId); if (curBroadcast != null || linkedToDeath) { diff --git a/services/java/com/android/server/pm/UserManagerService.java b/services/java/com/android/server/pm/UserManagerService.java index af60f84..d0e9fe1 100644 --- a/services/java/com/android/server/pm/UserManagerService.java +++ b/services/java/com/android/server/pm/UserManagerService.java @@ -416,12 +416,6 @@ public class UserManagerService extends IUserManager.Stub { if (restrictions == null) return; synchronized (mPackagesLock) { - // If the user has restrictions already and call is trying to disallow restrictions, - // don't modify the flag. - if (hasRestrictionsPinLocked(userId) - && restrictions.getBoolean(UserManager.DISALLOW_APP_RESTRICTIONS, false)) { - restrictions.putBoolean(UserManager.DISALLOW_APP_RESTRICTIONS, false); - } mUserRestrictions.get(userId).clear(); mUserRestrictions.get(userId).putAll(restrictions); writeUserLocked(mUsers.get(userId)); @@ -686,7 +680,6 @@ public class UserManagerService extends IUserManager.Stub { writeBoolean(serializer, restrictions, UserManager.DISALLOW_USB_FILE_TRANSFER); writeBoolean(serializer, restrictions, UserManager.DISALLOW_CONFIG_CREDENTIALS); writeBoolean(serializer, restrictions, UserManager.DISALLOW_REMOVE_USER); - writeBoolean(serializer, restrictions, UserManager.DISALLOW_APP_RESTRICTIONS); serializer.endTag(null, TAG_RESTRICTIONS); } serializer.endTag(null, TAG_USER); @@ -817,7 +810,6 @@ public class UserManagerService extends IUserManager.Stub { readBoolean(parser, restrictions, UserManager.DISALLOW_USB_FILE_TRANSFER); readBoolean(parser, restrictions, UserManager.DISALLOW_CONFIG_CREDENTIALS); readBoolean(parser, restrictions, UserManager.DISALLOW_REMOVE_USER); - readBoolean(parser, restrictions, UserManager.DISALLOW_APP_RESTRICTIONS); } } } @@ -1130,7 +1122,7 @@ public class UserManagerService extends IUserManager.Stub { } @Override - public boolean changeRestrictionsPin(String newPin) { + public boolean setRestrictionsChallenge(String newPin) { checkManageUsersPermission("Only system can modify the restrictions pin"); int userId = UserHandle.getCallingUserId(); synchronized (mPackagesLock) { @@ -1157,7 +1149,7 @@ public class UserManagerService extends IUserManager.Stub { } @Override - public int checkRestrictionsPin(String pin) { + public int checkRestrictionsChallenge(String pin) { checkManageUsersPermission("Only system can verify the restrictions pin"); int userId = UserHandle.getCallingUserId(); synchronized (mPackagesLock) { @@ -1200,7 +1192,7 @@ public class UserManagerService extends IUserManager.Stub { } @Override - public boolean hasRestrictionsPin() { + public boolean hasRestrictionsChallenge() { int userId = UserHandle.getCallingUserId(); synchronized (mPackagesLock) { return hasRestrictionsPinLocked(userId); @@ -1227,7 +1219,7 @@ public class UserManagerService extends IUserManager.Stub { // Remove all user restrictions setUserRestrictions(new Bundle(), userHandle); // Remove restrictions pin - changeRestrictionsPin(null); + setRestrictionsChallenge(null); // Remove any app restrictions cleanAppRestrictions(userHandle, true); } diff --git a/services/java/com/android/server/power/ElectronBeam.java b/services/java/com/android/server/power/ElectronBeam.java index 379e704..0d92f66 100644 --- a/services/java/com/android/server/power/ElectronBeam.java +++ b/services/java/com/android/server/power/ElectronBeam.java @@ -319,10 +319,10 @@ final class ElectronBeam { /** * Draws a frame where the electron beam has been stretched out into - * a thin white horizontal line that fades as it expands outwards. + * a thin white horizontal line that fades as it collapses inwards. * - * @param stretch The stretch factor. 0.0 is no stretch / no fade, - * 1.0 is maximum stretch / maximum fade. + * @param stretch The stretch factor. 0.0 is maximum stretch / no fade, + * 1.0 is collapsed / maximum fade. */ private void drawHStretch(float stretch) { // compute interpolation scale factor @@ -338,7 +338,7 @@ final class ElectronBeam { // draw narrow fading white line setHStretchQuad(mVertexBuffer, mDisplayWidth, mDisplayHeight, ag); - GLES10.glColor4f(1.0f - ag, 1.0f - ag, 1.0f - ag, 1.0f); + GLES10.glColor4f(1.0f - ag*0.75f, 1.0f - ag*0.75f, 1.0f - ag*0.75f, 1.0f); GLES10.glDrawArrays(GLES10.GL_TRIANGLE_FAN, 0, 4); // clean up @@ -355,7 +355,7 @@ final class ElectronBeam { } private static void setHStretchQuad(FloatBuffer vtx, float dw, float dh, float a) { - final float w = dw + (dw * a); + final float w = 2 * dw * (1.0f - a); final float h = 1.0f; final float x = (dw - w) * 0.5f; final float y = (dh - h) * 0.5f; |
