use of android.util.PrintStreamPrinter in project android_frameworks_base by ParanoidAndroid.
the class Ime method runList.
/**
* Execute the list sub-command.
*/
private void runList() {
String opt;
boolean all = false;
boolean brief = false;
while ((opt = nextOption()) != null) {
if (opt.equals("-a")) {
all = true;
} else if (opt.equals("-s")) {
brief = true;
} else {
System.err.println("Error: Unknown option: " + opt);
showUsage();
return;
}
}
List<InputMethodInfo> methods;
if (!all) {
try {
methods = mImm.getEnabledInputMethodList();
} catch (RemoteException e) {
System.err.println(e.toString());
System.err.println(IMM_NOT_RUNNING_ERR);
return;
}
} else {
try {
methods = mImm.getInputMethodList();
} catch (RemoteException e) {
System.err.println(e.toString());
System.err.println(IMM_NOT_RUNNING_ERR);
return;
}
}
if (methods != null) {
Printer pr = new PrintStreamPrinter(System.out);
for (int i = 0; i < methods.size(); i++) {
InputMethodInfo imi = methods.get(i);
if (brief) {
System.out.println(imi.getId());
} else {
System.out.println(imi.getId() + ":");
imi.dump(pr, " ");
}
}
}
}
use of android.util.PrintStreamPrinter in project android_frameworks_base by ResurrectionRemix.
the class Ime method runList.
/**
* Execute the list sub-command.
*/
private void runList() {
String opt;
boolean all = false;
boolean brief = false;
while ((opt = nextOption()) != null) {
if (opt.equals("-a")) {
all = true;
} else if (opt.equals("-s")) {
brief = true;
} else {
System.err.println("Error: Unknown option: " + opt);
showUsage();
return;
}
}
List<InputMethodInfo> methods;
if (!all) {
try {
methods = mImm.getEnabledInputMethodList();
} catch (RemoteException e) {
System.err.println(e.toString());
System.err.println(IMM_NOT_RUNNING_ERR);
return;
}
} else {
try {
methods = mImm.getInputMethodList();
} catch (RemoteException e) {
System.err.println(e.toString());
System.err.println(IMM_NOT_RUNNING_ERR);
return;
}
}
if (methods != null) {
Printer pr = new PrintStreamPrinter(System.out);
for (int i = 0; i < methods.size(); i++) {
InputMethodInfo imi = methods.get(i);
if (brief) {
System.out.println(imi.getId());
} else {
System.out.println(imi.getId() + ":");
imi.dump(pr, " ");
}
}
}
}
use of android.util.PrintStreamPrinter in project android_frameworks_base by DirtyUnicorns.
the class PackageManagerService method setLastChosenActivity.
@Override
public void setLastChosenActivity(Intent intent, String resolvedType, int flags, IntentFilter filter, int match, ComponentName activity) {
final int userId = UserHandle.getCallingUserId();
if (DEBUG_PREFERRED) {
Log.v(TAG, "setLastChosenActivity intent=" + intent + " resolvedType=" + resolvedType + " flags=" + flags + " filter=" + filter + " match=" + match + " activity=" + activity);
filter.dump(new PrintStreamPrinter(System.out), " ");
}
intent.setComponent(null);
final List<ResolveInfo> query = queryIntentActivitiesInternal(intent, resolvedType, flags, userId);
// Find any earlier preferred or last chosen entries and nuke them
findPreferredActivity(intent, resolvedType, flags, query, 0, false, true, false, userId);
// Add the new activity as the last chosen for this filter
addPreferredActivityInternal(filter, match, null, activity, false, userId, "Setting last chosen");
}
use of android.util.PrintStreamPrinter in project platform_frameworks_base by android.
the class Ime method runList.
/**
* Execute the list sub-command.
*/
private void runList() {
String opt;
boolean all = false;
boolean brief = false;
while ((opt = nextOption()) != null) {
if (opt.equals("-a")) {
all = true;
} else if (opt.equals("-s")) {
brief = true;
} else {
System.err.println("Error: Unknown option: " + opt);
showUsage();
return;
}
}
List<InputMethodInfo> methods;
if (!all) {
try {
methods = mImm.getEnabledInputMethodList();
} catch (RemoteException e) {
System.err.println(e.toString());
System.err.println(IMM_NOT_RUNNING_ERR);
return;
}
} else {
try {
methods = mImm.getInputMethodList();
} catch (RemoteException e) {
System.err.println(e.toString());
System.err.println(IMM_NOT_RUNNING_ERR);
return;
}
}
if (methods != null) {
Printer pr = new PrintStreamPrinter(System.out);
for (int i = 0; i < methods.size(); i++) {
InputMethodInfo imi = methods.get(i);
if (brief) {
System.out.println(imi.getId());
} else {
System.out.println(imi.getId() + ":");
imi.dump(pr, " ");
}
}
}
}
use of android.util.PrintStreamPrinter in project platform_frameworks_base by android.
the class PackageManagerService method setLastChosenActivity.
@Override
public void setLastChosenActivity(Intent intent, String resolvedType, int flags, IntentFilter filter, int match, ComponentName activity) {
final int userId = UserHandle.getCallingUserId();
if (DEBUG_PREFERRED) {
Log.v(TAG, "setLastChosenActivity intent=" + intent + " resolvedType=" + resolvedType + " flags=" + flags + " filter=" + filter + " match=" + match + " activity=" + activity);
filter.dump(new PrintStreamPrinter(System.out), " ");
}
intent.setComponent(null);
final List<ResolveInfo> query = queryIntentActivitiesInternal(intent, resolvedType, flags, userId);
// Find any earlier preferred or last chosen entries and nuke them
findPreferredActivity(intent, resolvedType, flags, query, 0, false, true, false, userId);
// Add the new activity as the last chosen for this filter
addPreferredActivityInternal(filter, match, null, activity, false, userId, "Setting last chosen");
}
Aggregations