Merge changes Ifecff4f1,Ia302de46 into nyc-dev am: 2c0ae91
am: 4d5806d
* commit '4d5806d0e662e0163ad174f61779a4d4ddf48b81':
Make preferred activities direct-boot aware.
Make Parcelable classes final, API cleanup.
Change-Id: I7aa9858905cc241343da5a1fb3479bf3f74b8ba8
This commit is contained in:
@@ -8228,8 +8228,6 @@ package android.content {
|
||||
method public java.lang.String getPackageResourcePath();
|
||||
method public android.content.res.Resources getResources();
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.lang.String, int);
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.io.File, int);
|
||||
method public java.io.File getSharedPreferencesPath(java.lang.String);
|
||||
method public java.lang.Object getSystemService(java.lang.String);
|
||||
method public java.lang.String getSystemServiceName(java.lang.Class<?>);
|
||||
method public android.content.res.Resources.Theme getTheme();
|
||||
@@ -9997,7 +9995,7 @@ package android.content.pm {
|
||||
field public java.lang.String permission;
|
||||
}
|
||||
|
||||
public class ShortcutInfo implements android.os.Parcelable {
|
||||
public final class ShortcutInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public android.content.ComponentName getActivityComponent();
|
||||
method public android.os.PersistableBundle getExtras();
|
||||
@@ -29493,7 +29491,7 @@ package android.os.health {
|
||||
method public android.os.health.HealthStats[] takeUidSnapshots(int[]);
|
||||
}
|
||||
|
||||
public class TimerStat implements android.os.Parcelable {
|
||||
public final class TimerStat implements android.os.Parcelable {
|
||||
ctor public TimerStat();
|
||||
ctor public TimerStat(int, long);
|
||||
ctor public TimerStat(android.os.Parcel);
|
||||
@@ -37967,8 +37965,6 @@ package android.test.mock {
|
||||
method public java.lang.String getPackageResourcePath();
|
||||
method public android.content.res.Resources getResources();
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.lang.String, int);
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.io.File, int);
|
||||
method public java.io.File getSharedPreferencesPath(java.lang.String);
|
||||
method public java.lang.Object getSystemService(java.lang.String);
|
||||
method public java.lang.String getSystemServiceName(java.lang.Class<?>);
|
||||
method public android.content.res.Resources.Theme getTheme();
|
||||
|
||||
@@ -8539,8 +8539,6 @@ package android.content {
|
||||
method public java.lang.String getPackageResourcePath();
|
||||
method public android.content.res.Resources getResources();
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.lang.String, int);
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.io.File, int);
|
||||
method public java.io.File getSharedPreferencesPath(java.lang.String);
|
||||
method public java.lang.Object getSystemService(java.lang.String);
|
||||
method public java.lang.String getSystemServiceName(java.lang.Class<?>);
|
||||
method public android.content.res.Resources.Theme getTheme();
|
||||
@@ -10396,7 +10394,7 @@ package android.content.pm {
|
||||
field public java.lang.String permission;
|
||||
}
|
||||
|
||||
public class ShortcutInfo implements android.os.Parcelable {
|
||||
public final class ShortcutInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public android.content.ComponentName getActivityComponent();
|
||||
method public android.os.PersistableBundle getExtras();
|
||||
@@ -31809,7 +31807,7 @@ package android.os.health {
|
||||
method public android.os.health.HealthStats[] takeUidSnapshots(int[]);
|
||||
}
|
||||
|
||||
public class TimerStat implements android.os.Parcelable {
|
||||
public final class TimerStat implements android.os.Parcelable {
|
||||
ctor public TimerStat();
|
||||
ctor public TimerStat(int, long);
|
||||
ctor public TimerStat(android.os.Parcel);
|
||||
@@ -40710,8 +40708,6 @@ package android.test.mock {
|
||||
method public java.lang.String getPackageResourcePath();
|
||||
method public android.content.res.Resources getResources();
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.lang.String, int);
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.io.File, int);
|
||||
method public java.io.File getSharedPreferencesPath(java.lang.String);
|
||||
method public java.lang.Object getSystemService(java.lang.String);
|
||||
method public java.lang.String getSystemServiceName(java.lang.Class<?>);
|
||||
method public android.content.res.Resources.Theme getTheme();
|
||||
|
||||
@@ -8234,8 +8234,6 @@ package android.content {
|
||||
method public java.lang.String getPackageResourcePath();
|
||||
method public android.content.res.Resources getResources();
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.lang.String, int);
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.io.File, int);
|
||||
method public java.io.File getSharedPreferencesPath(java.lang.String);
|
||||
method public java.lang.Object getSystemService(java.lang.String);
|
||||
method public java.lang.String getSystemServiceName(java.lang.Class<?>);
|
||||
method public android.content.res.Resources.Theme getTheme();
|
||||
@@ -10007,7 +10005,7 @@ package android.content.pm {
|
||||
field public java.lang.String permission;
|
||||
}
|
||||
|
||||
public class ShortcutInfo implements android.os.Parcelable {
|
||||
public final class ShortcutInfo implements android.os.Parcelable {
|
||||
method public int describeContents();
|
||||
method public android.content.ComponentName getActivityComponent();
|
||||
method public android.os.PersistableBundle getExtras();
|
||||
@@ -29559,7 +29557,7 @@ package android.os.health {
|
||||
method public android.os.health.HealthStats[] takeUidSnapshots(int[]);
|
||||
}
|
||||
|
||||
public class TimerStat implements android.os.Parcelable {
|
||||
public final class TimerStat implements android.os.Parcelable {
|
||||
ctor public TimerStat();
|
||||
ctor public TimerStat(int, long);
|
||||
ctor public TimerStat(android.os.Parcel);
|
||||
@@ -38039,8 +38037,6 @@ package android.test.mock {
|
||||
method public java.lang.String getPackageResourcePath();
|
||||
method public android.content.res.Resources getResources();
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.lang.String, int);
|
||||
method public android.content.SharedPreferences getSharedPreferences(java.io.File, int);
|
||||
method public java.io.File getSharedPreferencesPath(java.lang.String);
|
||||
method public java.lang.Object getSystemService(java.lang.String);
|
||||
method public java.lang.String getSystemServiceName(java.lang.Class<?>);
|
||||
method public android.content.res.Resources.Theme getTheme();
|
||||
|
||||
@@ -164,6 +164,7 @@ public class ContextWrapper extends Context {
|
||||
return mBase.getSharedPreferences(name, mode);
|
||||
}
|
||||
|
||||
/** @removed */
|
||||
@Override
|
||||
public SharedPreferences getSharedPreferences(File file, int mode) {
|
||||
return mBase.getSharedPreferences(file, mode);
|
||||
@@ -201,6 +202,7 @@ public class ContextWrapper extends Context {
|
||||
return mBase.getFileStreamPath(name);
|
||||
}
|
||||
|
||||
/** @removed */
|
||||
@Override
|
||||
public File getSharedPreferencesPath(String name) {
|
||||
return mBase.getSharedPreferencesPath(name);
|
||||
|
||||
@@ -49,7 +49,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
*
|
||||
* @see {@link ShortcutManager}.
|
||||
*/
|
||||
public class ShortcutInfo implements Parcelable {
|
||||
public final class ShortcutInfo implements Parcelable {
|
||||
/* @hide */
|
||||
public static final int FLAG_DYNAMIC = 1 << 0;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import android.os.Parcelable;
|
||||
* object to be constructed, even internally, but the getTimers method on
|
||||
* {@link android.os.health.HealthStats} does require TimerStat objects.
|
||||
*/
|
||||
public class TimerStat implements Parcelable {
|
||||
public final class TimerStat implements Parcelable {
|
||||
private int mCount;
|
||||
private long mTime;
|
||||
|
||||
|
||||
@@ -4950,8 +4950,10 @@ public class PackageManagerService extends IPackageManager.Stub {
|
||||
if (DEBUG_PREFERRED || debug) Slog.v(TAG, "Skipping mAlways=false entry");
|
||||
continue;
|
||||
}
|
||||
final ActivityInfo ai = getActivityInfo(pa.mPref.mComponent,
|
||||
flags | MATCH_DISABLED_COMPONENTS, userId);
|
||||
final ActivityInfo ai = getActivityInfo(
|
||||
pa.mPref.mComponent, flags | MATCH_DISABLED_COMPONENTS
|
||||
| MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE,
|
||||
userId);
|
||||
if (DEBUG_PREFERRED || debug) {
|
||||
Slog.v(TAG, "Found preferred activity:");
|
||||
if (ai != null) {
|
||||
|
||||
@@ -145,6 +145,7 @@ public class MockContext extends Context {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/** @removed */
|
||||
@Override
|
||||
public SharedPreferences getSharedPreferences(File file, int mode) {
|
||||
throw new UnsupportedOperationException();
|
||||
@@ -180,6 +181,7 @@ public class MockContext extends Context {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/** @removed */
|
||||
@Override
|
||||
public File getSharedPreferencesPath(String name) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -980,6 +980,16 @@ def verify_files(clazz):
|
||||
warn(clazz, m, "M10", "Methods accepting File should also accept FileDescriptor or streams")
|
||||
|
||||
|
||||
def verify_manager_list(clazz):
|
||||
"""Verifies that managers return List<? extends Parcelable> instead of arrays."""
|
||||
|
||||
if not clazz.name.endswith("Manager"): return
|
||||
|
||||
for m in clazz.methods:
|
||||
if m.typ.startswith("android.") and m.typ.endswith("[]"):
|
||||
warn(clazz, m, None, "Methods should return List<? extends Parcelable> instead of Parcelable[] to support ParceledListSlice under the hood")
|
||||
|
||||
|
||||
def examine_clazz(clazz):
|
||||
"""Find all style issues in the given class."""
|
||||
if clazz.pkg.name.startswith("java"): return
|
||||
@@ -1025,6 +1035,7 @@ def examine_clazz(clazz):
|
||||
verify_listener_last(clazz)
|
||||
verify_resource_names(clazz)
|
||||
verify_files(clazz)
|
||||
verify_manager_list(clazz)
|
||||
|
||||
|
||||
def examine_stream(stream):
|
||||
|
||||
Reference in New Issue
Block a user