Skip to content

Commit c56f806

Browse files
xaionaro@dx.centerxaionaro@dx.center
authored andcommitted
fix: replace magic string "com.android.shell" with binder.DefaultCallerIdentity().PackageName in README
1 parent c53d383 commit c56f806

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func main() {
4747
sm := servicemanager.New(transport)
4848

4949
lm, _ := location.GetLocationManager(ctx, sm)
50-
loc, err := lm.GetLastLocation(ctx, location.FusedProvider, location.LastLocationRequest{}, "com.android.shell")
50+
loc, err := lm.GetLastLocation(ctx, location.FusedProvider, location.LastLocationRequest{}, binder.DefaultCallerIdentity().PackageName)
5151
if err != nil {
5252
log.Fatal(err)
5353
}
@@ -168,7 +168,7 @@ import (
168168
log.Fatal(err)
169169
}
170170

171-
loc, err := lm.GetLastLocation(ctx, location.FusedProvider, location.LastLocationRequest{}, "com.android.shell")
171+
loc, err := lm.GetLastLocation(ctx, location.FusedProvider, location.LastLocationRequest{}, binder.DefaultCallerIdentity().PackageName)
172172
if err != nil {
173173
log.Fatal(err)
174174
}

tools/cmd/spec2readme/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func main() {
193193
sm := servicemanager.New(transport)
194194
195195
lm, _ := location.GetLocationManager(ctx, sm)
196-
loc, err := lm.GetLastLocation(ctx, location.FusedProvider, location.LastLocationRequest{}, "com.android.shell")
196+
loc, err := lm.GetLastLocation(ctx, location.FusedProvider, location.LastLocationRequest{}, binder.DefaultCallerIdentity().PackageName)
197197
if err != nil {
198198
log.Fatal(err)
199199
}
@@ -247,7 +247,7 @@ import (
247247
log.Fatal(err)
248248
}
249249
250-
loc, err := lm.GetLastLocation(ctx, location.FusedProvider, location.LastLocationRequest{}, "com.android.shell")
250+
loc, err := lm.GetLastLocation(ctx, location.FusedProvider, location.LastLocationRequest{}, binder.DefaultCallerIdentity().PackageName)
251251
if err != nil {
252252
log.Fatal(err)
253253
}

0 commit comments

Comments
 (0)