Loading cmds/am/src/com/android/commands/am/Am.java +22 −0 Original line number Diff line number Diff line Loading @@ -48,7 +48,9 @@ import android.content.pm.InstrumentationInfo; import android.content.pm.ParceledListSlice; import android.content.pm.ResolveInfo; import android.content.pm.UserInfo; import android.content.res.AssetManager; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.os.Binder; import android.os.Build; Loading @@ -64,6 +66,7 @@ import android.os.UserHandle; import android.text.TextUtils; import android.util.AndroidException; import android.util.ArrayMap; import android.util.DisplayMetrics; import android.view.IWindowManager; import com.android.internal.os.BaseCommand; Loading Loading @@ -361,6 +364,8 @@ public class Am extends BaseCommand { "am send-trim-memory: send a memory trim event to a <PROCESS>.\n" + "\n" + "am get-current-user: returns id of the current foreground user.\n" + "\n" + "am supports-multiwindow: returns true if the device supports multiwindow.\n" + "\n" ); Intent.printIntentArgsHelp(pw, ""); Loading Loading @@ -458,6 +463,8 @@ public class Am extends BaseCommand { runSendTrimMemory(); } else if (op.equals("get-current-user")) { runGetCurrentUser(); } else if (op.equals("supports-multiwindow")) { runSupportsMultiwindow(); } else { showError("Error: unknown command '" + op + "'"); } Loading Loading @@ -2534,6 +2541,21 @@ public class Am extends BaseCommand { System.out.println(currentUser.id); } private void runSupportsMultiwindow() throws Exception { // system resources does not contain all the device configuration, construct it manually. Configuration config = mAm.getConfiguration(); if (config == null) { throw new AndroidException("Activity manager has no configuration"); } final DisplayMetrics metrics = new DisplayMetrics(); metrics.setToDefaults(); Resources res = new Resources(AssetManager.getSystem(), metrics, config); System.out.println(res.getBoolean(com.android.internal.R.bool.config_supportsMultiWindow)); } /** * Open the given file for sending into the system process. This verifies * with SELinux that the system will have access to the file. Loading cmds/bootanimation/BootAnimation.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ static const char LAST_TIME_CHANGED_FILE_NAME[] = "last_time_change"; static const char LAST_TIME_CHANGED_FILE_PATH[] = "/data/system/time/last_time_change"; static const char ACCURATE_TIME_FLAG_FILE_NAME[] = "time_is_accurate"; static const char ACCURATE_TIME_FLAG_FILE_PATH[] = "/data/system/time/time_is_accurate"; static const char TIME_FORMAT_12_HOUR_FLAG_FILE_PATH[] = "/data/system/time/time_format_12_hour"; // Java timestamp format. Don't show the clock if the date is before 2000-01-01 00:00:00. static const long long ACCURATE_TIME_EPOCH = 946684800000; static constexpr char FONT_BEGIN_CHAR = ' '; Loading @@ -99,7 +100,7 @@ static const std::vector<std::string> PLAY_SOUND_BOOTREASON_BLACKLIST { // --------------------------------------------------------------------------- BootAnimation::BootAnimation() : Thread(false), mClockEnabled(true), mTimeIsAccurate(false), mTimeCheckThread(NULL) { mTimeFormat12Hour(false), mTimeCheckThread(NULL) { mSession = new SurfaceComposerClient(); // If the system has already booted, the animation is not being used for a boot. Loading Loading @@ -590,9 +591,10 @@ void BootAnimation::drawText(const char* str, const Font& font, bool bold, int* glBindTexture(GL_TEXTURE_2D, 0); } // We render 24 hour time. // We render 12 or 24 hour time. void BootAnimation::drawClock(const Font& font, const int xPos, const int yPos) { static constexpr char TIME_FORMAT[] = "%H:%M"; static constexpr char TIME_FORMAT_12[] = "%l:%M"; static constexpr char TIME_FORMAT_24[] = "%H:%M"; static constexpr int TIME_LENGTH = 6; time_t rawtime; Loading @@ -600,7 +602,8 @@ void BootAnimation::drawClock(const Font& font, const int xPos, const int yPos) struct tm* timeInfo = localtime(&rawtime); char timeBuff[TIME_LENGTH]; size_t length = strftime(timeBuff, TIME_LENGTH, TIME_FORMAT, timeInfo); const char* timeFormat = mTimeFormat12Hour ? TIME_FORMAT_12 : TIME_FORMAT_24; size_t length = strftime(timeBuff, TIME_LENGTH, timeFormat, timeInfo); if (length != TIME_LENGTH - 1) { ALOGE("Couldn't format time; abandoning boot animation clock"); Loading Loading @@ -1062,6 +1065,11 @@ bool BootAnimation::updateIsTimeAccurate() { } struct stat statResult; if(stat(TIME_FORMAT_12_HOUR_FLAG_FILE_PATH, &statResult) == 0) { mTimeFormat12Hour = true; } if(stat(ACCURATE_TIME_FLAG_FILE_PATH, &statResult) == 0) { mTimeIsAccurate = true; return true; Loading cmds/bootanimation/BootAnimation.h +1 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ private: sp<Surface> mFlingerSurface; bool mClockEnabled; bool mTimeIsAccurate; bool mTimeFormat12Hour; bool mSystemBoot; String8 mZipFileName; SortedVector<String8> mLoadedFiles; Loading cmds/pm/src/com/android/commands/pm/Pm.java +15 −9 Original line number Diff line number Diff line Loading @@ -367,9 +367,12 @@ public final class Pm { private int runInstall() throws RemoteException { final InstallParams params = makeInstallParams(); final String inPath = nextArg(); boolean installExternal = (params.sessionParams.installFlags & PackageManager.INSTALL_EXTERNAL) != 0; if (params.sessionParams.sizeBytes < 0 && inPath != null) { File file = new File(inPath); if (file.isFile()) { if (installExternal) { try { ApkLite baseApk = PackageParser.parseApkLite(file, 0); PackageLite pkgLite = new PackageLite(null, baseApk, null, null, null); Loading @@ -380,6 +383,9 @@ public final class Pm { System.err.println("Error: Failed to parse APK file : " + e); return 1; } } else { params.sessionParams.setSize(file.length()); } } } Loading core/java/android/accessibilityservice/AccessibilityService.java +2 −1 Original line number Diff line number Diff line Loading @@ -334,7 +334,8 @@ public abstract class AccessibilityService extends Service { public static final int GLOBAL_ACTION_HOME = 2; /** * Action to toggle showing the overview of recent apps * Action to toggle showing the overview of recent apps. Will fail on platforms that don't * show recent apps. */ public static final int GLOBAL_ACTION_RECENTS = 3; Loading Loading
cmds/am/src/com/android/commands/am/Am.java +22 −0 Original line number Diff line number Diff line Loading @@ -48,7 +48,9 @@ import android.content.pm.InstrumentationInfo; import android.content.pm.ParceledListSlice; import android.content.pm.ResolveInfo; import android.content.pm.UserInfo; import android.content.res.AssetManager; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Rect; import android.os.Binder; import android.os.Build; Loading @@ -64,6 +66,7 @@ import android.os.UserHandle; import android.text.TextUtils; import android.util.AndroidException; import android.util.ArrayMap; import android.util.DisplayMetrics; import android.view.IWindowManager; import com.android.internal.os.BaseCommand; Loading Loading @@ -361,6 +364,8 @@ public class Am extends BaseCommand { "am send-trim-memory: send a memory trim event to a <PROCESS>.\n" + "\n" + "am get-current-user: returns id of the current foreground user.\n" + "\n" + "am supports-multiwindow: returns true if the device supports multiwindow.\n" + "\n" ); Intent.printIntentArgsHelp(pw, ""); Loading Loading @@ -458,6 +463,8 @@ public class Am extends BaseCommand { runSendTrimMemory(); } else if (op.equals("get-current-user")) { runGetCurrentUser(); } else if (op.equals("supports-multiwindow")) { runSupportsMultiwindow(); } else { showError("Error: unknown command '" + op + "'"); } Loading Loading @@ -2534,6 +2541,21 @@ public class Am extends BaseCommand { System.out.println(currentUser.id); } private void runSupportsMultiwindow() throws Exception { // system resources does not contain all the device configuration, construct it manually. Configuration config = mAm.getConfiguration(); if (config == null) { throw new AndroidException("Activity manager has no configuration"); } final DisplayMetrics metrics = new DisplayMetrics(); metrics.setToDefaults(); Resources res = new Resources(AssetManager.getSystem(), metrics, config); System.out.println(res.getBoolean(com.android.internal.R.bool.config_supportsMultiWindow)); } /** * Open the given file for sending into the system process. This verifies * with SELinux that the system will have access to the file. Loading
cmds/bootanimation/BootAnimation.cpp +12 −4 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ static const char LAST_TIME_CHANGED_FILE_NAME[] = "last_time_change"; static const char LAST_TIME_CHANGED_FILE_PATH[] = "/data/system/time/last_time_change"; static const char ACCURATE_TIME_FLAG_FILE_NAME[] = "time_is_accurate"; static const char ACCURATE_TIME_FLAG_FILE_PATH[] = "/data/system/time/time_is_accurate"; static const char TIME_FORMAT_12_HOUR_FLAG_FILE_PATH[] = "/data/system/time/time_format_12_hour"; // Java timestamp format. Don't show the clock if the date is before 2000-01-01 00:00:00. static const long long ACCURATE_TIME_EPOCH = 946684800000; static constexpr char FONT_BEGIN_CHAR = ' '; Loading @@ -99,7 +100,7 @@ static const std::vector<std::string> PLAY_SOUND_BOOTREASON_BLACKLIST { // --------------------------------------------------------------------------- BootAnimation::BootAnimation() : Thread(false), mClockEnabled(true), mTimeIsAccurate(false), mTimeCheckThread(NULL) { mTimeFormat12Hour(false), mTimeCheckThread(NULL) { mSession = new SurfaceComposerClient(); // If the system has already booted, the animation is not being used for a boot. Loading Loading @@ -590,9 +591,10 @@ void BootAnimation::drawText(const char* str, const Font& font, bool bold, int* glBindTexture(GL_TEXTURE_2D, 0); } // We render 24 hour time. // We render 12 or 24 hour time. void BootAnimation::drawClock(const Font& font, const int xPos, const int yPos) { static constexpr char TIME_FORMAT[] = "%H:%M"; static constexpr char TIME_FORMAT_12[] = "%l:%M"; static constexpr char TIME_FORMAT_24[] = "%H:%M"; static constexpr int TIME_LENGTH = 6; time_t rawtime; Loading @@ -600,7 +602,8 @@ void BootAnimation::drawClock(const Font& font, const int xPos, const int yPos) struct tm* timeInfo = localtime(&rawtime); char timeBuff[TIME_LENGTH]; size_t length = strftime(timeBuff, TIME_LENGTH, TIME_FORMAT, timeInfo); const char* timeFormat = mTimeFormat12Hour ? TIME_FORMAT_12 : TIME_FORMAT_24; size_t length = strftime(timeBuff, TIME_LENGTH, timeFormat, timeInfo); if (length != TIME_LENGTH - 1) { ALOGE("Couldn't format time; abandoning boot animation clock"); Loading Loading @@ -1062,6 +1065,11 @@ bool BootAnimation::updateIsTimeAccurate() { } struct stat statResult; if(stat(TIME_FORMAT_12_HOUR_FLAG_FILE_PATH, &statResult) == 0) { mTimeFormat12Hour = true; } if(stat(ACCURATE_TIME_FLAG_FILE_PATH, &statResult) == 0) { mTimeIsAccurate = true; return true; Loading
cmds/bootanimation/BootAnimation.h +1 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ private: sp<Surface> mFlingerSurface; bool mClockEnabled; bool mTimeIsAccurate; bool mTimeFormat12Hour; bool mSystemBoot; String8 mZipFileName; SortedVector<String8> mLoadedFiles; Loading
cmds/pm/src/com/android/commands/pm/Pm.java +15 −9 Original line number Diff line number Diff line Loading @@ -367,9 +367,12 @@ public final class Pm { private int runInstall() throws RemoteException { final InstallParams params = makeInstallParams(); final String inPath = nextArg(); boolean installExternal = (params.sessionParams.installFlags & PackageManager.INSTALL_EXTERNAL) != 0; if (params.sessionParams.sizeBytes < 0 && inPath != null) { File file = new File(inPath); if (file.isFile()) { if (installExternal) { try { ApkLite baseApk = PackageParser.parseApkLite(file, 0); PackageLite pkgLite = new PackageLite(null, baseApk, null, null, null); Loading @@ -380,6 +383,9 @@ public final class Pm { System.err.println("Error: Failed to parse APK file : " + e); return 1; } } else { params.sessionParams.setSize(file.length()); } } } Loading
core/java/android/accessibilityservice/AccessibilityService.java +2 −1 Original line number Diff line number Diff line Loading @@ -334,7 +334,8 @@ public abstract class AccessibilityService extends Service { public static final int GLOBAL_ACTION_HOME = 2; /** * Action to toggle showing the overview of recent apps * Action to toggle showing the overview of recent apps. Will fail on platforms that don't * show recent apps. */ public static final int GLOBAL_ACTION_RECENTS = 3; Loading