merge from gingerbread
Change-Id: I12d6ef65986db41e658bf8d476a8e18c4dd89917
This commit is contained in:
@@ -600,7 +600,14 @@ public final class Downloads {
|
|||||||
"android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED";
|
"android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The permission to directly access the download manager's cache directory
|
* The permission to access the all the downloads in the manager.
|
||||||
|
*/
|
||||||
|
public static final String PERMISSION_ACCESS_ALL =
|
||||||
|
"android.permission.ACCESS_ALL_DOWNLOADS";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The permission to directly access the download manager's cache
|
||||||
|
* directory
|
||||||
*/
|
*/
|
||||||
public static final String PERMISSION_CACHE = "android.permission.ACCESS_CACHE_FILESYSTEM";
|
public static final String PERMISSION_CACHE = "android.permission.ACCESS_CACHE_FILESYSTEM";
|
||||||
|
|
||||||
|
|||||||
@@ -3079,13 +3079,18 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void readExcessivePowerFromParcelLocked(Parcel in) {
|
boolean readExcessivePowerFromParcelLocked(Parcel in) {
|
||||||
final int N = in.readInt();
|
final int N = in.readInt();
|
||||||
if (N == 0) {
|
if (N == 0) {
|
||||||
mExcessivePower = null;
|
mExcessivePower = null;
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (N > 10000) {
|
||||||
|
Slog.w(TAG, "File corrupt: too many excessive power entries " + N);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
mExcessivePower = new ArrayList<ExcessivePower>();
|
mExcessivePower = new ArrayList<ExcessivePower>();
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
ExcessivePower ew = new ExcessivePower();
|
ExcessivePower ew = new ExcessivePower();
|
||||||
@@ -3094,6 +3099,7 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
ew.usedTime = in.readLong();
|
ew.usedTime = in.readLong();
|
||||||
mExcessivePower.add(ew);
|
mExcessivePower.add(ew);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeToParcelLocked(Parcel out) {
|
void writeToParcelLocked(Parcel out) {
|
||||||
@@ -4689,7 +4695,7 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int NW = in.readInt();
|
int NW = in.readInt();
|
||||||
if (NW > 10000) {
|
if (NW > 100) {
|
||||||
Slog.w(TAG, "File corrupt: too many wake locks " + NW);
|
Slog.w(TAG, "File corrupt: too many wake locks " + NW);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -4707,7 +4713,7 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int NP = in.readInt();
|
int NP = in.readInt();
|
||||||
if (NP > 10000) {
|
if (NP > 1000) {
|
||||||
Slog.w(TAG, "File corrupt: too many sensors " + NP);
|
Slog.w(TAG, "File corrupt: too many sensors " + NP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -4720,7 +4726,7 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NP = in.readInt();
|
NP = in.readInt();
|
||||||
if (NP > 10000) {
|
if (NP > 1000) {
|
||||||
Slog.w(TAG, "File corrupt: too many processes " + NP);
|
Slog.w(TAG, "File corrupt: too many processes " + NP);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -4731,6 +4737,10 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
p.mSystemTime = p.mLoadedSystemTime = in.readLong();
|
p.mSystemTime = p.mLoadedSystemTime = in.readLong();
|
||||||
p.mStarts = p.mLoadedStarts = in.readInt();
|
p.mStarts = p.mLoadedStarts = in.readInt();
|
||||||
int NSB = in.readInt();
|
int NSB = in.readInt();
|
||||||
|
if (NSB > 100) {
|
||||||
|
Slog.w(TAG, "File corrupt: too many speed bins " + NSB);
|
||||||
|
return;
|
||||||
|
}
|
||||||
p.mSpeedBins = new SamplingCounter[NSB];
|
p.mSpeedBins = new SamplingCounter[NSB];
|
||||||
for (int i=0; i<NSB; i++) {
|
for (int i=0; i<NSB; i++) {
|
||||||
if (in.readInt() != 0) {
|
if (in.readInt() != 0) {
|
||||||
@@ -4738,7 +4748,9 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
p.mSpeedBins[i].readSummaryFromParcelLocked(in);
|
p.mSpeedBins[i].readSummaryFromParcelLocked(in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.readExcessivePowerFromParcelLocked(in);
|
if (!p.readExcessivePowerFromParcelLocked(in)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NP = in.readInt();
|
NP = in.readInt();
|
||||||
@@ -4751,6 +4763,10 @@ public final class BatteryStatsImpl extends BatteryStats {
|
|||||||
Uid.Pkg p = u.getPackageStatsLocked(pkgName);
|
Uid.Pkg p = u.getPackageStatsLocked(pkgName);
|
||||||
p.mWakeups = p.mLoadedWakeups = in.readInt();
|
p.mWakeups = p.mLoadedWakeups = in.readInt();
|
||||||
final int NS = in.readInt();
|
final int NS = in.readInt();
|
||||||
|
if (NS > 1000) {
|
||||||
|
Slog.w(TAG, "File corrupt: too many services " + NS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (int is = 0; is < NS; is++) {
|
for (int is = 0; is < NS; is++) {
|
||||||
String servName = in.readString();
|
String servName = in.readString();
|
||||||
Uid.Pkg.Serv s = u.getServiceStatsLocked(pkgName, servName);
|
Uid.Pkg.Serv s = u.getServiceStatsLocked(pkgName, servName);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.android.defcontainer">
|
package="com.android.defcontainer">
|
||||||
<uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER"/>
|
<uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER"/>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_ALL_DOWNLOADS"/>
|
||||||
<uses-permission android:name="android.permission.ASEC_ACCESS"/>
|
<uses-permission android:name="android.permission.ASEC_ACCESS"/>
|
||||||
<uses-permission android:name="android.permission.ASEC_CREATE"/>
|
<uses-permission android:name="android.permission.ASEC_CREATE"/>
|
||||||
<uses-permission android:name="android.permission.ASEC_DESTROY"/>
|
<uses-permission android:name="android.permission.ASEC_DESTROY"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user