Skip to content

Commit a826f9e

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge "Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF)"
2 parents 4f367f3 + a51f0e7 commit a826f9e

File tree

135 files changed

+648
-648
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+648
-648
lines changed

cmds/installd/commands.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static int wait_dexopt(pid_t pid, const char* apk_path)
463463
}
464464
}
465465
if (got_pid != pid) {
466-
LOGW("waitpid failed: wanted %d, got %d: %s\n",
466+
ALOGW("waitpid failed: wanted %d, got %d: %s\n",
467467
(int) pid, (int) got_pid, strerror(errno));
468468
return 1;
469469
}
@@ -472,7 +472,7 @@ static int wait_dexopt(pid_t pid, const char* apk_path)
472472
ALOGV("DexInv: --- END '%s' (success) ---\n", apk_path);
473473
return 0;
474474
} else {
475-
LOGW("DexInv: --- END '%s' --- status=0x%04x, process failed\n",
475+
ALOGW("DexInv: --- END '%s' --- status=0x%04x, process failed\n",
476476
apk_path, status);
477477
return status; /* always nonzero */
478478
}
@@ -595,7 +595,7 @@ void mkinnerdirs(char* path, int basepos, mode_t mode, int uid, int gid,
595595
if (mkdir(path, mode) == 0) {
596596
chown(path, uid, gid);
597597
} else {
598-
LOGW("Unable to make directory %s: %s\n", path, strerror(errno));
598+
ALOGW("Unable to make directory %s: %s\n", path, strerror(errno));
599599
}
600600
}
601601
path[basepos] = '/';
@@ -616,7 +616,7 @@ int movefileordir(char* srcpath, char* dstpath, int dstbasepos,
616616
int dstend = strlen(dstpath);
617617

618618
if (lstat(srcpath, statbuf) < 0) {
619-
LOGW("Unable to stat %s: %s\n", srcpath, strerror(errno));
619+
ALOGW("Unable to stat %s: %s\n", srcpath, strerror(errno));
620620
return 1;
621621
}
622622

@@ -631,7 +631,7 @@ int movefileordir(char* srcpath, char* dstpath, int dstbasepos,
631631
return 1;
632632
}
633633
} else {
634-
LOGW("Unable to rename %s to %s: %s\n",
634+
ALOGW("Unable to rename %s to %s: %s\n",
635635
srcpath, dstpath, strerror(errno));
636636
return 1;
637637
}
@@ -640,7 +640,7 @@ int movefileordir(char* srcpath, char* dstpath, int dstbasepos,
640640

641641
d = opendir(srcpath);
642642
if (d == NULL) {
643-
LOGW("Unable to opendir %s: %s\n", srcpath, strerror(errno));
643+
ALOGW("Unable to opendir %s: %s\n", srcpath, strerror(errno));
644644
return 1;
645645
}
646646

@@ -655,12 +655,12 @@ int movefileordir(char* srcpath, char* dstpath, int dstbasepos,
655655
}
656656

657657
if ((srcend+strlen(name)) >= (PKG_PATH_MAX-2)) {
658-
LOGW("Source path too long; skipping: %s/%s\n", srcpath, name);
658+
ALOGW("Source path too long; skipping: %s/%s\n", srcpath, name);
659659
continue;
660660
}
661661

662662
if ((dstend+strlen(name)) >= (PKG_PATH_MAX-2)) {
663-
LOGW("Destination path too long; skipping: %s/%s\n", dstpath, name);
663+
ALOGW("Destination path too long; skipping: %s/%s\n", dstpath, name);
664664
continue;
665665
}
666666

@@ -716,7 +716,7 @@ int movefiles()
716716
} else {
717717
subfd = openat(dfd, name, O_RDONLY);
718718
if (subfd < 0) {
719-
LOGW("Unable to open update commands at %s%s\n",
719+
ALOGW("Unable to open update commands at %s%s\n",
720720
UPDATE_COMMANDS_DIR_PREFIX, name);
721721
continue;
722722
}
@@ -742,7 +742,7 @@ int movefiles()
742742
// skip comments and empty lines.
743743
} else if (hasspace) {
744744
if (dstpkg[0] == 0) {
745-
LOGW("Path before package line in %s%s: %s\n",
745+
ALOGW("Path before package line in %s%s: %s\n",
746746
UPDATE_COMMANDS_DIR_PREFIX, name, buf+bufp);
747747
} else if (srcpkg[0] == 0) {
748748
// Skip -- source package no longer exists.
@@ -758,7 +758,7 @@ int movefiles()
758758
} else {
759759
char* div = strchr(buf+bufp, ':');
760760
if (div == NULL) {
761-
LOGW("Bad package spec in %s%s; no ':' sep: %s\n",
761+
ALOGW("Bad package spec in %s%s; no ':' sep: %s\n",
762762
UPDATE_COMMANDS_DIR_PREFIX, name, buf+bufp);
763763
} else {
764764
*div = 0;
@@ -767,14 +767,14 @@ int movefiles()
767767
strcpy(dstpkg, buf+bufp);
768768
} else {
769769
srcpkg[0] = dstpkg[0] = 0;
770-
LOGW("Package name too long in %s%s: %s\n",
770+
ALOGW("Package name too long in %s%s: %s\n",
771771
UPDATE_COMMANDS_DIR_PREFIX, name, buf+bufp);
772772
}
773773
if (strlen(div) < PKG_NAME_MAX) {
774774
strcpy(srcpkg, div);
775775
} else {
776776
srcpkg[0] = dstpkg[0] = 0;
777-
LOGW("Package name too long in %s%s: %s\n",
777+
ALOGW("Package name too long in %s%s: %s\n",
778778
UPDATE_COMMANDS_DIR_PREFIX, name, div);
779779
}
780780
if (srcpkg[0] != 0) {
@@ -785,7 +785,7 @@ int movefiles()
785785
}
786786
} else {
787787
srcpkg[0] = 0;
788-
LOGW("Can't create path %s in %s%s\n",
788+
ALOGW("Can't create path %s in %s%s\n",
789789
div, UPDATE_COMMANDS_DIR_PREFIX, name);
790790
}
791791
if (srcpkg[0] != 0) {
@@ -802,7 +802,7 @@ int movefiles()
802802
}
803803
} else {
804804
srcpkg[0] = 0;
805-
LOGW("Can't create path %s in %s%s\n",
805+
ALOGW("Can't create path %s in %s%s\n",
806806
div, UPDATE_COMMANDS_DIR_PREFIX, name);
807807
}
808808
}
@@ -815,7 +815,7 @@ int movefiles()
815815
} else {
816816
if (bufp == 0) {
817817
if (bufp < bufe) {
818-
LOGW("Line too long in %s%s, skipping: %s\n",
818+
ALOGW("Line too long in %s%s, skipping: %s\n",
819819
UPDATE_COMMANDS_DIR_PREFIX, name, buf);
820820
}
821821
} else if (bufp < bufe) {
@@ -825,7 +825,7 @@ int movefiles()
825825
}
826826
readlen = read(subfd, buf+bufe, PKG_PATH_MAX-bufe);
827827
if (readlen < 0) {
828-
LOGW("Failure reading update commands in %s%s: %s\n",
828+
ALOGW("Failure reading update commands in %s%s: %s\n",
829829
UPDATE_COMMANDS_DIR_PREFIX, name, strerror(errno));
830830
break;
831831
} else if (readlen == 0) {

cmds/installd/utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ int create_pkg_path(char path[PKG_PATH_MAX],
8383
if (persona != 0) {
8484
int ret = snprintf(dst, dst_size, "%d/", persona);
8585
if (ret < 0 || (size_t) ret != uid_len + 1) {
86-
LOGW("Error appending UID to APK path");
86+
ALOGW("Error appending UID to APK path");
8787
return -1;
8888
}
8989
}
@@ -326,7 +326,7 @@ int get_path_from_env(dir_rec_t* rec, const char* var) {
326326
const char* path = getenv(var);
327327
int ret = get_path_from_string(rec, path);
328328
if (ret < 0) {
329-
LOGW("Problem finding value for environment variable %s\n", var);
329+
ALOGW("Problem finding value for environment variable %s\n", var);
330330
}
331331
return ret;
332332
}

cmds/keystore/keystore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ int main(int argc, char* argv[]) {
785785
socklen_t size = sizeof(cred);
786786
int credResult = getsockopt(sock, SOL_SOCKET, SO_PEERCRED, &cred, &size);
787787
if (credResult != 0) {
788-
LOGW("getsockopt: %s", strerror(errno));
788+
ALOGW("getsockopt: %s", strerror(errno));
789789
} else {
790790
int8_t request;
791791
if (recv_code(sock, &request)) {

cmds/system_server/system_main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int main(int argc, const char* const argv[])
4949
blockSignals();
5050

5151
// You can trust me, honestly!
52-
LOGW("*** Current priority: %d\n", getpriority(PRIO_PROCESS, 0));
52+
ALOGW("*** Current priority: %d\n", getpriority(PRIO_PROCESS, 0));
5353
setpriority(PRIO_PROCESS, 0, -1);
5454

5555
system_init();

core/jni/AndroidRuntime.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static void blockSigpipe()
397397
sigemptyset(&mask);
398398
sigaddset(&mask, SIGPIPE);
399399
if (sigprocmask(SIG_BLOCK, &mask, NULL) != 0)
400-
LOGW("WARNING: SIGPIPE not blocked\n");
400+
ALOGW("WARNING: SIGPIPE not blocked\n");
401401
}
402402

403403
/*
@@ -890,9 +890,9 @@ void AndroidRuntime::start(const char* className, const char* options)
890890

891891
ALOGD("Shutting down VM\n");
892892
if (mJavaVM->DetachCurrentThread() != JNI_OK)
893-
LOGW("Warning: unable to detach main thread\n");
893+
ALOGW("Warning: unable to detach main thread\n");
894894
if (mJavaVM->DestroyJavaVM() != 0)
895-
LOGW("Warning: VM did not shut down cleanly\n");
895+
ALOGW("Warning: VM did not shut down cleanly\n");
896896
}
897897

898898
void AndroidRuntime::onExit(int code)

core/jni/android/graphics/SurfaceTexture.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ JNISurfaceTextureContext::~JNISurfaceTextureContext()
136136
env->DeleteGlobalRef(mWeakThiz);
137137
env->DeleteGlobalRef(mClazz);
138138
} else {
139-
LOGW("leaking JNI object references");
139+
ALOGW("leaking JNI object references");
140140
}
141141
if (needsDetach) {
142142
detachJNI();
@@ -150,7 +150,7 @@ void JNISurfaceTextureContext::onFrameAvailable()
150150
if (env != NULL) {
151151
env->CallStaticVoidMethod(mClazz, fields.postEvent, mWeakThiz);
152152
} else {
153-
LOGW("onFrameAvailable event will not posted");
153+
ALOGW("onFrameAvailable event will not posted");
154154
}
155155
if (needsDetach) {
156156
detachJNI();

core/jni/android/graphics/TextLayout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ bool TextLayout::prepareRtlTextRun(const jchar* context, jsize start, jsize& cou
228228
if (U_SUCCESS(status)) {
229229
return true;
230230
} else {
231-
LOGW("drawTextRun error %d\n", status);
231+
ALOGW("drawTextRun error %d\n", status);
232232
}
233233
return false;
234234
}

core/jni/android/graphics/TextLayoutCache.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar
450450
isRTL = (paraDir == 1);
451451
useSingleRun = true;
452452
} else if (!U_SUCCESS(status) || rc < 1) {
453-
LOGW("computeValuesWithHarfbuzz -- need to force to single run");
453+
ALOGW("computeValuesWithHarfbuzz -- need to force to single run");
454454
isRTL = (paraDir == 1);
455455
useSingleRun = true;
456456
} else {
@@ -463,7 +463,7 @@ void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar
463463
if (startRun == -1 || lengthRun == -1) {
464464
// Something went wrong when getting the visual run, need to clear
465465
// already computed data before doing a single run pass
466-
LOGW("computeValuesWithHarfbuzz -- visual run is not valid");
466+
ALOGW("computeValuesWithHarfbuzz -- visual run is not valid");
467467
outGlyphs->clear();
468468
outAdvances->clear();
469469
*outTotalAdvance = 0;
@@ -501,13 +501,13 @@ void TextLayoutCacheValue::computeValuesWithHarfbuzz(SkPaint* paint, const UChar
501501
}
502502
}
503503
} else {
504-
LOGW("computeValuesWithHarfbuzz -- cannot set Para");
504+
ALOGW("computeValuesWithHarfbuzz -- cannot set Para");
505505
useSingleRun = true;
506506
isRTL = (bidiReq = 1) || (bidiReq = UBIDI_DEFAULT_RTL);
507507
}
508508
ubidi_close(bidi);
509509
} else {
510-
LOGW("computeValuesWithHarfbuzz -- cannot ubidi_open()");
510+
ALOGW("computeValuesWithHarfbuzz -- cannot ubidi_open()");
511511
useSingleRun = true;
512512
isRTL = (bidiReq = 1) || (bidiReq = UBIDI_DEFAULT_RTL);
513513
}

core/jni/android_app_NativeActivity.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@ static void write_work(int fd, int32_t cmd, int32_t arg1=0, int32_t arg2=0) {
8484

8585
if (res == sizeof(work)) return;
8686

87-
if (res < 0) LOGW("Failed writing to work fd: %s", strerror(errno));
88-
else LOGW("Truncated writing to work fd: %d", res);
87+
if (res < 0) ALOGW("Failed writing to work fd: %s", strerror(errno));
88+
else ALOGW("Truncated writing to work fd: %d", res);
8989
}
9090

9191
static bool read_work(int fd, ActivityWork* outWork) {
9292
int res = read(fd, outWork, sizeof(ActivityWork));
9393
// no need to worry about EINTR, poll loop will just come back again.
9494
if (res == sizeof(ActivityWork)) return true;
9595

96-
if (res < 0) LOGW("Failed reading work fd: %s", strerror(errno));
97-
else LOGW("Truncated reading work fd: %d", res);
96+
if (res < 0) ALOGW("Failed reading work fd: %s", strerror(errno));
97+
else ALOGW("Truncated reading work fd: %d", res);
9898
return false;
9999
}
100100

@@ -108,7 +108,7 @@ AInputQueue::AInputQueue(const sp<InputChannel>& channel, int workWrite) :
108108
mWorkWrite(workWrite), mConsumer(channel), mSeq(0) {
109109
int msgpipe[2];
110110
if (pipe(msgpipe)) {
111-
LOGW("could not create pipe: %s", strerror(errno));
111+
ALOGW("could not create pipe: %s", strerror(errno));
112112
mDispatchKeyRead = mDispatchKeyWrite = -1;
113113
} else {
114114
mDispatchKeyRead = msgpipe[0];
@@ -187,7 +187,7 @@ int32_t AInputQueue::getEvent(AInputEvent** outEvent) {
187187
}
188188
}
189189
if (*outEvent == NULL) {
190-
LOGW("getEvent couldn't find inflight for seq %d", finish.seq);
190+
ALOGW("getEvent couldn't find inflight for seq %d", finish.seq);
191191
}
192192
}
193193
mLock.unlock();
@@ -211,7 +211,7 @@ int32_t AInputQueue::getEvent(AInputEvent** outEvent) {
211211
InputEvent* myEvent = NULL;
212212
res = mConsumer.consume(this, &myEvent);
213213
if (res != android::OK) {
214-
LOGW("channel '%s' ~ Failed to consume input event. status=%d",
214+
ALOGW("channel '%s' ~ Failed to consume input event. status=%d",
215215
mConsumer.getChannel()->getName().string(), res);
216216
mConsumer.sendFinishedSignal(false);
217217
return -1;
@@ -265,7 +265,7 @@ void AInputQueue::finishEvent(AInputEvent* event, bool handled, bool didDefaultH
265265
if (inflight.doFinish) {
266266
int32_t res = mConsumer.sendFinishedSignal(handled);
267267
if (res != android::OK) {
268-
LOGW("Failed to send finished signal on channel '%s'. status=%d",
268+
ALOGW("Failed to send finished signal on channel '%s'. status=%d",
269269
mConsumer.getChannel()->getName().string(), res);
270270
}
271271
}
@@ -281,7 +281,7 @@ void AInputQueue::finishEvent(AInputEvent* event, bool handled, bool didDefaultH
281281
}
282282
mLock.unlock();
283283

284-
LOGW("finishEvent called for unknown event: %p", event);
284+
ALOGW("finishEvent called for unknown event: %p", event);
285285
}
286286

287287
void AInputQueue::dispatchEvent(android::KeyEvent* event) {
@@ -398,7 +398,7 @@ bool AInputQueue::preDispatchKey(KeyEvent* keyEvent) {
398398
}
399399
}
400400

401-
LOGW("preDispatchKey called for unknown event: %p", keyEvent);
401+
ALOGW("preDispatchKey called for unknown event: %p", keyEvent);
402402
return false;
403403
}
404404

@@ -412,8 +412,8 @@ void AInputQueue::wakeupDispatch() {
412412

413413
if (res == sizeof(dummy)) return;
414414

415-
if (res < 0) LOGW("Failed writing to dispatch fd: %s", strerror(errno));
416-
else LOGW("Truncated writing to dispatch fd: %d", res);
415+
if (res < 0) ALOGW("Failed writing to dispatch fd: %s", strerror(errno));
416+
else ALOGW("Truncated writing to dispatch fd: %d", res);
417417
}
418418

419419
namespace android {
@@ -629,7 +629,7 @@ static int mainWorkCallback(int fd, int events, void* data) {
629629
checkAndClearExceptionFromCallback(code->env, "hideIme");
630630
} break;
631631
default:
632-
LOGW("Unknown work command: %d", work.cmd);
632+
ALOGW("Unknown work command: %d", work.cmd);
633633
break;
634634
}
635635

@@ -660,21 +660,21 @@ loadNativeCode_native(JNIEnv* env, jobject clazz, jstring path, jstring funcName
660660
env->ReleaseStringUTFChars(funcName, funcStr);
661661

662662
if (code->createActivityFunc == NULL) {
663-
LOGW("ANativeActivity_onCreate not found");
663+
ALOGW("ANativeActivity_onCreate not found");
664664
delete code;
665665
return 0;
666666
}
667667

668668
code->looper = android_os_MessageQueue_getLooper(env, messageQueue);
669669
if (code->looper == NULL) {
670-
LOGW("Unable to retrieve MessageQueue's Looper");
670+
ALOGW("Unable to retrieve MessageQueue's Looper");
671671
delete code;
672672
return 0;
673673
}
674674

675675
int msgpipe[2];
676676
if (pipe(msgpipe)) {
677-
LOGW("could not create pipe: %s", strerror(errno));
677+
ALOGW("could not create pipe: %s", strerror(errno));
678678
delete code;
679679
return 0;
680680
}
@@ -690,7 +690,7 @@ loadNativeCode_native(JNIEnv* env, jobject clazz, jstring path, jstring funcName
690690

691691
code->ANativeActivity::callbacks = &code->callbacks;
692692
if (env->GetJavaVM(&code->vm) < 0) {
693-
LOGW("NativeActivity GetJavaVM failed");
693+
ALOGW("NativeActivity GetJavaVM failed");
694694
delete code;
695695
return 0;
696696
}

0 commit comments

Comments
 (0)